[libvirt-users] Can I move the disk image of the guest while it is running?

Eric Blake eblake at redhat.com
Wed Feb 5 16:23:04 UTC 2014


On 02/05/2014 08:58 AM, Gergely Horváth wrote:
> Hello guys!
> 
> We want to move some guests' disk images to different locations (within
> the same machine, locally), but we do not want to turn off the guests.
> Can we do that while the guest is running, like live migration?

Yes, live storage migration is possible; although at the moment, qemu is
lacking a way to restart the operation if it fails midstream, so libvirt
only allows the operation if you are willing to temporarily make your
guest transient.

> 
> I did not find any related documentation or posts about it.
> 
> Let's say the guest has a disk at /ssd/image.raw
> We want to move that to /hdd/image.raw
> 
> Is there any way to do that without interrupting the guest?

Not rigorously tested, but this should do it:

virsh dumpxml $dom > file
virsh undefine $dom
virsh blockcopy $dom /ssd/image.raw /hdd/image.raw \
  --wait --verbose --pivot
virsh define file

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140205/f997e27e/attachment.sig>


More information about the libvirt-users mailing list