Hide Forgot
libvirt refuses to abort migrations in post-copy mode. However, this features is not properly documented in libvirt API reference documentation. virDomainMigrateStartPostCopy just mentions: "On the other hand once the guest is running on the destination host, the migration can no longer be rolled back because none of the hosts has complete state. If this happens, libvirt will leave the domain paused on both hosts with VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason." This is ambiguous and suggests that the migration might actually be aborted with a libvirt call and leave the VM in an inconsistent state. And virDomainAbortJob documentation doesn't mention anything about that at all. It should be clearly documented that virDomainAbortJob won't abort a migration job in the post-copy mode (and returns with failure on such an attempt) and thus it's safe to call it regardless of the migration phase.
Sent upstream for review: https://www.redhat.com/archives/libvir-list/2017-March/msg01702.html
Pushed upstream as commit 9e8164d2f9ee74e81aa558879f762712ec0c8ea1 Refs: v3.2.0-rc2-4-g9e8164d2f Author: Jiri Denemark <jdenemar> AuthorDate: Fri Mar 31 20:41:39 2017 +0200 Commit: Jiri Denemark <jdenemar> CommitDate: Fri Mar 31 20:41:39 2017 +0200 Document virDomainAbortJob behavior for post-copy migration https://bugzilla.redhat.com/show_bug.cgi?id=1389313 Signed-off-by: Jiri Denemark <jdenemar>
The downstream doc /usr/share/doc/libvirt-docs-3.2.0/html/html/libvirt-libvirt-domain.html has been updated. However, the upstream doc https://libvirt.org/html/libvirt-libvirt-domain.html has not been updated. Would you help to check it?
Hmm, looks like the automatic docs updater on libvirt.org is broken. I'll check with DV.
As in http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob The document has been updated as Requests that the current background job be aborted at the soonest opportunity. In case the job is a migration in a post-copy mode, virDomainAbortJob will report an error (see virDomainMigrateStartPostCopy for more details). And also in http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateStartPostCopy Post-copy migration is guaranteed to converge since each page is transferred at most once no matter how fast it changes. On the other hand once the guest is running on the destination host, the migration can no longer be rolled back because none of the hosts has complete state. If this happens, libvirt will leave the domain paused on both hosts with VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason. It's up to the upper layer to decide what to do in such case. Because of this, libvirt will refuse to cancel post-copy migration via virDomainAbortJob. As the documentation has been updated, hence, mark the bug as 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. https://access.redhat.com/errata/RHEA-2017:1846