Hide Forgot
Description of problem: When guest is in shutdown process of reboot on source and then do live migration, on target, guest does not start, just shutdown and disappear. If the migration process is in start process of reboot, then it is normal . Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.195.el6.x86_64 libvirt-0.9.4-16.el6.x86_64 kernel-2.6.32-206.el6.x86_64 How reproducible: always Steps to Reproduce: 1. prepare a shared nfs with vm image 2. start a vm with the image 3. reboot the vm # virsh list # virsh reboot vm (pls do not run command "reboot" in the guest) 4. migrated the vm before it halted # virsh migrate --live kvm2 qemu+ssh://10.66.7.230/system 5.check the remote host and vm. the vm should finish shutdown in remote machine.but it will not boot up. So the at first it's running then it will disappear #virsh list --all Id Name Status ---------------------------------- 3 vm running #virsh list --all Id Name Status ---------------------------------- Actual results: vm will not boot up when migration during vm reboot Expected results: vm will boot up Additional info:
This is trivial to implement, we just need to transfer the value of priv->fakeReboot through migration cookie to destination to make the destination deamon do the right thing when the domain shuts down
When the guest is rebooting, there are two situations to consider. If the guest rebooting finished after migration job, we implement the fakeReboot in cookie passed into target libvirtd server in Prepare phase. The qemu monitor callback will handle it automatically. If the guest rebooting finished before migration job, we stop the guest bootup on the source, and inform the target libvirtd server in the Perfrom phase and let target libvirtd do the bootup work instead.
patch sent upstream https://www.redhat.com/archives/libvir-list/2012-June/msg00734.html
I think we should just forbid this corner case instead of implementing fakeReboot transfer to destination. I've proposed a patch upstream for that: https://www.redhat.com/archives/libvir-list/2013-November/msg00847.html
I've just pushed patch upstream: commit cc38d68dc1d580fd9acc648e11057b1903ddb247 Author: Michal Privoznik <mprivozn> AuthorDate: Thu Nov 21 16:34:40 2013 +0100 Commit: Michal Privoznik <mprivozn> CommitDate: Fri Nov 22 08:17:30 2013 +0100 virDomainReboot: Document that migration might be unsafe https://bugzilla.redhat.com/show_bug.cgi?id=744967 If a domain is rebooting and a migrate API is called meanwhile we would have to transfer the fakeReboot attribute to the destination in order to prevent domain doing plain shutdown over there. We shouldn't try to do anything clever about it other than documenting this as a known limitation. Signed-off-by: Michal Privoznik <mprivozn> v1.1.4-137-gcc38d68
Moving to POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2014-April/msg00329.html
verify with build: libvirt-0.10.2-33.el6.x86_64 step: 1. prepare a shared nfs with vm image 2. start a vm with the image(install qemu-guest-agent) 3. reboot the vm # virsh list # virsh reboot vm (pls do not run command "reboot" in the guest) 4. migrated the vm before it halted #virsh migrate --live rhel6 qemu+ssh://$target_IP/system --verbose 5.check the target host vm. # virsh list --all Id Name State ---------------------------------------------------- 3 rhel6 shut off [root@intel-i72600-03 33]# virsh list --all Id Name State ---------------------------------------------------- 3 rhel6 paused [root@intel-i72600-03 33]# virsh list --all Id Name State ---------------------------------------------------- 3 rhel6 running migration will succeed. guest worked well. Check source code,the documentation patch already in build, move to verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1374.html