Thursday, August 16, 2012

Tip: Assign Xen dom0 memory on Debian Wheezy

Though Xen can manage memory with the ballon driver it is considered good practice to limit/restrict the amount of memory assigned to dom0. Doing so will stop the  Linux kernel from wasting memory.

To do so you'll need to pass the appropriate boot parameter for both the Xen hypervisor and Linux.

As an example, let's assume you want to assign 2GB to your dom0 here's how:
  1. $ su
  2. # echo 'GRUB_CMDLINE_XEN="dom0_mem=2G,max:2G"' >> /etc/default/grub
  3. # update-grub2

The above steps were executed on Debian Wheezy running Xen 4.1.3 but should translate as well to any other distribution running Xen 4.1.2 or latter and GRUB2. Users of GRUB will need to edit grub.conf and pass down the boot parameters in an analogous manner.