[libvirt] why doesn't libvirt let qemu autostart live-migrated VMs?

Hi, I've been digging through the libvirt code and something that struck me was that it appears that when using qemu libvirt will migrate the instance with autostart disabled, then sit on the source host periodically polling for migration completion, then once the host detects that migration is completed it will tell the destination to start up the VM. Why don't we let the destination autostart the VM once migration is complete? Chris

On Mon, Apr 14, 2014 at 05:50:07PM -0600, Chris Friesen wrote:
Hi,
I've been digging through the libvirt code and something that struck me was that it appears that when using qemu libvirt will migrate the instance with autostart disabled, then sit on the source host periodically polling for migration completion, then once the host detects that migration is completed it will tell the destination to start up the VM.
Why don't we let the destination autostart the VM once migration is complete?
Libvirt has to have synchronization point on the target machine, so that we can acquire any disk leases associated with the VM before the CPUs are started. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 04/15/2014 02:28 AM, Daniel P. Berrange wrote:
On Mon, Apr 14, 2014 at 05:50:07PM -0600, Chris Friesen wrote:
Hi,
I've been digging through the libvirt code and something that struck me was that it appears that when using qemu libvirt will migrate the instance with autostart disabled, then sit on the source host periodically polling for migration completion, then once the host detects that migration is completed it will tell the destination to start up the VM.
Why don't we let the destination autostart the VM once migration is complete?
Libvirt has to have synchronization point on the target machine, so that we can acquire any disk leases associated with the VM before the CPUs are started.
Where does that happen? I'm looking at libvirt/qemu, specifically this code path on the target: remoteDispatchDomainMigrateFinish3ParamsHelper remoteDispatchDomainMigrateFinish3Params virDomainMigrateFinish3Params qemuDomainMigrateFinish3Params qemuMigrationFinish qemuProcessStartCPUs qemuMonitorStartCPUs Thanks, Chris

On Tue, Apr 15, 2014 at 09:09:55AM -0600, Chris Friesen wrote:
On 04/15/2014 02:28 AM, Daniel P. Berrange wrote:
On Mon, Apr 14, 2014 at 05:50:07PM -0600, Chris Friesen wrote:
Hi,
I've been digging through the libvirt code and something that struck me was that it appears that when using qemu libvirt will migrate the instance with autostart disabled, then sit on the source host periodically polling for migration completion, then once the host detects that migration is completed it will tell the destination to start up the VM.
Why don't we let the destination autostart the VM once migration is complete?
Libvirt has to have synchronization point on the target machine, so that we can acquire any disk leases associated with the VM before the CPUs are started.
Where does that happen? I'm looking at libvirt/qemu, specifically this code path on the target:
remoteDispatchDomainMigrateFinish3ParamsHelper remoteDispatchDomainMigrateFinish3Params virDomainMigrateFinish3Params qemuDomainMigrateFinish3Params qemuMigrationFinish qemuProcessStartCPUs qemuMonitorStartCPUs
In the StartCPUs method we call virDomainLockProcessResume We also need the sunchronization point to update our own internal state about active jobs. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Chris Friesen
-
Daniel P. Berrange