The previous article details the installation configuration of the KVM virtual machine http://msiyuetian.blog.51cto.com/8637744/1707539
The following article mainly introduces the basic management of the KVM virtual machine
V. Virsh Command Common operation
1. Open and log into the sub-machine
[Email protected] ~]# Virsh start TPP1
[[email protected] ~]# ssh 192.168.0.10
You can also enter the sub-machine at the same time as open:
[Email protected] ~]# Virsh start Tpp1--console
2. Turn off the sub-machine
[Email protected] ~]# Virsh shutdown TPP1//Off
Note: This need to rely on the Acpid service on the sub-machine, if the sub-machine does not turn on the Acpid service, although the display is closed successfully, but the view is still running status, we need to install on the sub-machine to open the Acpid service
[email protected] ~]# Yum install-y acpid
[[email protected] ~]#/etc/init.d/acpid start
[Email protected] ~]# Virsh destroy TPP1//Another method is to remove it directly from the list
3, Jeanzi with the machine boot automatically start
[[email protected] ~]# Virsh autostart TPP1//Auto-start
[[email protected] ~]# Virsh autostart--disable tpp1//release auto-start
4, List the sub-machine
[[email protected] ~]# Virsh list//can only list the started sub-machine
[[email protected] ~]# Virsh list--all//list all the sub-machines
5. Delete the sub-machine
[Email protected] ~]# Virsh destroy TPP1
[Email protected] ~]# Virsh undefine TPP1
[[email protected] ~]# rm-f/data/tpp1.img//If qcow2 format, delete tpp2.qcow2
6. Suspend and resume the sub-machine
[[email protected] ~]# Virsh suspend TPP1//Hang
[[email protected] ~]# Virsh resume TPP1//recovery
7. Exit the sub-machine
Press CTRL +]
This article is from the "M April Days" blog, please be sure to keep this source http://msiyuetian.blog.51cto.com/8637744/1711927
KVM Virtual Machine Basic Management