Sysadmin/Migrate virtual machine

From Sugar Labs
< Sysadmin
Revision as of 14:21, 9 December 2009 by Bernie (talk | contribs) (Created page with '== How to migrate a KVM machine from an LVM partition == (untested procedure) First, shutdown the VM, then do: mount /dev/treehouse/beamrider-root /mnt ssh housetree mount /…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to migrate a KVM machine from an LVM partition

(untested procedure)

First, shutdown the VM, then do:

mount /dev/treehouse/beamrider-root /mnt
ssh housetree mount /dev/housetree/beamrider-root /mnt
rsync -PHAXphax --delete --numeric-ids /mnt/ housetree:/mnt/
rsync -a /etc/libvirt/qemu/beamrider.xml housetree:/etc/libvirt/qemu/
umount /mnt
ssh housetree umount /mnt

Then log to $OTHERHOST and create the domain in virsh.

Downtime can be reduced to just a few minutes by doing a first rsync iteration from within the VM while it's still running.

Make sure you pass all the fancy switches to rsync or you'll loose information on the copy.