Description of problem: Now that we have proper memory ballooning working, I have been testing it out by setting "maxmem" in my config files. For instance: maxmem = "1024" memory = "256" This works fine on boot; the domU balloons down dom0 appropriately and starts with 256MB of memory. However, when doing a save/restore, we run into a problem. In the restore path, the tools attempt to balloon down dom0 to "maxmem", not "memory". The problem here is that on a 1024MB HV, for instance, I can successfully start 3 domU's with 256MB (leaving 256MB for dom0); but then I cannot successfully save and then restore one or more of them, since there is not enough memory to make it back up to maxmem.
Upstream changeset to fix this issue: http://xenbits2.xensource.com/xen-unstable.hg?rev/895d873a00b4 I'll try to merge this into our RHEL5 tree.
Created attachment 145997 [details] patch for RHEL5 to make restoring a ballooned domain work I have tested this patch on my system and it seems to allow restoring a saved domain that has been ballooned down. I am ready to commit this whenever we feel it is appropriate to get this fix in.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
This fix was picked up in the rebase to 3.1.0 libxc. The xen-3.0.3-27.el5 build in dist-5E-qu-candidate has the fix. To test create a domain with $ grep mem /etc/xen/demo memory=300 maxmem=500 Start it with $ virsh start demo $ virsh dominfo demo | grep mem Max memory: 512000 kB Used memory: 307064 kB Save it $virsh save demo /var/lib/xen/demo.save Restore it $ virsh restore /var/lib/xen/demo.save And check memory usage $ virsh dominfo demo | grep mem Max memory: 512000 kB Used memory: 307064 kB
It's a little more complicated than that. Here is the test case where I originally saw it: 1. Machine with 1G of memory. 2. Start up domU-1 with mem=256M, maxmem=768M 3. Start up domU-2 with mem=512M 4. Now, "xm save domU-1"; everything is cool 5. Now, "xm restore domU-1"; the domain fails to start because the scripts are trying to balloon back up to 768M first Note that if you shut down domU-2, then try to do the restore of domU-1, things are cool; domU-1 starts, and then automatically balloons itself back to 256M. So it's just a problem with the tools allocating too much memory initially. Note that this very well may be fixed by the -27 package; we just need to confirm properly. Chris Lalancette
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 the 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/RHEA-2007-0635.html