Bug 528431

Summary: [mem-set]it should not allow to set the current memory larger than max memory
Product: Red Hat Enterprise Linux 5 Reporter: Rita Wu <rwu>
Component: xenAssignee: Miroslav Rezanina <mrezanin>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: clalance, cwei, llim, mrezanin, mshao, xen-maint, yuzhang
Target Milestone: rc   
Target Release: 5.6   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xen-3.0.3-109.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 608072 609619 (view as bug list) Environment:
Last Closed: 2011-01-13 22:19:00 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: 514500, 608065, 609561, 609619    

Description Rita Wu 2009-10-12 07:05:38 UTC
Description of problem:

It allows to set the current memory larger than max value 

Version-Release number of selected component (if applicable):
2.6.18-164.el5xen

How reproducible:
always

Steps to Reproduce:
Prerequisite: the default value of max memory and current memory is 512
1.Set current memory larger than max memory
  # xm mem-set $domain-id 1024
2.Reboot the domain
  #xm reboot $domain-id
3.Check whether current memory is updated by "xm list"
  #xm list $domain-id
4.Check whether current memory is updated by "xm list -l"
  #xm list $domain-id -l

  
Actual results:
After step4, the values of memory and maxmem are both updated to 1024.

Expected results:
It should not allow to set the current memory larger than max-memory

Additional info:

Comment 1 Yufang Zhang 2009-10-14 05:50:19 UTC
Another problem with this bug:

1. set memmax(via mem-max) to a new size(in this case 2048M) larger than the current memmax(in this case 512M)
2. set current memory size to be 1500M
3. reboot guest
4. After reboot, 
   # xm li $dom_id -l
we can see that both memory and mammem change to 1500M. mem-max doesn`t take effect after reboot in this case.

Additional infortmation:
According to BZ #528421, mem-max should take effect after reboot.

Comment 4 Miroslav Rezanina 2010-03-22 13:27:55 UTC
*** Bug 575671 has been marked as a duplicate of this bug. ***

Comment 6 Miroslav Rezanina 2010-04-16 16:15:37 UTC
*** Bug 554940 has been marked as a duplicate of this bug. ***

Comment 10 Yufang Zhang 2010-08-24 08:59:23 UTC
QA verify this bug on xen-3.0.3-115.el5:

1. # xm cr /tmp/xm-test.conf memory=512 maxmem=1024
Using config file "/tmp/xm-test.conf".
Using <class 'grub.GrubConf.GrubConfigFile'> to parse /grub/menu.lst
Started domain vm1

2. # xm mem-set vm1 1500
Error: Memory size too large. Limit is 1024 MiB
Usage: xm mem-set <Domain> <Mem>

Set the current memory usage for a domain.

3. # xm li vm1 
Name                                      ID Mem(MiB) VCPUs State   Time(s)
vm1                                       14      511     4 -b----      9.6

4. # xm li vm1 -l | grep mem
    (memory 512)
    (shadow_memory 0)
    (maxmem 1024)

5. # xm reboot vm1

6. # xm li vm1
Name                                      ID Mem(MiB) VCPUs State   Time(s)
vm1                                       15      512     4 -b----      0.4

7.  # xm li vm1 -l | grep mem
    (memory 512)
    (shadow_memory 0)
    (maxmem 1024)

Change this bug to VERIFIED.

Comment 12 errata-xmlrpc 2011-01-13 22:19:00 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0031.html