Chapter 21. Managing Guest Virtual Machines with virsh
virshis a command-line interface tool for managing guest virtual machines, and works as the primary means of controlling virtualization on Red Hat Enterprise Linux 7. The
virshcommand-line tool is built on the libvirt management API, and can be used to create, deploy, and manage guest virtual machines. The
virshutility is ideal for creating virtualization administration scripts, and users without root privileges can use it in read-only mode. The
virshpackage is installed with
yumas part of the libvirt-client package.
virshcommand set in a logical order based on usage.
virsh list --allcommand, it is most likely due to you running the command using a different user than you used to create the virtual machine. Refer to Important for more information.
21.1. Guest Virtual Machine States and Types
virshcommands are affected by the state of the guest virtual machine:
- Transient - A transient guest does not survive reboot.
- Persistent - A persistent guest virtual machine survives reboot and lasts until it is deleted.
- Undefined - This is a guest virtual machine that has not been defined or created. As such, libvirt is unaware of any guest in this state and will not report about guest virtual machines in this state.
- Shut off - This is a guest virtual machine which is defined, but is not running. Only persistent guests can be considered shut off. As such, when a transient guest virtual machine is put into this state, it ceases to exist.
- Running - The guest virtual machine in this state has been defined and is currently working. This state can be used with both persistent and transient guest virtual machines.
- Paused - The guest virtual machine's execution on the hypervisor has been suspended, or its state has been temporarily stored until it is resumed. Guest virtual machines in this state are not aware they have been suspended and do not notice that time has passed when they are resumed.
- Saved - This state is similar to the paused state, however the guest virtual machine's configuration is saved to persistent storage. Any guest virtual machine in this state is not aware it is paused and does not notice that time has passed once it has been restored.