Eric Blake
2014-Jan-08 14:44 UTC
[libvirt-users] Canceling a live migration via virsh? (QEMU/KVM)
On 01/08/2014 07:46 AM, Scott Sullivan wrote:> I am using QEMU/KVM, using Live Migrations like this: > > virsh migrate --live ${name} qemu+ssh://${DESTINATION}/system > > My question, running this command makes it hang in the foreground. Is > there a way for this to return immediately, so I can just poll for the > migration status?Not at the moment, but it might be worth adding a 'migrate --detach' flag for that purpose, then using job control commands to track progress independently.> Also, is there a way to _cancel_ a migration?Hit Ctrl-C (or any other approach for sending SIGINT to virsh).> I see > the --timeout option, however if a given timeout is reached I would > rather have the ability to cancel the migration than force the suspend. > > I do see there is a QEMU api migrate_cancel..eg: > > virsh qemu-monitor-command ${name} --pretty '{"execute":"migrate_cancel"}' > > Is that the only way to cancel a migration using libvirt?That way is unsupported. The supported way (and the way used by ctrl-C during 'virsh migrate') is to call virDomainAbortJob(). -- 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/20140108/a8fe3207/attachment.sig>
Scott Sullivan
2014-Jan-08 14:46 UTC
[libvirt-users] Canceling a live migration via virsh? (QEMU/KVM)
I am using QEMU/KVM, using Live Migrations like this: virsh migrate --live ${name} qemu+ssh://${DESTINATION}/system My question, running this command makes it hang in the foreground. Is there a way for this to return immediately, so I can just poll for the migration status? Also, is there a way to _cancel_ a migration? I see the --timeout option, however if a given timeout is reached I would rather have the ability to cancel the migration than force the suspend. I do see there is a QEMU api migrate_cancel..eg: virsh qemu-monitor-command ${name} --pretty '{"execute":"migrate_cancel"}' Is that the only way to cancel a migration using libvirt?
Scott Sullivan
2014-Jan-08 15:25 UTC
Re: [libvirt-users] Canceling a live migration via virsh? (QEMU/KVM)
On 01/08/2014 09:44 AM, Eric Blake wrote:> On 01/08/2014 07:46 AM, Scott Sullivan wrote: >> I am using QEMU/KVM, using Live Migrations like this: >> >> virsh migrate --live ${name} qemu+ssh://${DESTINATION}/system >> >> My question, running this command makes it hang in the foreground. Is >> there a way for this to return immediately, so I can just poll for the >> migration status? > Not at the moment, but it might be worth adding a 'migrate --detach' > flag for that purpose, then using job control commands to track progress > independently. > >> Also, is there a way to _cancel_ a migration? > Hit Ctrl-C (or any other approach for sending SIGINT to virsh). > >> I see >> the --timeout option, however if a given timeout is reached I would >> rather have the ability to cancel the migration than force the suspend. >> >> I do see there is a QEMU api migrate_cancel..eg: >> >> virsh qemu-monitor-command ${name} --pretty '{"execute":"migrate_cancel"}' >> >> Is that the only way to cancel a migration using libvirt? > That way is unsupported. The supported way (and the way used by ctrl-C > during 'virsh migrate') is to call virDomainAbortJob(). >Thanks Erik, very helpful response.