Jul
03
2012
Posted by ebal at
11:09:11
in planet_ellak, planet_Sysadmin
I needed to clone a virtual win2003 machine to a nas storage.
My storage is a lvm partition.
A. Suspend the virtual machine:
# virsh suspend win2003
B. Clone the virtual machine:
# virt-clone -d -o win2003 -n win2003clone -f /nas/storage/win2003clone.raw
This command will change the name, UUID, mac address and of course storage source.
C. Resume the virtual machine:
# virsh resume win2003
Remember that you have to change the IP of the clone, so that will not conflict with the original.
Some extra tips:
If you need to change something before the clone procedure, dump the xml from the virtual machine:
- Dump xml
# virsh dumpxml win2003 > win2003clone.xml
- Edit xml
# vim win2003clone.xml
- Clone the virtual machine
# virt-clone -d --original-xml=/home/ebal/win2003.clone.xml -n win2003clone -f /nas/storage/win2003clone.raw --force
Tag(s):
libvirt,
virt-clone