@ -92,15 +92,25 @@ class LinuxVirtual(Virtual):
virtual_facts [ ' virtualization_role ' ] = ' guest '
virtual_facts [ ' virtualization_role ' ] = ' guest '
product_name = get_file_content ( ' /sys/devices/virtual/dmi/id/product_name ' )
product_name = get_file_content ( ' /sys/devices/virtual/dmi/id/product_name ' )
sys_vendor = get_file_content ( ' /sys/devices/virtual/dmi/id/sys_vendor ' )
product_family = get_file_content ( ' /sys/devices/virtual/dmi/id/product_family ' )
if product_name in ( ' KVM ' , ' KVM Server ' , ' Bochs ' , ' AHV ' ) :
if product_name in ( ' KVM ' , ' KVM Server ' , ' Bochs ' , ' AHV ' ) :
virtual_facts [ ' virtualization_type ' ] = ' kvm '
virtual_facts [ ' virtualization_type ' ] = ' kvm '
return virtual_facts
return virtual_facts
if product_name == ' RHEV Hypervisor ' :
if sys_vendor == ' oVirt ' :
virtual_facts [ ' virtualization_type ' ] = ' RHEV '
virtual_facts [ ' virtualization_type ' ] = ' oVirt '
return virtual_facts
return virtual_facts
if sys_vendor == ' Red Hat ' :
if product_family == ' RHV ' :
virtual_facts [ ' virtualization_type ' ] = ' RHV '
return virtual_facts
elif product_name == ' RHEV Hypervisor ' :
virtual_facts [ ' virtualization_type ' ] = ' RHEV '
return virtual_facts
if product_name in ( ' VMware Virtual Platform ' , ' VMware7,1 ' ) :
if product_name in ( ' VMware Virtual Platform ' , ' VMware7,1 ' ) :
virtual_facts [ ' virtualization_type ' ] = ' VMware '
virtual_facts [ ' virtualization_type ' ] = ' VMware '
return virtual_facts
return virtual_facts
@ -123,9 +133,7 @@ class LinuxVirtual(Virtual):
virtual_facts [ ' virtualization_type ' ] = ' kvm '
virtual_facts [ ' virtualization_type ' ] = ' kvm '
return virtual_facts
return virtual_facts
sys_vendor = get_file_content ( ' /sys/devices/virtual/dmi/id/sys_vendor ' )
KVM_SYS_VENDORS = ( ' QEMU ' , ' Amazon EC2 ' , ' DigitalOcean ' , ' Google ' , ' Scaleway ' , ' Nutanix ' )
KVM_SYS_VENDORS = ( ' QEMU ' , ' oVirt ' , ' Amazon EC2 ' , ' DigitalOcean ' , ' Google ' , ' Scaleway ' , ' Nutanix ' )
if sys_vendor in KVM_SYS_VENDORS :
if sys_vendor in KVM_SYS_VENDORS :
virtual_facts [ ' virtualization_type ' ] = ' kvm '
virtual_facts [ ' virtualization_type ' ] = ' kvm '
return virtual_facts
return virtual_facts