Merge "Using custom fact to determine if we're in a VM"

This commit is contained in:
Jenkins
2013-01-18 10:49:31 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
# is_virtual doesn't seem to work on all kvm vm's
# this custom one seem to do better
Facter.add("is_virtual_packstack") do
setcode do
Facter::Util::Resolution.exec('grep hypervisor /proc/cpuinfo > /dev/null && echo true || echo false')
end
end

View File

@@ -1,6 +1,6 @@
if $::is_virtual == "true" { if $::is_virtual_packstack == "true" {
$libvirt_type = "qemu" $libvirt_type = "qemu"
nova_config{ nova_config{
"libvirt_cpu_mode": value => "none"; "libvirt_cpu_mode": value => "none";
@@ -30,7 +30,7 @@ class { 'nova::compute::libvirt':
vncserver_listen => "%(CONFIG_NOVA_COMPUTE_HOST)s", vncserver_listen => "%(CONFIG_NOVA_COMPUTE_HOST)s",
} }
if $::is_virtual == "true" and $::operatingsystem == "RedHat" { if $::is_virtual_packstack == "true" and $::operatingsystem == "RedHat" {
file { "/usr/bin/qemu-system-x86_64": file { "/usr/bin/qemu-system-x86_64":
ensure => link, ensure => link,
target => "/usr/libexec/qemu-kvm", target => "/usr/libexec/qemu-kvm",