Hide Forgot
Description of problem: Fail to migrate while the size of migrate-compcache less then 4096 Version-Release number of selected component (if applicable): libvirt-1.1.1-8.el7.x86_64 kernel-3.10.0-33.el7.x86_64 qemu-kvm-rhev-1.5.3-7.el7.x86_64 How reproducible: 100% Steps 1.Set setenforce 1 && virt_use_nfs 1 (on both source and target) 2.Prepare a guest which the image file is on the NFS server,and mount the nfs server on both source and target start the guest on the source machine #virsh start rhelguest1 # virsh list --all Id Name State ---------------------------------------------------- 8 rhel7raw running 3.Sets size of the cache less than 4096 # virsh migrate-compcache rhel7raw --size 4095 Compression cache: 2.000 KiB # virsh migrate-compcache rhel7raw Compression cache: 2.000 KiB 4.Migrate the guest to the target, will fail to migrate the guest to the target # virsh migrate --live rhel7raw qemu+ssh://xx.xx.xx.xx/system --verbose --compressed root.xx.xx's password: error: operation failed: migration job: unexpectedly failed 5.Sets size of the cache more than 4095 # virsh migrate-compcache rhel7raw --size 4096 Compression cache: 4.000 KiB # virsh migrate-compcache rhel7raw Compression cache: 4.000 KiB 6.RE-migrate the guest to the target, will successfully migrate the guest to the target # virsh migrate --live rhel7raw qemu+ssh://xx.xx.xx.xx/system --verbose --compressed root.xx.xx's password: Migration: [100 %] Actual results: Fail to migrate the guest to the target while the migrate-compcache less then 4096 Expected results: If the cache size less then 4096 support the normal migration ,it should be migrated successfully if not, it should report an proper error, such as fail to migrate ,the cache size should larger than 4095.
Libvirt just calls migrate-set-cache-size with the value provided by a user and QEMU is doing any rounding on that value. It looks like it just doesn't do a good job when the requested size is lower than 4KiB.
*** Bug 1006843 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 1006843 ***
Fix included in qemu-kvm-1.5.3-47.el7
Reproduced the issue on qemu-kvm-1.5.3-46.el7.x86_64 and verified pass on qemu-kvm-1.5.3-48.el7.x86_64. On the old version qemu-kvm-1.5.3-46.el7.x86_64: 1. Boot up a guest on source host. (gdb) r -cpu SandyBridge -M pc -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name rhel6.4-64 -uuid 9a0e67ec-f286-d8e7-0548-0c1c9ec93009 -nodefconfig -nodefaults -monitor stdio -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -no-shutdown -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -drive file=/mnt/RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d5:51:8a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=port1,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=port2,bus=virtio-serial0.0,id=port2 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -vnc :10 -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -qmp tcp:0:5555,server,nowait -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 2. Boot the guest on destination host with "-incoming tcp:0:5800" 3. Enable xbzrle and set the cache size less than 4096, eg: 4095 byte. And then migrate guest to destination host. {"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-46.el7)"}, "capabilities": []}} {"execute":"qmp_capabilities"} {"return": {}} {"execute":"migrate-set-capabilities","arguments":{"capabilities":[{"state": true, "capability": "xbzrle"}]}} {"return": {}} {"execute":"migrate-set-cache-size","arguments":{"value":4095}} {"return": {}} {"execute": "migrate","arguments":{"uri": "tcp:10.66.4.108:5800"}} {"return": {}} {"execute":"query-migrate"} {"return": {"status": "failed"}} 4. Repeat step 1-3 but with 4096 bytes cache size, this time migration could be finished. {"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-46.el7)"}, "capabilities": []}} {"execute":"qmp_capabilities"} {"return": {}} {"execute":"migrate-set-capabilities","arguments":{"capabilities":[{"state": true, "capability": "xbzrle"}]}} {"return": {}} {"execute":"migrate-set-cache-size","arguments":{"value":4096}} {"return": {}} {"execute": "migrate","arguments":{"uri": "tcp:10.66.4.108:5800"}} {"return": {}} {"execute":"query-migrate"} {"return": {"expected-downtime": 30, "xbzrle-cache": {"bytes": 0, "cache-size": 4096, "pages": 0, "overflow": 0, "cache-miss": 0}, "status": "active", "setup-time": 2, "total-time": 5288, "ram": {"total": 4312489984, "remaining": 208711680, "mbps": 268.5668, "transferred": 177928098, "duplicate": 960651, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 168951808, "normal": 41248}}} {"timestamp": {"seconds": 1392797305, "microseconds": 828894}, "event": "STOP"} {"execute":"query-migrate"} {"return": {"xbzrle-cache": {"bytes": 0, "cache-size": 4096, "pages": 0, "overflow": 0, "cache-miss": 10}, "status": "completed", "setup-time": 2, "downtime": 72, "total-time": 10381, "ram": {"total": 4312489984, "remaining": 0, "mbps": 268.62512, "transferred": 346380624, "duplicate": 970592, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 336986112, "normal": 82272}}} ================ Verified pass on qemu-kvm-1.5.3-48.el7.x86_64, cache size < 4096 bytes is not allowed to be set. {"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-48.el7)"}, "capabilities": []}} {"execute":"qmp_capabilities"} {"return": {}} {"execute":"migrate-set-capabilities","arguments":{"capabilities":[{"state": true, "capability": "xbzrle"}]}} {"return": {}} {"execute":"migrate-set-cache-size","arguments":{"value":4095}} {"error": {"class": "GenericError", "desc": "Parameter 'cache size' expects is smaller than page size"}} Re-set cache size to larger than 4095 and re-migrate, succeed. So this bug is fixed.
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.