[virtual] improve detection of proxmox-based KVM virtual machines
Lex Rivera authored 11 years ago
Adrien Thebo committed 11 years ago
81 | 81 |
Facter::Util::Resolution.exec("/sbin/sysctl -n hw.model")
|
82 | 82 |
end
|
83 | 83 |
(txt =~ /QEMU Virtual CPU/) ? true : false
|
|
84 |
(txt =~ /Common KVM processor/) ? true : false
|
84 | 85 |
end
|
85 | 86 |
|
86 | 87 |
def self.virtualbox?
|
121 | 121 |
# --- look for gmetrics for GCE
|
122 | 122 |
# --- 00:05.0 Class 8007: Google, Inc. Device 6442
|
123 | 123 |
result = "gce" if p =~ /Class 8007: Google, Inc/
|
|
124 |
# --- look for Red Hat VirtIO drivers. Commonly used in KVM environment
|
|
125 |
# --- 00:03.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
|
|
126 |
result = "kvm" if p =~ /Red Hat, Inc Virtio/
|
124 | 127 |
end
|
125 | 128 |
else
|
126 | 129 |
output = Facter::Util::Resolution.exec('dmidecode')
|
|
133 | 136 |
result = "hyperv" if pd =~ /Product Name: Virtual Machine/
|
134 | 137 |
result = "rhev" if pd =~ /Product Name: RHEV Hypervisor/
|
135 | 138 |
result = "ovirt" if pd =~ /Product Name: oVirt Node/
|
|
139 |
result = "kvm" if pd =~ /Product Name: Bochs/
|
136 | 140 |
end
|
137 | 141 |
elsif Facter.value(:kernel) == 'SunOS'
|
138 | 142 |
res = Facter::Util::Resolution.new('prtdiag')
|