Gergely Horváth
2014-Feb-05 15:58 UTC
[libvirt-users] Can I move the disk image of the guest while it is running?
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? 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? -- Üdvözlettel / Best regards Horváth Gergely | gergely.horvath@inepex.com IneTrack - Nyomkövetés egyszerűen | Inepex Kft. Ügyfélszolgálat: support@inetrack.hu | +36 30 825 7646 | support.inetrack.hu Web: www.inetrack.hu | nyomkovetes-blog.hu | facebook.com/inetrack Inepex - The White Label GPS fleet-tracking platform | www.inepex.com
Eric Blake
2014-Feb-05 16:23 UTC
Re: [libvirt-users] Can I move the disk image of the guest while it is running?
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
Gergely Horváth
2014-Feb-05 21:54 UTC
Re: [libvirt-users] Can I move the disk image of the guest while it is running?
Thank you Eric, On 2014-02-05 17:23, Eric Blake wrote:> 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.What does this mean? Will I loose anything if - for example - there is not enough space on the target device? Or it will still use the original disk image? AFAIK, a transient guest only means it will disappear after the virtualisation session ends.> virsh dumpxml $dom > file > virsh undefine $dom > virsh blockcopy $dom /ssd/image.raw /hdd/image.raw \ > --wait --verbose --pivot > virsh define fileI could not find anything about "pivot" or "pivoting"? What does --pivot do in this case? Thank you. -- Üdvözlettel / Best regards Horváth Gergely | gergely.horvath@inepex.com IneTrack - Nyomkövetés egyszerűen | Inepex Kft. Ügyfélszolgálat: support@inetrack.hu | +36 30 825 7646 | support.inetrack.hu Web: www.inetrack.hu | nyomkovetes-blog.hu | facebook.com/inetrack Inepex - The White Label GPS fleet-tracking platform | www.inepex.com
Apparently Analagous Threads
- Re: Can I move the disk image of the guest while it is running?
- Re: Can I move the disk image of the guest while it is running?
- Re: Can I move the disk image of the guest while it is running?
- Re: Can I move the disk image of the guest while it is running?
- Can I move the disk image of the guest while it is running?