Bug 1316774
Summary: | vm failed to start with mlock | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Wayne Sun <gsun> | ||||||
Component: | libvirt | Assignee: | Andrea Bolognani <abologna> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 7.3 | CC: | abologna, dyuan, dzheng, gsun, jdenemar, jsuchane, lhuang, rbalakri | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | ppc64le | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | libvirt-3.1.0-1.el7 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2017-08-01 17:09:12 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
Wayne Sun
2016-03-11 03:46:03 UTC
Could you waste a little bit more disk space and always attach the full XML of the domain? According to the strace log it looks like you tried to set 20 MB memory limit, which is likely not something you wanted to do. Created attachment 1135133 [details]
vm xml with mlock
Attached the vm xml, it's only with mlock config.
Yes, 20M is not expected.
Created attachment 1135134 [details]
vm xml with mlock
sorry, paste wrong one in last comment, pls check the update one.
I think the documentation is pretty clear at http://libvirt.org/formatdomain.html#elementsMemoryBacking ... locked When set and supported by the hypervisor, memory pages belonging to the domain will be locked in host's memory and the host will not be allowed to swap them out. For QEMU/KVM this requires hard_limit memory tuning element to be used and set to the maximum memory configured for the domain plus any memory consumed by the QEMU process itself. I'd say it's a user error, but I'm not sure whether we perhaps relaxed the requirement to set hard_limit for Power... Andrea? (In reply to Jiri Denemark from comment #5) > I think the documentation is pretty clear at > http://libvirt.org/formatdomain.html#elementsMemoryBacking > > ... > locked > When set and supported by the hypervisor, memory pages belonging to the > domain will be locked in host's memory and the host will not be allowed to > swap them out. For QEMU/KVM this requires hard_limit memory tuning element > to be used and set to the maximum memory configured for the domain plus any > memory consumed by the QEMU process itself. > > I'd say it's a user error, but I'm not sure whether we perhaps relaxed the > requirement to set hard_limit for Power... Andrea? Not at all, the requirement is the same as x86 and as documented. The call to setrlimit() the reporter is seeing is because, on ppc64, some memory has to be locked regardless of whether the <memoryBacking><locked> element is present or not. 20 MiB make sense here because only some small caches and lookup tables need to be locked all the time - the bulk of the guest memory doesn't have such requirement. So I agree it's user error; on the other hand, maybe we should take this chance to improve libvirt so that some kind of meaningful error message is reported whenever the user has specified <memoryBacking><locked> but <memtune><hardlimit> is not present in the guest configuration? With much lower severity and priority, of course :) Patch posted upstream: https://www.redhat.com/archives/libvir-list/2017-February/msg00180.html v2 patch posted upstream: https://www.redhat.com/archives/libvir-list/2017-February/msg00214.html (In reply to Andrea Bolognani from comment #9) > v2 patch posted upstream: > > https://www.redhat.com/archives/libvir-list/2017-February/msg00214.html Was it accepted? Nope :) But v3 has just been posted upstream: https://www.redhat.com/archives/libvir-list/2017-February/msg00227.html The fix has been pushed upstream. commit c2e60ad0e5124482942164e5fec088157f5e716a Author: Andrea Bolognani <abologna> Date: Mon Feb 6 17:54:49 2017 +0100 qemu: Forbid <memoryBacking><locked> without <memtune><hard_limit> In order for memory locking to work, the hard limit on memory locking (and usage) has to be set appropriately by the user. The documentation mentions the requirement already: with this patch, it's going to be enforced by runtime checks as well, by forbidding a non-compliant guest from being defined as well as edited and started. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1316774 v3.0.0-123-gc2e60ad Test packages: libvirt-3.1.0-1.el7.ppc64le qemu-kvm-rhev-2.8.0-5.el7.ppc64le kernel-3.10.0-578.el7.ppc64le Steps: 1. Configure the guest XML with below part: ... <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <memtune> <hard_limit unit='KiB'>2000000</hard_limit> </memtune> <memoryBacking> <locked/> </memoryBacking> ... <os> <type arch='ppc64le' machine='pseries-rhel7.4.0'>hvm</type> <boot dev='hd'/> </os> ... 2. Start the guest and guest can start up successfully. 3. Log on the guest and normal operations have no problem. # virsh start dd Domain dd started # virsh console dd Connected to domain dd Escape character is ^] CF000012 CF000015ch Linux ppc64le #1 SMP Wed Oct 1 Red Hat Enterprise Linux Server 7.3 (Maipo) Kernel 3.10.0-514.el7.ppc64le on an ppc64le localhost login: root Password: [root@localhost ~]# ls original-ks.cfg [root@localhost ~]# pwd /root [root@localhost ~]# # virsh destroy dd Domain dd destroyed So make it pass. 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://access.redhat.com/errata/RHEA-2017:1846 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://access.redhat.com/errata/RHEA-2017:1846 |