diff options
author | Amrith Kumar <amrith@tesora.com> | 2016-12-20 11:29:07 -0500 |
---|---|---|
committer | Amrith Kumar <amrith@tesora.com> | 2016-12-20 11:29:07 -0500 |
commit | 966b777e78e7f507f6bd0902852a7cd5127d6f90 (patch) | |
tree | fb6cdea38f5db37846324607eb719fcdb3a68c1b | |
parent | 4f9c538f682c0f7234110ec5d1abe933e4ab5bde (diff) | |
download | trove-966b777e78e7f507f6bd0902852a7cd5127d6f90.tar.gz |
formalizing configure_nova_kvm
The earlier hack has proved to be quite good, and has not produced
many problems. Messages echoed to the summary log are not stashed in
logstash, moving to a single message in the log instead. Changed the
function name to a more formal name (configure_nova_kvm) instead of
tweak_nova.
Change-Id: I85364c6530058e964a8eba7fb515d7deadfd5d72
-rw-r--r-- | devstack/plugin.sh | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh index e38a5834..42f6b827 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -100,48 +100,42 @@ function iniset_conditional { } -# tweak_nova() - update the nova hypervisor configuration if possible -function tweak_nova { +# configure_nova_kvm() - update the nova hypervisor configuration if possible +function configure_nova_kvm { + cpu="unknown" + if [ -e /sys/module/kvm_*/parameters/nested ]; then reconfigure_nova="F" if [ -e /sys/module/kvm_intel/parameters/nested ]; then + cpu="Intel" 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 + cpu="AMD" 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 + + virt_type=$(iniget $NOVA_CONF libvirt virt_type) + echo "configure_nova_kvm: using virt_type: ${virt_type} for cpu: ${cpu}." } # configure_trove() - Set config files, create data dirs, etc function configure_trove { setup_develop $TROVE_DIR - tweak_nova + configure_nova_kvm # 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} |