XenServer 6.1 Ubuntu Paravirtualized Will Not Boot After Kernel Upgrade

If you are running Ubuntu on XenServer, you are probably aware that you are running this thing with the paravirtualized modified kernel.

Yesterday I ran into this issue where the kernel update caused the server not to boot any more.
Upon logging into the XenServer, i got this error:

Error: Starting VM – Using to parse /boot/grub/grub.cfg – WARNING:root:Unknown directive load_video – WARNING:root:Unknown directive terminal_output – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive export – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown directive submenu – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive recordfail – Traceback (most recent call last): – File “/usr/lib/xcp/lib/pygrub.xcp”, line 853, in – raise RuntimeError, “Unable to find partition containing kernel” – RuntimeError: Unable to find partition containing kernel

 

I pulled this out of that wall of text as important: Unable to find partition containing kernel

Basically what is happening is the GRUB bootloader hates you for updating that kernel.

 

This is what you do:

SSH into the XenServer Host and type this:

EDITOR=vi xe-edit-bootloader -n <vmname> -p 1

youll want to browse down to the “submenu” section and remove it.

Mine was:

submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 3.2.0-36-virtual' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b49f44b9-b5b9-4cf7-84df-c1a4e5eb416a
linux /boot/vmlinuz-3.2.0-36-virtual root=UUID=b49f44b9-b5b9-4cf7-84df-c1a4e5eb416a ro console=hvc0 splash quiet $vt_handoff
initrd /boot/initrd.img-3.2.0-36-virtual
}

 

Upon removing that entry, XenServer was able to boot the VM up again.