Q:

How change what  kernel boots Ubuntu  XEN VPS?

I have a VPS running Ubuntu server 12.04. A while ago, my host installed an alternative kernel (one of Amazon's EC2 kernels) to fix a boot issue I was having. Now, 2 Ubuntu releases later, this kernel (2.6.31-302-ec2) is still being used even though later (3.2.xx) kernels have been installed.
How can I make the server use the most recent installed kernel, preferably without just uninstalling the EC2 kernel just in case doing so causes issues?

A:

Congratulations, you're on PyGrub!

Your menu.lst file, the different kernel images in your /boot directory and most importantly, the kernel you're running (an Amazon EC2 version extremely unlikely to be running on a physical host) strongly imply you do have pygrub enabled.

This is because non-Pygrub XenPVs must use the same kernel as the host

The oddly empty dmesg is likely a side-effect of the customizations in the EC2 kernel; compare with the very informative output of a normal kernel on a XenPV 3.4

A little bit on XenPV kernel options:

Your current custom EC2 kernel boots with the options root=/dev/sda1 xencons=tty (see end of menu.lst)
The standard XenPV boot options on stock kernels, instead are root=/dev/xvda1 console=hvc0

xvda is the paravirtualized (and more efficient)  disk device, while sda is the less efficient emulated device -- this is the first time I've seen the latter used in a 3.x XenPV.
xencons=tty and console=hvc0 are very similar, but I believe the former is an older (legacy) usage; you can stack them with no ill-effects; it simply tells the kernel that the standard virtual terminal is unavailable for the console, and to use the specialized hvc0 device instead.

How to switch kernels:
This part may be slightly hairy, and you should be in your provider's good books because you may need their help with a simple cp operation once or twice! After that, you'll know what options you need and should be set for the future.

To give you some context if you need it, here are some files from my XenPV VPS on the latest 64-bit kernel: ls -l /boot, menu.lst and a full post-boot dmesg
Add the following at the top of your menu.lst, adapting to the kernel version you need:

default=0
title vmlinuz-3.2.0-25-generic
root            (hd0) 
kernel          /boot/vmlinuz-3.2.0-25-generic ro root=/dev/sda1 xencons=tty console=hvc0
initrd      /boot/initrd.img-3.2.0-25-generic

Cross your fingers, reboot, and hope it comes back up!
If not, try changing to root=/dev/xvda1 and that should almost certainly work.
Remember to decline installing "new" menu.lst when upgrading kernels!

