cloning a virtual machine
virt-clone--original centos6.6_1--name template--file/data/clone1 (. img. qcow2)
if the sub-machine Centos6.6_1 has not been shut down, you need to shut down the computer, otherwise it will be error:
the ERROR must pause or close the domain where you want to clone the device.
the way to turn off the sub-machine is:
Virsh shutdown Centos6.6_1
The Mac and UID of the clone host Nic need to be commented out.
Vim/etc/udev/rules.d/70-persistent-net.rules defines the configuration file for the NIC.
Note: By default, we have no way in the host directly shutdown themselves, we need to rely on the Acpid service on the sub-machine can, this service is to let the host can go to call the sub-machine power off the interface. So,on the sub-machineThe Acpid service needs to be installed and started.
log in to the sub-machine first:
Virsh Console Centos6.6_1
after logging in, install the Acpid service:
Yum install-y acpid
Start:
/etc/init.d/acpid Start
Press CTRL] to exit
at this time to execute Virsh shutdown Centos6.6_1 is OK.
after cloning, Virsh list all will find clone1 this sub-machine, through the command
Virsh start clone1 can turn on the sub-machine.
Cloning a virtual machine