Bug 1076354

Summary: The new name of guest will change to old when destroy the guest after migration with dname and persistent flag
Product: Red Hat Enterprise Linux 7 Reporter: hongming <honzhang>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: dyuan, mzhan, rbalakri, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.16-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 05:45:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
libvirtd log on source host
none
libvirtd log on destination host none

Description hongming 2014-03-14 07:47:46 UTC
Description of problem:
The new name of guest will change to old  when destroy the guest after migration with dname and persistent flag


Version-Release number of selected component (if applicable):
libvirt-0.10.2-29.el6_5.5.x86_64 

How reproducible:
100%

Steps to Reproduce:
On source host

[root@intel-5130-16-1 libvirt-test-API]# virsh start rhel6u2
Domain rhel6u2 started

[root@intel-5130-16-1 libvirt-test-API]# virsh migrate --live --persistent rhel6u2 qemu+tcp://10.66.106.34/system tcp://10.66.106.34:9001 rhel6u2-new

[root@intel-5130-16-1 libvirt-test-API]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6u2                        shut off


On destination host
[root@ibm-x3850x5-08 0.10.2-29.el6_5.5]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 8     rhel6u2-new                    running

[root@ibm-x3850x5-08 0.10.2-29.el6_5.5]# virsh destroy rhel6u2-new
Domain rhel6u2-new destroyed

[root@ibm-x3850x5-08 0.10.2-29.el6_5.5]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6u2                        shut off



Actual results:
The new name of guest will change to old  when destroy the guest after migration with dname and persistent flag 

Expected results:
Successfully rename the persistent gust on destination host 

Additional info:

Comment 1 hongming 2014-03-14 08:01:21 UTC
Created attachment 874260 [details]
libvirtd log on source host

Comment 2 hongming 2014-03-14 08:02:19 UTC
Created attachment 874261 [details]
libvirtd log on destination host

Comment 5 Jiri Denemark 2014-04-04 21:38:11 UTC
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product.

Comment 8 Jiri Denemark 2015-05-04 21:03:18 UTC
Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-May/msg00049.html

Comment 9 Jiri Denemark 2015-05-05 07:24:37 UTC
Fixed upstream by v1.2.15-25-gfc3601a:

commit fc3601a308922332be6213032dfe43fd963e3f46
Author: Jiri Denemark <jdenemar>
Date:   Mon May 4 22:21:23 2015 +0200

    qemu: Properly rename persistent def after migration
    
    When migrating a domain while changing its name and using
    VIR_MIGRATE_PERSIST_DEST flag, libvirt would fail to properly change the
    name in the persistent definition. The inconsistency results in weird
    behavior when dumping domain XML, destroying the domain, restarting
    libvirtd and likely in several other situations.
    
    Since the new name is already stored in vm->def->name, we just need to
    make sure the persistent definition uses this new name too.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1076354
    
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 11 zhe peng 2015-07-22 07:11:12 UTC
verify with build:
libvirt-1.2.17-2.el7.x86_64

step:
1:prepare migration env.
2:do migration on source:
# virsh migrate --live --persistent rhel6 qemu+ssh://10.66.106.34/system tcp://10.66.106.34:9001 --dname rhel6-new --verbose

3:during migration, check target:
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 11    rhel6-new                      paused

4: after migration
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 11    rhel6-new                      running
# virsh destroy rhel6-new
Domain rhel6-new destroyed
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6-new                      shut off


move to verified.

Comment 13 errata-xmlrpc 2015-11-19 05:45:24 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/RHBA-2015-2202.html