summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-08-04 01:11:31 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-04 01:11:31 +0000
commit8b09ebc6ff40a8d03d2eef292a3c710619ee94f2 (patch)
tree12fc92b9440be637a90058703a87aa15ffab06ae /lib
parent2912d5cf3ce7f160a33d0ba1fb681c5cbae33944 (diff)
parentc6884bd8035e8d605ed6e3f702d009491b6712de (diff)
Merge "Enable nested kvm for virtual deployment"
Diffstat (limited to 'lib')
-rwxr-xr-xlib/configure-deps-functions.sh19
-rwxr-xr-xlib/undercloud-functions.sh1
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/configure-deps-functions.sh b/lib/configure-deps-functions.sh
index 06a4c72c..2c5411e3 100755
--- a/lib/configure-deps-functions.sh
+++ b/lib/configure-deps-functions.sh
@@ -135,6 +135,25 @@ Are you sure you have enabled vmx in your bios or hypervisor?${reset}"
return 1
fi
+ # try to enabled nested kvm
+ if [ "$virtual" == "TRUE" ]; then
+ nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
+ if [ "$nested_kvm" != "Y" ]; then
+ # try to enable nested kvm
+ echo 'options kvm-intel nested=1' > /etc/modprobe.d/kvm_intel.conf
+ if rmmod kvm_intel; then
+ modprobe kvm_intel
+ fi
+ nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
+ fi
+ if [ "$nested_kvm" != "Y" ]; then
+ echo "${red}Cannot enable nested kvm, falling back to qemu for deployment${reset}"
+ DEPLOY_OPTIONS+=" --libvirt-type qemu"
+ else
+ echo "${blue}Nested kvm enabled, deploying with kvm acceleration${reset}"
+ fi
+ fi
+
##sshkeygen for root
if [ ! -e ~/.ssh/id_rsa.pub ]; then
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh
index f1c42865..0e26fa89 100755
--- a/lib/undercloud-functions.sh
+++ b/lib/undercloud-functions.sh
@@ -166,7 +166,6 @@ EOI
# vm power on the hypervisor
ssh ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "cat /home/stack/.ssh/id_rsa.pub" >> /root/.ssh/authorized_keys
- DEPLOY_OPTIONS+=" --libvirt-type qemu"
INSTACKENV=$CONFIG/instackenv-virt.json
# upload instackenv file to Undercloud for virtual deployment