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 591058 - [LXC] the minimum limit of setmem need be improved.
Summary: [LXC] the minimum limit of setmem need be improved.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel6.1LibvirtTier1
TreeView+ depends on / blocked
 
Reported: 2010-05-11 10:56 UTC by dyuan
Modified: 2011-12-06 10:43 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.9.1-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:43:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description dyuan 2010-05-11 10:56:56 UTC
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 Program Management 2010-05-11 13:11:59 UTC
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 23:22:22 UTC
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 15:26:19 UTC
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 13:44:33 UTC
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.

Comment 9 zhanghaiyan 2011-05-26 02:43:48 UTC
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 07:18:44 UTC
Move to Verified according to Comment #9

Comment 12 errata-xmlrpc 2011-12-06 10:43:46 UTC
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.