Monday, September 17, 2012

Increasing a KVM guest's Memory

Recently the need came up to increase the amount of RAM I had allocated for my puppetmaster.

The option setmem looked promising so I tried the following command, but long story short, that did not work. Got some weird error message about 'setmem' not supported.

error: Unable to change MaxMemorySize
error: this function is not supported by the connection driver: virDomainSetMaxMemory

I edited the XML in, and restarted the VM. But that too didnt work.

I tried the following, and this worked.

virsh shutdown puppetmaster
virsh dumpxml puppetmaster > /tmp/puppetmaster.xml
 
 
## BEFORE ##
..
 <memory>524288</memory>
  <currentMemory>524288</currentMemory>
..
 
## AFTER  ##
..
 <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
..
 
I then ran 
virsh define /tmp/puppetmaster.xml
 
Start the VM, and the proceeded to run.
 
virsh dominfo puppetmaster 
Id:             45
Name:           puppetmaster
UUID:           ce5c7089-059b-7091-6da9-59a2e24811ad
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       55.8s
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      enable

 
HTH

Brent

No comments:

Post a Comment