0

I have a VM’s disk to copy from one host to another for live migration.

I can think of two ways to copy the VM’s disk.

  1. Do a snapshot of the Logical Volume in the original host, create a Logical Volume in the destination host of the same size. Then copy using dd command.

  2. Create a new VM in the destination Logical Volume, then do a snapshot of the Logical Volume from the original host and run rsync to copy all directories and files to the destination Logical Volume with rsync option —delete.

The first method takes longer as it duplicates the entire volume. The second method is less straightforward. What’s the best way to copy the disk?

Abhijeet Kasurde
  • 983
  • 9
  • 20
Purres
  • 239
  • 1
  • 4
  • 18

1 Answers1

2

If you have shared storage, make sure the VM's disk is located on the shared storage, accessible by both hosts, and mounted in the same mountpoint. Then standard, libvirt-directed live migration will simply work.

If you don't have shared storage, KVM/QEMU supports that as well. In more ways than one, in fact [1]

It is, of course, a better idea to use libvirt [2]

[1] http://wiki.qemu.org/Features/LiveBlockMigration
[2] http://libvirt.org/migration.html

dyasny
  • 18,802
  • 6
  • 49
  • 64