Bug 591058 - [LXC] the minimum limit of setmem need be improved.
[LXC] the minimum limit of setmem need be improved.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On:
Blocks: Rhel6.1LibvirtTier1
  Show dependency treegraph
 
Reported: 2010-05-11 06:56 EDT by dyuan
Modified: 2011-12-06 05:43 EST (History)
9 users (show)

See Also:
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 05:43:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description dyuan 2010-05-11 06:56:56 EDT
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:
Comment 2 RHEL Product and Program Management 2010-05-11 09:11:59 EDT
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.
Comment 4 Phil Meyer 2010-09-07 19:22:22 EDT
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
Comment 5 Daniel Veillard 2010-10-11 11:26:19 EDT
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
Comment 7 Jiri Denemark 2011-04-21 09:44:33 EDT
Fixed upstream by v0.9.0-139-g068add8:

commit 068add8ea95750f9551a4de5e8d8c698612a14ab
Author: Jiri Denemark <jdenemar@redhat.com>
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.
Comment 9 zhanghaiyan 2011-05-25 22:43:48 EDT
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
Comment 11 min zhan 2011-07-18 03:18:44 EDT
Move to Verified according to Comment #9
Comment 12 errata-xmlrpc 2011-12-06 05:43:46 EST
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

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