compute: don't use 'host-model' CPU mode

The `host-model' CPU mode is known to result in non-working combinations
of CPU features and other parameters (such as CPUID level) which confuse
the guest OS. In particular on Core i7 hosts the avx2 instructions are
advertised to the guest kernel. However depending on the hardware, host
kernel version, *and* qemu these instructions might be unavailable in
the guest mode. Thus a guest kernel gets an invalid opcode exception
(and paincs) when trying to execute an avx2 instruction.

To avoid the problem never enable the `host-model' cpu_mode in nova.conf,
use the libvirt default instead.

As a side effect this patch should make it possible to use the (nested)
hardware assisted virtualization on virtual compute nodes (which might
make MOS/Fuel CI quite a bit faster).

Closes-Bug: #1618473
Change-Id: Id4d36d88ff452b91c2990af5de36b628a13d04ca
(cherry picked from commit 11e7a886d5)
This commit is contained in:
Alexey Sheplyakov 2016-08-30 21:21:06 +03:00 committed by Alexey Stupnikov
parent bd3345ae33
commit d0c55cd2f0
1 changed files with 9 additions and 5 deletions

View File

@ -265,11 +265,15 @@ class openstack::compute (
nova_shell => '/bin/bash',
}
if str2bool($::is_virtual) {
$libvirt_cpu_mode = 'none'
} else {
$libvirt_cpu_mode = 'host-model'
}
# CPU configuration created using host-model may not work as expected.
# The guest CPU may differ from the configuration and it may also confuse
# guest OS by using a combination of CPU features and other parameters (such
# as CPUID level) that don't work. Until these issues are fixed, it's a good
# idea to avoid using host-model
# http://libvirt.org/formatdomain.html#elementsCPU
# https://bugs.launchpad.net/mos/+bug/1618473
$libvirt_cpu_mode = 'none'
# Install / configure nova-compute
# From legacy ceilometer notifications for nova