Cloning xen guest by virt-clone for disk image

Step for cloning xen dumU disk image within the SAME xen host

Summary :

1. Get the vm guest for the xm list

2. Shut down the vm guest

3. Use the virt-clone interactively by providing needed information

4. Change any information such as fixed IP address under new configuration file under /etc/xen

/* Here are the steps */

[root@xen /etc]# xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0     3272     2 r—–   3109.5
vm01                                       5      511     1 -b—-     18.2
[root@xen /etc]# xm shutdown vm01
[root@xen /etc]# virt-clone –prompt
What is the name of the original virtual machine? vm01
What is the name for the cloned virtual machine? vm02
What would you like to use as the cloned disk (file path) for ‘/var/lib/xen/images/vm01.img’? /var/lib/xen/images/vm02.img
Cloning /var/lib/xen/images/vm01.img                     | 7.8 GB     02:08

Clone ‘vm02′ created successfully.

Step for cloning xen dumU disk image to REMOTE xen host

1. Copy both config and disk image to remote machine, i.e.,

scp -p /etc/xen/vm03 192,168,1.38:/etc/xen

rsync -avr /var/lib/xen/images/vm03.img 192.168.1.38:/var/lib/xen/images/vm03.img

2.  Check the config file to see if any information needed to change

Note:

After the files copied to the remote xen host, the new vm guest will be shown automatically under the Virtual Machine Manager.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章