LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Clone a bootable Partition with which itself is a disk of a Xen DomU (https://www.linuxquestions.org/questions/linux-general-1/clone-a-bootable-partition-with-which-itself-is-a-disk-of-a-xen-domu-689402/)

t-mow 12-09-2008 03:00 PM

Clone a bootable Partition with which itself is a disk of a Xen DomU
 
Hi!

The last days I am trying to install a Fedora 9 DomU and move it from
host A (my setup machine) to host B (a huge server). I am using a whole
partition of host A as the disk to store the DomU on.

Now i would like to use this DomU as a kind of a master VM which is
configured to run in our environment and may be cloned to get a working
and fully configured DomU. I think this would work very well but so far
I don't get a working copy of the partition that contains the filesystem
of the master VM.

My first idea was to use rsync, since only file are copied and not the
whole partition like dd would do. So i created a new partition on the
same host (when it works on the same host i'll get it working using the
network to another host) and copied the whole filesystem of the master
VM to the new partition using rsync. After that I used dd to copy the
MBR of the old partition.to the new one. Finally I modified the
configuration to use the new partition. As expected the VM boots but
when grub should take the control of the boot process the VM hangs. The
last line of text on the display (VNC Session) is GRUB.

I decided to use dd instead of rsync with the same result except a large
image file and a lot of coffee for all the time it took to create this
file.

Any suggestions on that? A link to a tutorial, how-to or book would be
nice.

cheers

Siqsuruq 12-09-2008 04:03 PM

Create template of DomU:
dd if=/var/lib/xen/images/template of=/var/lib/xen/images/copy bs=4k

Dump configuration of DomU:
virsh dumpxml template > template.xml

Edit config
vim template.xml

Import this to new Domu:
virsh define template.xml
virsh start copy

Xen web site have really good manuals http://tx.downloads.xensource.com/downloads/docs/user/


All times are GMT -5. The time now is 06:17 PM.