Using custom fact to determine if we're in a VM
the facter is_virtual fact doesn't seem to work in all cases returning false in some VM's Change-Id: I34919d8c5c74a1c9458d976187335f9e7c2b2fdf
This commit is contained in:
9
packstack/puppet/facts/is_virtual_packstack.rb
Normal file
9
packstack/puppet/facts/is_virtual_packstack.rb
Normal 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
|
@@ -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";
|
||||||
@@ -28,7 +28,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",
|
||||||
|
Reference in New Issue
Block a user