[root@taokey ~]# virt-clone -o kvm_mode_5566 -n mysql-server -f /data/kvmdisk/mysql-server.qcow2
ERROR Domain with devices to clone must be paused or shutoff.
[root@taokey ~]# yum install -y acpid
[root@taokey ~]# virsh
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # list --all
Id Name State
----------------------------------------------------
1 kvm_mode_5566 running
virsh # shutdown kvm_mode_5566
Domain kvm_mode_5566 is being shutdown
virsh # list --all
Id Name State
----------------------------------------------------
- kvm_mode_5566 shut off
[root@taokey qemu]# virsh define cache-server.xml
Domain cache-server defined from cache-server.xml
5.启动虚拟机。
[root@taokey qemu]# virsh start cache-server
Domain cache-server started
6.设置虚拟机自动重启。
[root@taokey qemu]# virsh autostart cache-server
Domain cache-server marked as autostarted
7.查看下所有的虚拟机。
[root@taokey ~]# virsh
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # list --all
Id Name State
----------------------------------------------------
1 kvm_mode_5566 running
2 mysql-server running
3 cache-server running