[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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:
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.)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]