Red Hat Bugzilla – Bug 1294617
Migration fails with -dname option when guest agent is specified
Last modified: 2016-11-03 14:50:13 EDT
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@10.66.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
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
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.
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.
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