Xen
- Grant McWilliams Xen howtos - good scripts to bootstrap Linux domUs
- Xen Configuration Options - for xen.cfg
Xen Guest Config File
Options for config entries for a guest:
- name - domain name
- builder - the type of domain.
generic
uses the default, which is a PV domain, withhvm
being the second option. - vcpus - number of virtual CPUs to start the guest with
- memory - start with # MBs of RAM
- on_poweroff - specifics on what to do when a domain shuts itself down:
- destroy - default
- restart
- rename-restart - rename the domain that was created, and create a new one with the same config
- preserve - keep the domain name that was created
- on_reboot, on_crash - same options as before
- uuid - specify a UUID for the domain; by default Xen creates one
Paravirtualised (PV) Guest Specific Options
Paravirtulized is the default type of guest emulation.
- kernel - location of the kernel image on domain filesystem; this or
bootloader
must be used - ramdisk - location of the ramdisk on domain filesystem
- bootloader - program to run to find the kernel image and ramdisk to use; normally would be
pygrub
, which is an emulation of either grub, grub2, and syslinux. - bootloader_args
- root - value of
root=
to pass to kernel (fex:root /dev/xvda3
in Xen config becomesroot=/dev/xvda3
in kernel command line) - extra - string to append to the kernel command line (fex:
acpi=off
)
Disks
Format: disk = [ “DISK_SPEC_STRING”, “DISK_SPEC_STRING”, … ]
Give the guest read-write access to a device, and set it as /dev/xvda
:
disk= [ 'phy:/dev/sdc,xvda,rw' ]
Booting from CD
Same configuration as above, but with an ISO attached, as device /dev/hdc
. Note that pygrub
will boot from the first device in the list.
disk= [ 'file:/var/isos/gentoo.iso,hdc:cdrom,r', 'phy:/dev/sdc,xvda,rw' ]
If you'd like to boot from the ISO, add this to your Xen guest config:
boot = 'c'