Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1294617

Summary: Migration fails with -dname option when guest agent is specified
Product: Red Hat Enterprise Linux 7 Reporter: Dan Zheng <dzheng>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: dyuan, dzheng, fjin, jdenemar, mzhan, rbalakri, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.3.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 18:50:13 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:

Description Dan Zheng 2015-12-29 10:06:16 UTC
Description of problem:
Migration fails with -dname option when guest agent is specified in guest XML.
The migrated guest XML on target machine is not updated to use new guest name specified by -dname.

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7_2.2.x86_64
qemu-kvm-rhev-2.3.0-31.el7.x86_64
kernel-3.10.0-320.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a guest.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 30    avocado-vt-vm1                 running

2. Check the dumpxml of the guest.
   <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

3. Check the file.
# ll /var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/
total 0
srwxrwxr-x. 1 qemu qemu 0 Dec 29 16:59 org.qemu.guest_agent.0

4. Do migration
# virsh migrate --live --domain avocado-vt-vm1 --desturi qemu+ssh://10.66.4.167/system --dname not_exist_domain
root.4.167's password:
error: internal error: process exited while connecting to monitor: 2015-12-29T08:59:07.318646Z qemu-kvm: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/org.qemu.guest_agent.0,server,nowait: Failed to bind socket to /var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/org.qemu.guest_agent.0: No such file or directory

5. Check on the target machine (10.66.4.167/), and no guest exists.

Actual result:
See step 4.
The migration fails.


Expected result:
The migration should succeed and the guest named 'not_exist_domain' should be running on target machine.

Additional information:
Debug information on target machine.
# cat /var/log/libvirt/qemu/not_exist_domain.log
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -name not_exist_domain -S -machine pc-i440fx-rhel7.2.0,accel=kvm,usb=off -cpu SandyBridge -m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 5d7c2231-5f46-4b94-bbd8-e46f245e1402 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-not_exist_domain/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -drive file=/usr/share/avocado/data/avocado-vt/images/jeos-19-64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:52:53:54,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -incoming tcp:[::]:49152 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on

*** This is wrong parameter in the command line.
-chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-avocado-vt-vm1/org.qemu.guest_agent.0

Comment 2 Fangge Jin 2015-12-30 02:02:30 UTC
I tried with the following xml, migration can succeed:
...
    <channel type='unix'>
      <source mode='bind' path='**/var/lib/libvirt/qemu/kernel.agent**'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
...

# virsh start kernel

# virsh migrate kernel qemu+ssh://10.66.4.113/system --live --dname new

On the target host:
# virsh list
 Id    Name                           State
----------------------------------------------------
 12    new                            running

The qemu command line is:
-chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/kernel.agent,server,nowait

Comment 3 Pavel Hrdina 2016-02-29 11:21:46 UTC
This bug is fixed by BZ 1278068, but don't mark it as duplicate in order to explicitly test the migration to make sure it's working.

Comment 5 zhe peng 2016-04-13 05:48:08 UTC
Verify with build:
libvirt-1.3.3-1.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64

Step:
1. start guest, check xml:
<channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-18-test/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
2. Do migration:
# virsh migrate --live test qemu+ssh://$target_ip/system --dname test_name

3. migration can worked well.
4. check file on target machine
# ll /var/lib/libvirt/qemu/channel/target/domain-4-test_name/org.qemu.guest_agent.0 
srwxrwxr-x. 1 qemu qemu 0 Apr 13 13:34 /var/lib/libvirt/qemu/channel/target/domain-4-test_name/org.qemu.guest_agent.0

worked as expect.Move to verified.

Comment 7 errata-xmlrpc 2016-11-03 18:50:13 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