From 6ec9671e914018ebed56b18bde69ba5a587c57c1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 28 May 2009 14:38:17 -0700 Subject: [PATCH] xenserver: Create xapi database cache in RPM preinstall step. Until now, the RPM package for XenServer only attempted to save the xapi database cache during the reboot process (from /etc/init.d/management-interface), which happened well after the vswitch was actually installed. This meant that if connectivity to xapi was busted at reboot time, or even just if the machine was rebooted with the reset button instead of through a graceful reboot sequence, then the machine would fail to come up and there would be no way to fix it without removing the vswitch. This commit fixes the problem by writing out the xapi database cache before package installation and aborting the install if the operation fails. --- xenserver/vswitch-xen.spec | 51 ++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/xenserver/vswitch-xen.spec b/xenserver/vswitch-xen.spec index 57797bf8..5c705d42 100644 --- a/xenserver/vswitch-xen.spec +++ b/xenserver/vswitch-xen.spec @@ -114,6 +114,52 @@ EOF fi fi +if test ! -e /etc/vswitch.dbcache; then + if test "$1" = 1; then + printf "Creating xapi database cache... " + else + printf "warning: Open vSwitch is being re-installed or upgraded,\n" + printf " but the xapi database cache is missing.\n" + printf "Re-creating xapi database cache... " + fi + + source /etc/xensource-inventory + if python - "$INSTALLATION_UUID" </dev/null 2>&1; then -- 2.30.2