Xen resources
From JJBwiki
[edit] Using the raw config file
- Open the /etc/xen/$NAME file. It will look like this:
# Automatically generated xen config file name = "mgra01" memory = "2048" disk = [ 'tap:aio:/xen/mgra01,xvda,w', ] vif = [ 'mac=00:16:3e:20:79:15, bridge=xenbr1', ] uuid = "42d1bdca-854b-5f18-2509-c49b13b833ad" bootloader="/usr/bin/pygrub" vcpus=1 on_reboot = 'restart' on_crash = 'restart'
- Look for the section you want to edit.
- ie vcpus=1
- Make the modification as desired.
- ie vcpus=2
- Reboot the domain if needed. (CPU's cannot be hot added/removed, memory can be {see ne. This is a Linux limitation.)
- xm $NAME reboot
[edit] Using the xm tool
- type: xm
- this will display the "help" section
- Identify what you would like to do. Say resize the max memory.
- WARNING: According to the redhat docs you cannot grow beyond your original allocation. Oversize your domains at creation.
- Indeed it will set the max memory to what your original allocation was. You can change this using the above config file method (requires a VM reboot)
- If you wish to shrink (or grow back to max/some number less than max) you can do the following:
xm mem-set $NAME $MEM
- This will hot-modify the amount of memory available to the domain.
[edit] Using states
WARNING: This is incredibly intensive. It will cause everything to get very laggy on the running domains on the host. This will also suspend the domain, then save. Its not a hot-save. Also requires some serious disk space. A fresh install running top and apache uses 3G.
- xm save $NAME $FILE
- I would advise using the /xen/ partition since these files get fairly large.
- This will save the domains state info for restoration later.
In order to restore use the following:
- xm restore $NAME $FILE
From the docs:
Saves a running domain to a state file so that it can be restored
later. Once saved, the domain will no longer be running on the
system, thus the memory allocated for the domain will be free for
other domains to use. xm restore restores from this state file.
This is roughly equivalent to doing a hibernate on a running com-
puter, with all the same limitations. Open network connections may
be severed upon restore, as TCP timeouts may have expired.
