- Create the logical volume on the target. It should be the same size as the source volume.
- Run
nc -l 1234 | dd of=/dev/<vgname>/<lvname>
on the target host. This tells netcat to listen on the network port and pipe everything to the logical volume. - Shutdown the source machine cleanly to write everything to disk.
- Run
dd if=/dev/<vgname>/<lvname> | nc <targetip> 1234
on the source host. This tells netcat to pipe everything over the network to the target host. - Go fetch a cup of coffee. This takes a few minutes depending on your volume size and network speed.
- Copy the xml definitions from
/etc/libvirt/qemu/
from the source to the target. - Edit the storage portion of the xml file and any other necessary bits such as network bridge name if they are different.
- Reload libvirt on the target to read the xml. An
/etc/init.d/libvirt-bin reload
should do the trick (orsystemctl restart libvirtd
for distributions that use systemd) - Start-up the machine on the target host.
Saturday, February 14, 2015
migrate KVM virtual machines
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment