[ovs-dev] [PATCH] Add "external_ids" column to Open_vSwitch table, add "system-uuid" on Xen.
Ben Pfaff
blp at nicira.com
Tue Mar 9 17:27:45 UTC 2010
Software that interfaces to Open vSwitch needs a way to identify the
host that the switch is running on. This commit adds such a way.
[NB: This has not yet been tested.]
CC: Jeremy Stribling <strib at nicira.com>
---
vswitchd/vswitch.ovsschema | 3 +++
vswitchd/vswitch.xml | 12 ++++++++++++
xenserver/etc_init.d_vswitch | 8 ++++++++
3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 3a20385..f0217cd 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -16,6 +16,9 @@
"type": {"key": {"type": "uuid",
"refTable": "SSL"},
"min": 0, "max": 1}},
+ "external_ids": {
+ "type": {"key": "string", "value": "string",
+ "min": 0, "max": "unlimited"}},
"next_cfg": {
"type": "integer"},
"cur_cfg": {
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 9b1d76a..94b5972 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -29,6 +29,18 @@
<column name="ssl">
SSL used globally by the daemon.
</column>
+
+ <column name="external_ids">
+ Key-value pairs that identify this Open vSwitch's role in
+ external systems. The currently defined key-value pairs are:
+ <dl>
+ <dt><code>system-uuid</code></dt>
+ <dd>A universally unique identifier for the Open vSwitch's
+ physical host. The form of the identifier depends on the
+ type of the host. On a Citrix XenServer, this is the host
+ UUID displayed by, e.g., <code>xe host-list</code>.</dd>
+ </dl>
+ </column>
</group>
<group title="Status">
diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch
index 480f9a9..e60123e 100755
--- a/xenserver/etc_init.d_vswitch
+++ b/xenserver/etc_init.d_vswitch
@@ -318,6 +318,12 @@ EOF
esac
}
+function set_system_uuid {
+ system_uuid=$(. /etc/xensource-inventory && echo $INSTALLATION_UUID) &&
+ test -n "$system_uuid" &&
+ ovs-vsctl set Open_vSwitch external-ids:system-uuid="$system_uuid"
+}
+
function start {
if [ "$FORCE_COREFILES" = "y" ]; then
turn_on_corefiles
@@ -351,6 +357,8 @@ function start {
done
fi
+ action "Configuring Open vSwitch system UUID" set_system_uuid
+
start_vswitchd
start_brcompatd
touch /var/lock/subsys/vswitch
--
1.6.6.1
More information about the dev
mailing list