From 2ce949ba352d075703fe672cdefd7d020bd042bd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 5 Jan 2011 11:08:25 -0800 Subject: [PATCH] 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 [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 --- xenserver/etc_init.d_openvswitch | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index e404c60e..49cd673d 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 } -- 2.30.2