14.13. Displaying Per-guest Virtual Machine Information
This section provides information about displaying virtual machine information for each guest.
14.13.1. Displaying the Guest Virtual Machines
To display the guest virtual machine list and their current states with
# virsh list
Other options available include:
--inactiveoption lists the inactive guest virtual machines (that is, guest virtual machines that have been defined but are not currently active)
--alloption lists all guest virtual machines. For example:
# virsh list --all Id Name State ---------------------------------- 0 Domain-0 running 1 Domain202 paused 2 Domain010 inactive 3 Domain9600 crashedThere are seven states that can be visible using this command:
- Running - The
runningstate refers to guest virtual machines which are currently active on a CPU.
- Idle - The
idlestate indicates that the domain is idle, and may not be running or able to run. This can be caused because the domain is waiting on IO (a traditional wait state) or has gone to sleep because there was nothing else for it to do.
- Paused - The
pausedstate lists domains that are paused. This occurs if an administrator uses the paused button in
virsh suspend. When a guest virtual machine is paused it consumes memory and other resources but it is ineligible for scheduling and CPU resources from the hypervisor.
- Shutdown - The
shutdownstate is for guest virtual machines in the process of shutting down. The guest virtual machine is sent a shutdown signal and should be in the process of stopping its operations gracefully. This may not work with all guest virtual machine operating systems; some operating systems do not respond to these signals.
- Shut off - The
shut offstate indicates that the domain is not running. This can be caused when a domain completely shuts down or has not been started.
- Crashed - The
crashedstate indicates that the domain has crashed and can only occur if the guest virtual machine has been configured not to restart on crash.
- Dying - Domains in the
dyingstate are in is in process of dying, which is a state where the domain has not completely shut-down or crashed.
--managed-saveAlthough this option alone does not filter the domains, it will list the domains that have managed save state enabled. In order to actually list the domains separately you will need to use the
--inactiveoption as well.
--nameis specified domain names are printed in a list. If
--uuidis specified the domain's UUID is printed instead. Using the option
--tablespecifies that a table style output should be used. All three commands are mutually exclusive
--titleThis command must be used with
--titlewill cause an extra column to be created in the table with the short domain description (title).
--persistentincludes persistent domains in a list. Use the
--with-managed-savelists the domains that have been configured with managed save. To list the commands without it, use the command
--state-runningfilters out for the domains that are running,
--state-pausedfor paused domains,
--state-shutofffor domains that are turned off, and
--state-otherlists all states as a fallback.
--autostartthis option will cause the auto-starting domains to be listed. To list domains with this feature disabled, use the option
--with-snapshotwill list the domains whose snapshot images can be listed. To filter for the domains without a snapshot, use the option
$ virsh list --title --name Id Name State Title 0 Domain-0 running Mailserver1 2 rhelvm paused
For an example of
virsh vcpuinfooutput, refer to Section 14.13.2, “Displaying Virtual CPU Information”