Lomadee, uma nova espécie na web. A maior plataforma de afiliados da América Latina.

sexta-feira, julho 15, 2011

Running Debian 6.0 Squeeze on Citrix XenServer 5.6|5.6 FP1|5.6 SP2

Some time ago I posted an article about running Ubuntu 10.04 as a guest for Citrix XenServer 5.5.0 (that's is valid for Ubuntu 10.10, 11.04 as of Citrix XenServer 5.6 and SP2). Here I come again to show how to make Debian 6.0 Squeeze runs virtualized using the same technique.

Squeeze upgrade to Grub2 that is not fully supported in XenServer 5.6, 5.6 FP1, 5.6 SP 2 because a lazzy programer just forgot to add a simple configuration file to list of possible paths of Grub2 files.

To make it work, make sure you install a linux-image-2.6-686-bigmem or linux-image-2.6-amd64 kernels packages (if not using the old 2.6.29 version provided by Citrix), because they are the only ones that supports Xen DomU operations out-of-the-box. If you install a simple kernel, XenServer will fail with a cryptic message "Will only load images built \\\". This message try to say that it will only execute a kernel image with DomU support.

For a new install, make sure to install the correct kernel packages (linux-image-2.6-686-bigmem or linux-image-2.6-amd64). For a running install where you want to to a upgrade, make sure to install one of that kernels packages or keep the old 2.6.29 version provided by Citrix. For both cases, install Citrix Xen Tools (Linux/xe-guest-utilities package from xs-tools.iso) for VM instrumentation and status report.

Take note of VM and it's VBD uuid, the kernel and ramdisk images path and filesystem uuid (check for it in /etc/fstab or /boot/grub/grub.cfg). Run these commands bellow, using your environment parameters to replace text in bold, don't add the single quotes.

To get the VM uuid
xe vm-list name-label='name of your VM'

To get the VBD uuid
xe vm-disk-list uuid='uuid of your VM'

Clear HVM boot policy from your VM
xe vm-param-clear uuid='uuid of your VM' param-name=HVM-boot-policy

Set VM boot loader to pygrub
xe vm-param-set uuid='uuid of your VM' PV-bootloader=pygrub

Set VBD to bootable
xe vbd-param-set uuid='uuid of your VM VBD' bootable=true

Set PV bootloader args
xe vm-param-set uuid='uuid of your VM' PV-bootloader-args="--kernel=/boot/vmlinuz-2.6.32-5-amd64 --ramdisk=/boot/initrd.img-2.6.32-5-amd64"
or

xe vm-param-set uuid='uuid of your VM' PV-bootloader-args="--kernel=/boot/vmlinuz-2.6.32-5-686-bigmem --ramdisk=/boot/initrd.img-2.6.32-5-686-bigmem"


xe vm-param-set uuid='uuid of your VM' PV-args="root=UUID='uuid of your VM filesystem' ro quiet console=hvc0 xencons=hvc0"

All set, now you can boot up your Squeeze VM and check if it's reporting as Optimized in general tab.