summaryrefslogtreecommitdiff
path: root/xenserver/etc_init.d_openvswitch
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-05 11:08:25 -0800
committerBen Pfaff <blp@nicira.com>2011-01-07 10:31:29 -0800
commit2ce949ba352d075703fe672cdefd7d020bd042bd (patch)
treed3d0bcc6ccf868efee6111f5370ce3bedcb31e72 /xenserver/etc_init.d_openvswitch
parent6f83469de7edcbeb66449b8488d24a6cfbfb0898 (diff)
downloadopenvswitch-2ce949ba352d075703fe672cdefd7d020bd042bd.tar.gz
xenserver: Generate system UUID for non-XenServer systems.
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@gmail.com> [changed not to set xs-system-uuid on non-XenServer systems] [whitespace changes] [changed to handle missing uuidgen, suggested by Justin Pettit] Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'xenserver/etc_init.d_openvswitch')
-rwxr-xr-xxenserver/etc_init.d_openvswitch12
1 files changed, 11 insertions, 1 deletions
diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index e404c60e2..49cd673d7 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -343,7 +343,17 @@ 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 test -f /etc/openvswitch/install_uuid.conf; then
+ . /etc/openvswitch/install_uuid.conf
+ elif INSTALLATION_UUID=`uuidgen`; then
+ echo "INSTALLATION_UUID=$INSTALLATION_UUID" > /etc/openvswitch/install_uuid.conf
+ else
+ log_failure_msg "missing uuidgen, could not generate system UUID"
+ return
+ fi
+ $vsctl --no-wait --timeout=5 set Open_vSwitch . \
+ external-ids:system-id="$INSTALLATION_UUID"
+ action "Configuring Open vSwitch system IDs" true
fi
}