RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1368774 - libvirt changes the guest xml on target host even if migration failed
Summary: libvirt changes the guest xml on target host even if migration failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-21 11:23 UTC by yafu
Modified: 2020-09-10 09:44 UTC (History)
9 users (show)

Fixed In Version: libvirt-2.0.0-9.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:53:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description yafu 2016-08-21 11:23:03 UTC
Description of problem:
libvirt changes the guest xml on target host even if migration failed

Version-Release number of selected component (if applicable):
libvirt-2.0.0-5.el7.x86_64
qemu-kvm-rhev-2.6.0-21.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
 
1.set this in source host qemu.conf and restart libvirtd service:

security_driver = "none"

2.set this in target host qemu.conf and restart libvirtd service:

security_driver = "selinux"

3.start a guest without seclabel in source, check the live xml of guest :
#virsh dumpxml rhel7.3
no seclabel

4. migrate to target with option(success):

# virsh migrate rhel7.3 --live qemu+ssh://yafu-test/system --dname rhel73-2 --verbose --p2p --tunnelled

5.try to migrate this guest back to source(fail and cause this issue):

# virsh migrate rhel73-2 --live qemu+ssh://test1/system --dname rhel7.3
error: unsupported configuration: Unable to find security driver for label selinux

6.then destroy target guest:

# virsh destroy rhel73-2
Domain rhel73-2 destroyed

7.start guest on source host again:
#virsh start rhel7.3
error: Failed to start domain rhel7.3
error: unsupported configuration: Unable to find security driver for model selinux

8.Check the xml of rhel7.3 on source host, seclabel was added:
#virsh dumpxml rhel7.3
...
<seclabel type='dynamic' model='selinux' relabel='yes'/>
...

Actual results:
After step 5, libvirt changes the guest xml on target host.

Expected results:
libvirt should not change the guest xml on target host if migration failed.

Comment 2 Jiri Denemark 2016-09-01 14:26:14 UTC
I was able to reproduce this bug with current libvirt, but 7.2 works just fine :(

Comment 4 Jiri Denemark 2016-09-08 15:08:13 UTC
Patches sent upstream for review: https://www.redhat.com/archives/libvir-list/2016-September/msg00279.html

Comment 5 Jiri Denemark 2016-09-08 21:25:09 UTC
This is now fixed upstream by

commit 66278d4bc38aecff6661c91ce9cd3fff26e54a91
Refs: v2.2.0-49-g66278d4
Author:     Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 8 15:22:28 2016 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Sep 8 22:25:22 2016 +0200

    qemu: Remove stale transient def when migration fails

    If a migration of a domain which is already defined on the destination
    host failed early (before we tried to start QEMU), we would forget to
    remove the incoming transient definition. Later on when someone starts
    the domain on the destination host, we will use the stale incoming
    definition and the persistent definition will just be ignored.

    https://bugzilla.redhat.com/show_bug.cgi?id=1368774

    Signed-off-by: Jiri Denemark <jdenemar>

commit 97a87333a0ac8b6b33bf4c45a7b1a526caa554cb
Refs: v2.2.0-48-g97a8733
Author:     Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 8 15:16:58 2016 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Sep 8 22:25:22 2016 +0200

    Add helper for removing transient definition

    The code for replacing domain's transient definition with the persistent
    one is repeated in several places and we'll need to add one more. Let's
    make a nice helper for it.

    Signed-off-by: Jiri Denemark <jdenemar>

Comment 8 yafu 2016-09-18 03:47:05 UTC
Reproduced with libvirt-2.0.0-5.el7.x86_64.
Steps are as comment 0.

Verify pass with libvirt-2.0.0-9.el7.x86_64.
1.Set this in source host qemu.conf and restart libvirtd service:
security_driver = "none"

2.Set this in target host qemu.conf and restart libvirtd service:
security_driver = "selinux"

3.Start a guest without seclabel in source, check the live xml of guest :
#virsh dumpxml rhel7.3
no seclabel

4.Migrate to target with option(success):
#virsh migrate rhel7.3 --live qemu+ssh://yafu-test/system --verbose

5.Try to migrate this guest back to source(fail and cause this issue):
# virsh migrate rhel7.3 --live qemu+ssh://test1/system --verbose
error: unsupported configuration: Unable to find security driver for model selinux

6.Then destroy target guest:
# virsh destroy rhel7.3
Domain rhel7.3 destroyed

7.Check the live xml of guest on source host, no seclabel added.
#virsh dumpxml rhel7.3
no seclabel

8.Start guest on source host again:
#virsh start rhel7.3
Domain mig1 started

Comment 10 errata-xmlrpc 2016-11-03 18:53:47 UTC
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://rhn.redhat.com/errata/RHSA-2016-2577.html


Note You need to log in before you can comment on or make changes to this bug.