Monday, November 19, 2012

Step by step guide to setting up Xen and XAPI (XenAPI) on Ubuntu 12.04 and managing it with Cirtix XenCenter

XCP ( Xen Cloud Platform ) is the open source version similar to Citrix XenServer that uses the Xen Hypervisor. It is currently distributed as an ISO installer also called as XCP appliance. XCP uses XAPI or XenAPI to manage Xen hosts. XCP is based on CentOS 5.5

Project Kronos is an initiative to port the XAPI  tool stack to Debian and Ubuntu. It is a management stack implemented in OCaml that configures and controls Xen hosts, attached storage, networking and virtual machine life cycle.  It exposes a HTTP API and provides a command line interface (xe) for resource management.

XenCenter is windows desktop application by Citrix that is distributed with XenServer for managing servers running XenServer. It uses XAPI for talking to Xen resource pools. Since we are setting up XAPI, we can use XenCenter to manage the server

Why use XCP-XAPI on Debian/Ubuntu when XCP appliance exists ?

  • Manage dom0 using a configuration management framework (Puppet, Chef)
  • Apply security updates to dom0 root file system
  • Run Xen version 4.1. XCP appliance runs version <to be filed>
  • Ubuntu 12.04 is a LTS release that is supported for 5 years

  • A fresh installation of Ubuntu 12.04 on the server
  • Small root file system partition – I usually have a 10GB partition for  root fs (/) and the rest of the space is setup as a physical volume for setting up LVM later. This LVM partition will be used for vm storage and snapshots later. You can choose any partition layout that you are comfortable with, just remember to keep the root partition small and have a large space dedicated for a LVM volume
  • root access to the host
Installing and configuring Xen Hypervisor

Install the Xen Hypervisor
  1. $sudo apt-get install xen-hypervisor
  2. Setup GRUB to boot the Xen Hypervisor
  • $sudo sed -i ‘s/GRUB_DEFAULT=.*\+/GRUB_DEFAULT=”Xen 4.1-amd64″/’ /etc/default/grub
  1. Disable apparmor at boot
  •  $sudo sed -i ‘s/GRUB_CMDLINE_LINUX=.*\+/GRUB_CMDLINE_LINUX=”apparmor=0″/’ /etc/default/grub
  1. Restrict dom0 to 2GB of memory and 2 vcps
  • $sudo vi /etc/default/grub
after GRUB_CMDLINE_LINUX=”apparmor=0″  add the line GRUB_CMDLINE_XEN=”dom0_mem=2G,max:2G dom0_max_vcpus=2″
  1. Update Grub with the config changes we just made
  • $sudo  update-grub
  1. Reboot the server so that Xen boots on the server
  • $sudo reboot
  1. Once the server is back online ensure that Xen is running
  • cat /proc/xen/capabilities should display “control_d”
Installing and configuring XAPI (XenAPI)

  1. Install XCP-XAPI
QR: Inline image 1

Posted via email from Jasper-Net