[ovs-dev] [suse 3/7] xenserver: Generate system UUID for non-XenServer systems.
Ben Pfaff
blp at nicira.com
Wed Dec 15 19:19:00 UTC 2010
From: Patrick Mullaney <pm.mullaney at gmail.com>
Currently the scripts in xensever/ are intended specifically for XenServer,
but supporting other distros seems like a worthy goal, so this is a step
in the right direction.
It would be good to be able to determine a suitable system-type and
system-version, but those are less important than system-id.
Signed-off-by: Patrick Mullaney <pm.mullaney at gmail.com>
[changed not to set xs-system-uuid on non-XenServer systems]
[whitespace changes]
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
xenserver/etc_init.d_openvswitch | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index a81643d..de749a1 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -341,7 +341,15 @@ function set_system_ids {
external-ids:system-id="$INSTALLATION_UUID" \
external-ids:xs-system-uuid="$INSTALLATION_UUID"
else
- action "Configuring Open vSwitch system IDs" false
+ if [ -f /etc/openvswitch/install_uuid.conf ]; then
+ . /etc/openvswitch/install_uuid.conf
+ else
+ INSTALLATION_UUID=`uuidgen`
+ echo "INSTALLATION_UUID=$INSTALLATION_UUID" > /etc/openvswitch/install_uuid.conf
+ fi
+ $vsctl --no-wait --timeout=5 set Open_vSwitch . \
+ external-ids:system-id="$INSTALLATION_UUID"
+ action "Configuring Open vSwitch system IDs" true
fi
}
--
1.7.1
More information about the dev
mailing list