From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: virt: Ensure cleanup after failed recovered migration
......................................................................
virt: Ensure cleanup after failed recovered migration
We check for migrations in Vdsm recovery. If we detect that a recovered VM is
migrating to another host, we put it to Migration Source status, which is a
right thing to do. However the other part of that is to make sure the VM gets
out of Migration Source status once the migration finishes, either successfully
or unsuccessfully. This is normally ensured by SourceThread but it doesn't run
anymore after Vdsm recovery.
In case of successful migration libvirt will notify us and we do what's needed
in VM.onJobCompleted. However in case of a failed migration, we may not
receive any notification from libvirt. In order to prevent the VM from
remaining in Migration Source status “forever” (let's say to the next Vdsm
restart), we must check the status of the VM ourselves.
One way to do that is to start a special thread in SourceThread for that
purpose. It checks the migration job status in regular intervals; those
intervals should be not too short to not query libvirt too often and not too
long to avoid possible interference with possibly following domain jobs. Once
the job is finished, we check whether the migration failed and do what's needed
in such a case.
Change-Id: I93394e7a805bad4cf0a1fbf8e7975ee1f04130d0
Signed-off-by: Milan Zamazal <mzamazal(a)redhat.com>
---
M lib/vdsm/virt/migration.py
M vdsm/virt/vm.py
2 files changed, 23 insertions(+), 0 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Francesco Romani: Looks good to me, approved
Milan Zamazal: Verified
--
To view, visit
https://gerrit.ovirt.org/73738
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I93394e7a805bad4cf0a1fbf8e7975ee1f04130d0
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>