VirtWhat

Combiner to check if the host is running on a virtual or physical machine. It uses the results of the DMIDecode and VirtWhat parsers. Prefer VirtWhat to DMIDecode.

Examples

>>> vw = shared[VirtWhat]
>>> vw.is_virtual
True
>>> vw.is_physical
False
>>> vw.generic
'kvm'
>>> vw.amended_generic
'rhev'
>>> 'aws' in vw
False
class insights.combiners.virt_what.VirtWhat(dmi, vw)[source]

Bases: object

A combiner for checking if this machine is virtual or physical by checking virt-what or dmidecode command.

Prefer virt-what to dmidecode

is_virtual

It’s running in a virtual machine?

Type:

bool

is_physical

It’s running in a physical machine?

Type:

bool

generic

The type of the virtual machine. ‘baremetal’ if physical machine.

Type:

str

specifics

List of the specific information.

Type:

list

amended_generic

The type of the virtual machine. ‘baremetal’ if physical machine. Added to address an issue with virt_what/dmidecode when identifying ‘ovirt’ vs ‘rhev’. Will match the generic attribute in all other cases.

Type:

str