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 744237 - Corner cases of migration with --dname and dxml
Summary: Corner cases of migration with --dname and dxml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 740533
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-07 15:05 UTC by Eric Blake
Modified: 2012-06-20 06:35 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 740533
Environment:
Last Closed: 2012-06-20 06:35:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Comment 1 Jiri Denemark 2011-10-14 20:30:32 UTC
Fixed upstream by v0.9.6-165-g5d784bd:

commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42
Author: Jiri Denemark <jdenemar>
Date:   Fri Oct 14 21:24:18 2011 +0200

    Clarify semantics of virDomainMigrate2
    
    Explicitly disallow conflicts between domain name from dxml and dname.

Comment 3 weizhang 2012-01-10 11:40:47 UTC
test on
kernel-2.6.32-223.el6.x86_64
libvirt-0.9.9-1.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64

on new.xml only change the domain name to "new"
<domain type='qemu' id='9'>
  <name>new</name>
  <uuid>43ed7ac4-20e3-8c6c-8d9d-b9c672c0eb46</uuid>
...

1. migrate only with --xml changing domain name
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system --xml new.xml 
error: invalid argument: target domain name doesn't match source name nor destination name

2. migrate with --xml and --dname and they setting the different domain name
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system --xml new.xml --dname new2
error: invalid argument: target domain name doesn't match source name nor destination name

3. migrate with --xml and --dname and they setting the same domain name
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system --xml new.xml --dname new
error: internal error Incoming cookie data had unexpected name kvm-rhel6u2-x86_64-new vs new

For the first 2 tests it works as expected, but for the third test, it should not report error

Also I can not find doc on virsh help migrate or virsh man page to explain --dname and --xml conflict for changing domain name

I also find a bug that with setting non exist xml with --xml, virsh migrate will not report error
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system --xml non-exist.xml 
even if it return non zero value

so change the bug status to assigned

Comment 4 weizhang 2012-01-11 09:21:40 UTC
(In reply to comment #3)
> I also find a bug that with setting non exist xml with --xml, virsh migrate
> will not report error
> # virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system
> --xml non-exist.xml 
> even if it return non zero value
> 
I have already filed a new bug for this issue. -- bug 773208

Comment 5 Jiri Denemark 2012-01-13 12:23:54 UTC
Hmm, the issue you see feels like bug 740533 has returned :-/

Comment 6 Jiri Denemark 2012-01-13 12:26:58 UTC
Oh, I wasn't quite right. The bug is caused by a patch for this BZ. Destination libvirtd expects to see the original name in the XML and new name in dname parameter. However, if a user provides an XML with the new name, destination daemon will never see the original name.

Comment 7 Jiri Denemark 2012-01-17 09:47:28 UTC
This issue should be now fixed upstream by v0.9.9-53-g5e31e71:

commit 5e31e713657e2582857c66d121de2fe6c1f3df8c
Author: Jiri Denemark <jdenemar>
Date:   Mon Jan 16 10:24:42 2012 +0100

    Clarify semantics of virDomainMigrate{,ToURI}2
    
    Commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42 was a nice attempt to
    clarify the semantics by requiring domain name from dxml to either match
    original name or dname. However, setting dxml domain name to dname
    doesn't really work since destination host needs to know the original
    domain name to be able to use it in migration cookies. This patch
    requires domain name in dxml to match the original domain name. The
    change should be safe and backward compatible since migration would fail
    just a bit later in the process.

Comment 8 weizhang 2012-02-15 03:43:57 UTC
Verify pass on
libvirt-0.9.10-1.el6.x86_64
qemu-kvm-0.12.1.2-2.225.el6.x86_64
kernel-2.6.32-230.el6.x86_64

1. migrate only with --xml changing domain name
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system
--xml new.xml 

error: invalid argument: target domain name doesn't match source name

2. migrate with --xml and --dname and they setting the different domain name, both of them are different from original name
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system
--xml new.xml --dname new2

error: invalid argument: target domain name doesn't match source name

3. migrate with --xml and --dname and they setting the same domain name which different from original name 
# virsh migrate --live kvm-rhel6u2-x86_64-new  qemu+ssh://10.66.83.197/system
--xml new.xml --dname new

error: invalid argument: target domain name doesn't match source name

4. migrate with --xml with original domain name, and --dname with new domain name, migration succeed with no error, on target, the domain name changed to new name

The conclusion is that only --dname can change the domain name during migration, the domain name in dxml must be the same with original name

Comment 10 errata-xmlrpc 2012-06-20 06:35:01 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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


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