标签:路径 splay 开机自启 code man cpi The libvirt str
1 [root@kvm-host ~]# virsh list --all
1 [root@kvm-host ~]# virsh console vm01-centos6.8
1 [root@kvm-host ~]# virsh start vm01-centos6.8
1 [root@kvm-host ~]# virsh shutdown vm01-centos6.8
注意:默认状态下virsh工具不能对linux虚拟机进行关机操作,linux操作系统需要开启acpid服务,在KVM linux虚拟机必须配置此服务。
1 yum -y install acpid 2 chkconfig acpid on 3 /etc/init.d/acpid start
1 [root@kvm-host ~]# virsh reboot vm01-centos6.8
1 [root@kvm-host ~]# virsh destroy vm01-centos6.8
1 [root@kvm-host ~]# virsh autostart vm01-centos6.8
1 [root@kvm-host ~]# virsh autostart --disable vm01-centos6.8
1 [root@kvm-host ~]# virsh suspend vm01-centos6.8 #挂起 2 [root@kvm-host ~]# virsh resume vm01-centos6.8 #恢复
1 [root@kvm-host ~]# virsh edit vm01-centos6.8
注:vm01-centos6.8配置文件要求已经define,否则无法edit,也可以直接通过vi修改配置文件。
1 [root@kvm-host ~]# virsh define /etc/libvirt/qemu/vm01-centos6.8.xml
1 [root@kvm-host ~]# virsh create /etc/libvirt/qemu/vm01-centos6.8.xml
1 [root@kvm-host ~]# virsh undefine vm01-centos6.8
注意:此命令只删除虚拟机配置文件,不删除虚拟磁盘文件。
1 [root@kvm-host ~]# virsh dumpxml vm01-centos6.8 > /etc/libvirt/qemu/vm01-centos6.8_dump.xml
1 [root@kvm-host ~]# virsh define /etc/libvirt/qemu/vm01-centos6.8_dump.xml
1 [root@kvm-host ~]# rm -rf /data/images/vm01-centos6.8.img
1 [root@kvm-host ~]# virsh dominfo vm01-centos6.8
1 [root@kvm-host ~]# qemu-img info /data/images/vm01-centos6.8.img
1 [root@kvm-host ~]# virsh vcpuinfo vm01-centos6.8
1 [root@kvm-host ~]# virsh domblklist vm01-centos6.8
路径:/etc/libvirt/qemu/
1 [root@kvm-host ~]# virsh 2 Welcome to virsh, the virtualization interactive terminal. 3 4 Type: ‘help‘ for help with commands 5 ‘quit‘ to quit 6 7 virsh # help
标签:路径 splay 开机自启 code man cpi The libvirt str
原文地址:https://www.cnblogs.com/itzgr/p/9893328.html