Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 744237 - Corner cases of migration with --dname and dxml
Corner cases of migration with --dname and dxml
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.2
x86_64 Linux
high Severity medium
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On: 740533
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-07 11:05 EDT by Eric Blake
Modified: 2012-06-20 02:35 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 740533
Environment:
Last Closed: 2012-06-20 02:35:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Comment 1 Jiri Denemark 2011-10-14 16:30:32 EDT
Fixed upstream by v0.9.6-165-g5d784bd:

commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42
Author: Jiri Denemark <jdenemar@redhat.com>
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 06:40:47 EST
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 04:21:40 EST
(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 07:23:54 EST
Hmm, the issue you see feels like bug 740533 has returned :-/
Comment 6 Jiri Denemark 2012-01-13 07:26:58 EST
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 04:47:28 EST
This issue should be now fixed upstream by v0.9.9-53-g5e31e71:

commit 5e31e713657e2582857c66d121de2fe6c1f3df8c
Author: Jiri Denemark <jdenemar@redhat.com>
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-14 22:43:57 EST
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 02:35:01 EDT
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.