Bug 728341

Summary: stopping src libvirtd during migration pauses the guest being migrated
Product: Red Hat Enterprise Linux 7 Reporter: Dave Allan <dallan>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED DEFERRED QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: cwei, dyuan, mzhan, weizhan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-07 12:31:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dave Allan 2011-08-04 18:45:16 UTC
In one shell, I started a migration with:

virsh migrate --live --desturi 'qemu+ssh://root@hybrid0/system' spice

In a second shell, I stopped libvirtd:

service libvirtd stop

The guest remained running during the migration until I stopped the source libvirtd at which point it became paused until I started libvirtd again.  I think the guest should continue to run while libvirtd is stopped, as it would if no migration had been taking place.

Comment 1 Jiri Denemark 2011-08-18 09:48:09 UTC
It's because in normal (non-tunneled) migration libvirtd is not involved in the actual migration process. It just sets everything up, tells qemu to start migration and once that ends (successfully or not), libvirt resumes one of the domains and kills the other one. When the live migration enters its last phase, qemu pauses the domain and transfers the rest of its state. And it stays paused until libvirtd starts and notices that the domain is paused for migration couldn't successfully finish without libvirtd and resumes it.

IMHO the only way to fix this is to route migration data through libvirt so that if libvirtd crashes or is stopped, the migration is automatically canceled since qemu will not be able to send migration data.

Comment 2 Jiri Denemark 2011-08-18 09:49:31 UTC
Actually, there might be another solution. Qemu could be patched to cancel migration in case the monitor connection that requested it is closed. But I have no idea how feasible this is.

Comment 5 Jiri Denemark 2014-08-07 12:31:23 UTC
This is not an issue in practice since a crashed libvirtd will be followed by its restart (systemd restarts the daemon automatically and so does RHEV on RHEL-6 via upstart) and libvirtd will cancel the migration when it starts. I think there's no need to spend time on this bug.