[ovs-dev] [PATCH] Add "external_ids" column to Open_vSwitch table, add "system-uuid" on Xen
Justin Pettit
jpettit at nicira.com
Sat Mar 6 03:55:59 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.
Cleaned up version of original implementation by Ben Pfaff.
---
vswitchd/vswitch.ovsschema | 3 +++
vswitchd/vswitch.xml | 12 ++++++++++++
xenserver/etc_init.d_vswitch | 12 ++++++++++++
3 files changed, 27 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..b1014a7 100755
--- a/xenserver/etc_init.d_vswitch
+++ b/xenserver/etc_init.d_vswitch
@@ -318,6 +318,16 @@ EOF
esac
}
+function set_system_uuid {
+ system_uuid=$(. /etc/xensource-inventory && echo $INSTALLATION_UUID)
+ if test -n "$system_uuid"; then
+ action "Configuring Open vSwitch system UUID" true
+ $vsctl set Open_vSwitch . external-ids:system-uuid="$system_uuid"
+ else
+ action "Configuring Open vSwitch system UUID" false
+ fi
+}
+
function start {
if [ "$FORCE_COREFILES" = "y" ]; then
turn_on_corefiles
@@ -351,6 +361,8 @@ function start {
done
fi
+ set_system_uuid
+
start_vswitchd
start_brcompatd
touch /var/lock/subsys/vswitch
--
1.6.5.5
More information about the dev
mailing list