Bug 591058
| Summary: | [LXC] the minimum limit of setmem need be improved. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | dyuan |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.0 | CC: | ajia, dallan, hbrock, llim, mzhan, phil, veillard, xen-maint, yoyzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.9.1-1.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-12-06 10:43:46 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 621776 | ||
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux major release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Major release. This request is not yet committed for inclusion. Testing RHEL 6 beta 2 refresh and qemu-kvm:
# virsh setmem 008065-aberrate.com 1024000
on the VM:
# free -m
total used free shared buffers cached
Mem: 813 240 572 0 2 31
-/+ buffers/cache: 206 606
Swap: 1023 0 1023
---
# virsh setmem 008065-aberrate.com 716800
on the VM:
# free -m
total used free shared buffers cached
Mem: 513 240 272 0 2 31
-/+ buffers/cache: 206 306
Swap: 1023 0 1023
---
# virsh setmem 008065-aberrate.com 8192000
on the VM:
# free -m
total used free shared buffers cached
Mem: 7813 240 7572 0 2 31
-/+ buffers/cache: 207 7606
Swap: 1023 0 1023
---
Where did my 200MB go?
xml snippit
---
<memory>8192000</memory>
<currentMemory>524288</currentMemory>
---
If memory != currentMemory the VM loses 200MB RAM, even on startup.
kernel-2.6.32-44.1.el6.x86_64
libvirt-client-0.8.1-13.el6.x86_64
qemu-kvm-0.12.1.2-2.90.el6.x86_64
libvirt-0.8.1-13.el6.x86_64
int
virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
{
does
if (memory < 4096) {
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
the hardcoded limit in the main function need to go, maybe we need to
implement some limits in the drivers, but it doesn't really make sense to
put this here, agreed,
Daniel
Fixed upstream by v0.9.0-139-g068add8:
commit 068add8ea95750f9551a4de5e8d8c698612a14ab
Author: Jiri Denemark <jdenemar>
Date: Thu Apr 21 12:06:41 2011 +0200
Remove artificial minimum limit for guest memory
Remove the artificial minimum of 4096 KB for guest memory. It's drivers'
job to set the limit if needed.
Verified this bug pass with libvirt-0.9.1-1.el6.x86_64 1. virsh # define vm2.xml Domain fedora-rawhide-2 defined from vm2.xml virsh # start fedora-rawhide-2 Domain fedora-rawhide-2 started 2. virsh # dominfo fedora-rawhide-2 Id: 29262 Name: fedora-rawhide-2 UUID: 58ef0c94-bdb0-03c1-ec86-dc25794e69d6 OS Type: exe State: running CPU(s): 1 CPU time: 0.1s Max memory: 32768 kB Used memory: 2168 kB Persistent: yes Autostart: disable 3. virsh # setmem fedora-rawhide-2 433 4. virsh # dominfo fedora-rawhide-2 Id: 29262 Name: fedora-rawhide-2 UUID: 58ef0c94-bdb0-03c1-ec86-dc25794e69d6 OS Type: exe State: running CPU(s): 1 CPU time: 0.1s Max memory: 32768 kB Used memory: 328 kB Persistent: yes Autostart: disable Move to Verified according to Comment #9 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. http://rhn.redhat.com/errata/RHBA-2011-1513.html |
Description of problem: The argument of setmem can't be lower than 4096. But the used memory of 'dominfo guest' in lxc is always lower than 4096, so I cannot check whether the 'setmem' affect the used memory. # virsh -c lxc:/// Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # list --all Id Name State ---------------------------------- 23466 fedora-rawhide running 28556 toy running virsh # dominfo toy Id: 28556 Name: toy UUID: 386f5b25-43ee-9d62-4ce2-58c3809e47c1 OS Type: exe State: running CPU(s): 1 CPU time: 0.0s Max memory: 500000 kB Used memory: 440 kB Autostart: disable virsh # setmem toy 430 error: invalid argument in virDomainSetMemory virsh # setmem toy 4096 virsh # dominfo toy Id: 28556 Name: toy UUID: 386f5b25-43ee-9d62-4ce2-58c3809e47c1 OS Type: exe State: running CPU(s): 1 CPU time: 0.0s Max memory: 500000 kB Used memory: 440 kB Autostart: disable It should be permitted setting the memory more lower than 4096. Version-Release number of selected component (if applicable): kernel-2.6.32-24.el6.x86_64 libvirt-0.8.1-2.el6.x86_64 How reproducible: always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: