Note: This is an RHCSA 7 exam objective.
Presentation
When talking about virtual machines, it is mainly question of KVM management through the virsh and virt-* commands.
VM Management
To start a virtual machine (here vm.example.com), type:
# virsh start vm.example.com
To stop a virtual machine (here vm.example.com), type:
# virsh shutdown vm.example.com
To stop immediately a virtual machine (here vm.example.com), type:
# virsh destroy vm.example.com
To delete a virtual machine (here vm.example.com), type:
# virsh undefine vm.example.com
To reboot a virtual machine (here vm.example.com), type:
# virsh reboot vm.example.com
To display configuration information (memory, state, autostart, etc) about a virtual machine (here vm.example.com), type:
# virsh dominfo vm.example.com
VM Reporting
To get the list of all the virtual machines (active and inactive), type:
# virsh list --all
Note: Remove the –all option to only get the list of the active virtual machines.
To get a global picture of the VM activities, type:
# virt-top
good cheat sheet
I’ve read that an unbootable VM is a failure on the exam. Is there any way to backup our VM during the exam so we don’t have to start over ?
Thanks,
wbrunc
I don’t think there is a way to backup the VM during the exam but I could be wrong.
If you end up with an unbootable VM, then you can reset it. But as far as I know, there is no way to back it up.