VirtWhat - Command virt-what
¶
Parses the output of the virt-what
command to check if the host is running
in a virtual machine.
- Sample input::
- kvm
Examples
>>> vw = shared[VirtWhat]
>>> vw.is_virtual
True
>>> vw.is_physical
False
>>> vw.generic
'kvm'
>>> 'aws' in vw
False
Note
For virt-what-1.13-8
or older on RHEL7, the command fails when running
without an environment (or very restricted environment), and reports below
error:
virt-what: virt-what-cpuid-helper program not found in $PATH
-
class
insights.parsers.virt_what.
VirtWhat
(*args, **kwargs)[source]¶ Bases:
insights.core.CommandParser
Class for parsing
virt-what
command.-
generic
¶ The type of the virtual machine. ‘baremetal’ if physical machine.
Type: str
-
errors
¶ List of the error information if any error occurs.
Type: list
-
specifics
¶ List of the specific information if the command outputs.
Type: list
-
is_physical
¶ Is the host running in a physical machine? None when something is wrong.
Type: bool
-
is_virtual
¶ Is the host running in a virtual machine? None when something is wrong.
Type: bool
-