[fedora-virt] Trying to move VM efficiently, grub-install, guestfish

Dennis J. dennisml at conversis.de
Thu Oct 29 19:35:58 UTC 2009


Hi,
What I'm currently experimenting with is how to move a VM between two hosts 
efficiently. Specifically we are talking Linux guest with virtual disk 
sizes of 150G of which only about 10-20G are used. Doing a plain "dd" takes 
a lot of time and is kind of wasteful given that 90% of the logical volume 
used doesn't contain relevant data.
So right now I'm trying to re-create the lvm/filesystem structure from 
scratch on the target system and then copying the data using tar from the 
source system. This looks good so far but I cannot start the guest on the 
target because the boot-sector is missing.
I tried using guestfish as described here:
http://rwmj.wordpress.com/2009/05/11/rescuing-a-failed-vm-install-with-guestfish/
but when I issue the "grub-install / /dev/sda" all I get is:
"libguestfs: error: grub_install: grub-install: /dev/sda does not have any 
corresponding BIOS drive."
I also tried copying the MBR using "dd bs=448 count=1 ..." but that only 
results in the output of "GRUB" on the target system and then nothing happens.
What is the best way to copy/initialize the MBR so the target system boots 
again?

Another method I intend to test is to copy the entire volume with "dd" 
while the VM is still running then shutting the VM down and using "rsync" 
to do the final fixup on the logical volumes. That of course assumes that 
rsync actually works on device nodes which I'm not so sure about.

Has anyone experience with this kind of thing?
(Just to be clear I'm not talking about cloning the VM requiring making 
changes to the files in the VM but just simply moving the VM to another 
host with as little down-time as possible.)

Regards,
   Dennis




More information about the Fedora-virt mailing list