diff options
author | Amrith Kumar <amrith@tesora.com> | 2016-12-16 18:42:58 -0500 |
---|---|---|
committer | Amrith Kumar <amrith@tesora.com> | 2016-12-17 12:13:31 -0500 |
commit | 47971156f3c4f625da2ea28487cd22b2c5c39450 (patch) | |
tree | d7c2d2fd19266163de0122cd8614433e65c0e315 /devstack | |
parent | 48f4fa52f9ebc2673ef8c559791a3c9355b15f07 (diff) | |
download | trove-47971156f3c4f625da2ea28487cd22b2c5c39450.tar.gz |
Tweak trove devstack plugin
Tweak the trove devstack plugin to force KVM if possible. This change
is semi-experimental. I would like to see how it performs in the gate,
it seems to be fine on my local machine. It takes some precautions to
only force kvm if it is possible.
In speaking with infra, there are also some known stability issues
with kvm and part of the experiment here is to see what those are. The
other part is to quantify the improvement that it brings to the trove
gate.
Change-Id: I209d3202b4f6414cd3430c11f2ccdb8d5b541d94
Diffstat (limited to 'devstack')
-rw-r--r-- | devstack/plugin.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 504958ec..e38a5834 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -100,10 +100,49 @@ function iniset_conditional { } +# tweak_nova() - update the nova hypervisor configuration if possible +function tweak_nova { + if [ -e /sys/module/kvm_*/parameters/nested ]; then + reconfigure_nova="F" + + if [ -e /sys/module/kvm_intel/parameters/nested ]; then + if [[ "$(cat /sys/module/kvm_*/parameters/nested)" == "Y" ]]; then + reconfigure_nova="Y" + else + echo_summary "Found Intel with no support for nested KVM." + fi + elif [ -e /sys/module/kvm_amd/parameters/nested ]; then + if [[ "$(cat /sys/module/kvm_*/parameters/nested)" == "1" ]]; then + reconfigure_nova="Y" + else + echo_summary "Found AMD with no support for nested KVM." + fi + fi + + if [ "${reconfigure_nova}" == "Y" ]; then + echo_summary "Configuring Nova to use KVM." + + NOVA_CONF_DIR=${NOVA_CONF_DIR:-/etc/nova} + NOVA_CONF=${NOVA_CONF:-${NOVA_CONF_DIR}/nova.conf} + iniset $NOVA_CONF libvirt cpu_mode "none" + iniset $NOVA_CONF libvirt virt_type "kvm" + else + virt_type=$(iniget $NOVA_CONF libvirt virt_type) + echo_summary "Nested hypervisor not supported, using ${virt_type}." + fi + else + virt_type=$(iniget $NOVA_CONF libvirt virt_type) + echo_summary "Unable to configure Nova to use KVM, using ${virt_type}." + echo "Unable to configure Nova to use KVM, using ${virt_type}." + fi +} + # configure_trove() - Set config files, create data dirs, etc function configure_trove { setup_develop $TROVE_DIR + tweak_nova + # Create the trove conf dir and cache dirs if they don't exist sudo install -d -o $STACK_USER ${TROVE_CONF_DIR} ${TROVE_AUTH_CACHE_DIR} |