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 1017096 - Fail to migrate while the size of migrate-compcache less then 4096
Summary: Fail to migrate while the size of migrate-compcache less then 4096
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Hai Huang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-09 09:14 UTC by zhenfeng wang
Modified: 2014-06-18 03:39 UTC (History)
13 users (show)

Fixed In Version: qemu-kvm-1.5.3-47.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:12:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhenfeng wang 2013-10-09 09:14:38 UTC
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.

Comment 2 Jiri Denemark 2013-10-09 10:09:16 UTC
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.

Comment 3 Orit Wasserman 2014-02-11 15:37:00 UTC
*** Bug 1006843 has been marked as a duplicate of this bug. ***

Comment 4 Orit Wasserman 2014-02-12 07:43:41 UTC

*** This bug has been marked as a duplicate of bug 1006843 ***

Comment 5 Miroslav Rezanina 2014-02-12 12:01:13 UTC
Fix included in qemu-kvm-1.5.3-47.el7

Comment 7 Qunfang Zhang 2014-02-19 08:21:31 UTC
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.

Comment 9 Ludek Smid 2014-06-13 10:12:24 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.