wiki:Doc/OS/Xen

Version 5 (modified by /C=IE/O=Grid-Ireland/OU=cs.tcd.ie/L=RA-TCD/CN=Stephen O. Childs, 16 years ago) (diff)

--

Introduction

It is possible to integrate the configuration and installation of Xen guest virtual machines (VM) quite closely with an existing QWG setup. Using pypxeboot and suitable Xen packages (such as those available from CERN Linux support here, it is possible to perform a fully-automated install of Xen guest VMs, with all relevant configuration automatically extracted from the guest's own templates.

The aim of our procedure is to integrate VM configuration as closely as possible with the configuration of "normal" machines. This means:

  • Guest VMs are normally installed using the automated PXE/Kickstart installation configured by Quattor's AII software.
  • Guest VMs are installed on virtual "hardware" described in its own hardware template. For example, MAC addresses, disk sizes and names, CPU architecture, etc. can all be specified in the VMs hardware template, and will then be used to generate appropriate configuration files for guest VMs.

The following combinations of Xen hosts and guests should work:

Host OS Host Xen Guest OS Comments
slc450-i386 3.0.3 sl308-i386, slc450-i386 Scientific Linux Cern used here rather than plain SL as profiles already available in QWG.
sl450-x86_64 3.0.3 sl450-x86_64 Xen guest disk is now xvda not sda (see here)

Install server configuration

You will need to install Xen kernels for use during the initial PXE boot of the Xen guest VM. The following table shows where these should be installed and provides links to the relevant files.

/osinstall/nbp/slc308_i386_xen http://linuxsoft.cern.ch/cern/slc308/i386/images/xen/
/osinstall/nbp/sl450-x86_64_xen http://ftp.scientificlinux.org/linux/scientific/45/x86_64/images/xen/

I have encountered some problems with the "new" partitioning scheme used by AII where fdisk is invoked repeatedly to configure the partitions. You may want to use the traditional partitioning scheme where Anaconda does the work itself. This KS template attachment:sl_ks_old_partitioning.conf works for me.

Host configuration

There are two components to the configuration of a Xen host: the configuration of the host's own software and the creation of Xen configuration files for the guests. The template config/xen/host includes the template config/xen/configure_guests which will configure a set of guests in a pre-defined way according to the contents of their hardware templates. This means:

  • The disk size defined in
  • Make sure the OS defined for your VM is correct. Check the Quattor template os_version_db.tpl and edit it if necessary to ensure that your host has the correct OS selected.
  • Define the variable XEN_GUESTS to be a list of the guests you want to install on the host, using the names of their templates. (N.B. there is currently a restriction that the host and guest templates must be in the same cluster.) For example:
    variable XEN_GUESTS = list("testui.example.org","testwn.example.org");
    
  • Include the template config/xen/host: this will set up some basic configuration and also pull in the correct RPMs.
  • The configuration of the host is controlled by a set of variables with default values. These can be customised if required.
Variable Default value Comments
XEN_BOOT_DEVICE "/dev/sda2" Root FS of host (for grub configuration)
XEN_VG "vg01" Base volume group to create guest VM FS on
XEN_GUESTS None A list of FQDNs for guest VMs (e.g. list("gridgate.cs.tcd.ie", "gridui.cs.tcd.ie"))
XEN_BOOTLOADER_DEFAULT "/usr/bin/pypxeboot" Default bootloader for VMs. Change this to e.g. pygrub if no DHCP server is available
XEN_BOOTLOADER nlist mapping VM names to bootloader to override default, e.g. nlist("gridgt4.cs.tcd.ie","/usr/bin/pypxeboot")
XEN_BOOTARG_DEFAULT "" "vif[0]" argument needed by pypxeboot will be added automatically if using it, set to "" for pygrub
XEN_BOOTARGS nlist specifying special bootargs for individual VMs
XEN_CREATE_FILESYSTEMS true Whether ncm-xen should try and create filesystems defined for VMs
XEN_CREATE_DOMAINS true Whether ncm-xen should try and create (i.e. start up) domains when it runs
XEN_PROFILE_PREFIX "" Only needed if using old "profile_" naming scheme for nodes

Guest configuration

  • As with the host, make sure the OS for the guest is correctly configured in os_version_db. Check the table above to ensure that the guest you're installing is compatible with the host OS.
  • Create a hardware template for the machine based on cfg/grid-ireland/hardware/machines/xen. Note that the disk and RAM sizes defined in this template will be used to generate the Xen configuration for the VM. Also, from SL 4.5 the base disk should be xvda not sda (see xen_mini_gt4_sl45 for an example.
  • Set up the mapping between the node name and hardware template in the site databases template (site/databases.tpl or pro_site_databases.tpl.
  • Include the template config/xen/guest in the node's template.

Attachments (1)

Download all attachments as: .zip