Update libvirt cpu map before starting nova
We are trying to get a working 64bit qemu cpu model in the gate for nova
live migration testing. It appears that we need to make this change
prior to nova starting.
Make the change in configure_libvirt() to handle this along with the
other libvirt config updates. This allows us to restart the libvirt
service once. This function calls a python tool which parses and updates
the XML if necessary.
Change-Id: I00667713bfba67ab8cedbcb1660ff94d4f4bcc07
diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt
index 4d617e8..763afaf 100644
--- a/lib/nova_plugins/functions-libvirt
+++ b/lib/nova_plugins/functions-libvirt
@@ -110,10 +110,18 @@
fi
fi
+ # Update the libvirt cpu map with a gate64 cpu model. This enables nova
+ # live migration for 64bit guest OSes on heterogenous cloud "hardware".
+ if [[ -f /usr/share/libvirt/cpu_map.xml ]] ; then
+ sudo $TOP_DIR/tools/cpu_map_update.py /usr/share/libvirt/cpu_map.xml
+ fi
+
# libvirt detects various settings on startup, as we potentially changed
# the system configuration (modules, filesystems), we need to restart
- # libvirt to detect those changes.
- restart_service $LIBVIRT_DAEMON
+ # libvirt to detect those changes. Use a stop start as otherwise the new
+ # cpu_map is not loaded properly on some systems (Ubuntu).
+ stop_service $LIBVIRT_DAEMON
+ start_service $LIBVIRT_DAEMON
}