vswitchd: Add OVS version to database, give system info its own columns.
authorBen Pfaff <blp@nicira.com>
Mon, 27 Dec 2010 18:18:14 +0000 (10:18 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 27 Dec 2010 18:18:14 +0000 (10:18 -0800)
Until now, nothing in the database has reported the Open vSwitch version
number.  This commit adds that.

In addition, this commits moves the system type and version from
external-ids to individual columns, because we decided that these were
important enough not to relegate them to a grab-bag field.

vswitchd/vswitch.ovsschema
vswitchd/vswitch.xml
xenserver/etc_init.d_openvswitch

index 52573e5..04b691a 100644 (file)
                   "min": 0, "max": "unlimited"}},
        "statistics": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
-         "ephemeral": true}},
+         "ephemeral": true},
+       "ovs_version": {
+         "type": {"key": {"type": "string"},
+                  "min": 0, "max": 1}},
+       "system_type": {
+         "type": {"key": {"type": "string"},
+                  "min": 0, "max": 1}},
+       "system_version": {
+         "type": {"key": {"type": "string"},
+                  "min": 0, "max": 1}}},
      "maxRows": 1},
    "Capability": {
      "columns": {
index 7b7a1ac..9f079e8 100644 (file)
         choose key names that are likely to be unique.  The currently
         defined common key-value pairs are:
         <dl>
-          <dt><code>system-type</code></dt>
-          <dd>An identifier for the switch type, such as
-            <code>XenServer</code> or <code>KVM</code>.</dd>
-          <dt><code>system-version</code></dt>
-          <dd>The version of the switch software, such as
-            <code>5.6.0</code> on XenServer.</dd>
           <dt><code>system-id</code></dt>
           <dd>A unique identifier for the Open vSwitch's physical host.
             The form of the identifier depends on the type of the host.
       </column>
     </group>
 
+    <group title="Version Reporting">
+      <p>
+       These columns report the types and versions of the hardware and
+       software running Open vSwitch.  We recommend in general that software
+       should test whether specific features are supported instead of relying
+       on version number checks.  These values are primarily intended for
+       reporting to human administrators.
+      </p>
+
+      <column name="ovs_version">
+       The Open vSwitch version number, e.g. <code>1.1.0pre2</code>.
+       If Open vSwitch was configured with a build number, then it is
+       also included, e.g. <code>1.1.0pre2+build4948</code>.
+      </column>
+
+      <column name="system_type">
+        <p>
+         An identifier for the type of system on top of which Open vSwitch
+         runs, e.g. <code>XenServer</code> or <code>KVM</code>.
+       </p>
+       <p>
+         System integrators are responsible for choosing and setting an
+         appropriate value for this column.
+       </p>
+      </column>
+
+      <column name="system_version">
+        <p>
+         The version of the system identified by <ref column="system_type"/>,
+         e.g. <code>5.5.0-24648p</code> on XenServer 5.5.0 build 24648.
+       </p>
+       <p>
+         System integrators are responsible for choosing and setting an
+         appropriate value for this column.
+       </p>
+      </column>
+       
+    </group>
+
     <group title="Database Configuration">
       <p>
         These columns primarily configure the Open vSwitch database
index 5f18196..0a2fc78 100755 (executable)
@@ -298,10 +298,12 @@ EOF
 
 function set_system_ids {
     if [ -f /etc/xensource-inventory ]; then
+        OVS_VERSION=`ovs-vswitchd --version | sed 's/.*) //;1q'`
         action "Configuring Open vSwitch system IDs" true
         $vsctl --no-wait --timeout=5 set Open_vSwitch . \
-            external-ids:system-type="$PRODUCT_BRAND" \
-            external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
+            ovs-version="$OVS_VERSION" \
+            system-type="$PRODUCT_BRAND" \
+            system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
             external-ids:system-id="$INSTALLATION_UUID" \
             external-ids:xs-system-uuid="$INSTALLATION_UUID"
     else