From 2f0f37f97b575fe7b863d086b00f8f5c470d362a Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Tue, 31 Mar 2015 10:45:57 -0500 Subject: [PATCH] Load appropriate modules for libvirt Loads ebtable_nat, ip6_tables, ip_tables, and the appropriate kvm module if the cpu supports it. Change-Id: I69995b06da6da4169a2f0d207608543820d8a89e --- docker/nova-compute/nova-libvirt/start.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/nova-compute/nova-libvirt/start.sh b/docker/nova-compute/nova-libvirt/start.sh index 8d45070b5e..04e5f97928 100755 --- a/docker/nova-compute/nova-libvirt/start.sh +++ b/docker/nova-compute/nova-libvirt/start.sh @@ -1,5 +1,16 @@ #!/bin/sh +if [[ $(cat /proc/cpuinfo | grep vmx) ]]; then + modprobe kvm_intel +elif [[ $(cat /proc/cpuinfo | grep svm) ]]; then + modprobe kvm_amd +else + echo "WARNING: Your hardware does not support hardware virtualization -" \ + "using qemu software virtualization instead" +fi + +modprobe ip6_tables ip_tables ebtable_nat + # If libvirt is not installed on the host permissions need to be set # If running in qemu, we don't need to set anything as /dev/kvm won't exist if [[ -c /dev/kvm ]]; then