Contents |
Every instance booted with pv-grub requires a working grub configuration file in /boot/grub/menu.lst:
default=0
timeout=5
title=DISTRO-NAME "KERNEL VERSION STRING"
root (hd0)
kernel /boot/KERNEL-VMLINUZ-FILENAME ro console=hvc0 root=/dev/xvda1
initrd /boot/KERNEL-INITRD-FILENAME
pacman -Sy pacman pacman -Sy base-devel pacman -Syu sed -i 's/sda/xvda/' /etc/fstab pacman -Sy kernel26 mkdir -p /boot/grub cp /usr/src/KERNEL-VERSION/vmlinux /boot/vmlinux26
Note: The stock arch kernel is bzipped and won't work with pv-grub. Use the uncompressed vmlinux instead.
Now add (or uncomment) the following line in /etc/inittab for console:
h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux
yum -y upgrade mkdir -p /boot/grub echo "alias eth0 xennet" > /etc/modprobe.conf echo "alias eth1 xennet" >> /etc/modprobe.conf echo "alias scsi_hostadapter xenblk" >> /etc/modprobe.conf echo "xvc0" >> /etc/securetty sed -i 's/sda/xvda/' /etc/fstab yum -y install kernel-xen
Now add (or uncomment) the following line in /etc/inittab for console:
8:2345:respawn:/sbin/mingetty xvc0
apt-get update; apt-get -y upgrade mkdir /boot/grub sed -i 's/sda/xvda/' /etc/fstab apt-get -y install linux-image-xen-amd64
Now add (or uncomment) the following line in /etc/inittab for console:
8:2345:respawn:/sbin/getty 38400 hvc0
mkdir -p /boot/grub echo "alias eth0 xennet" > /etc/modules echo "alias eth1 xennet" >> /etc/modules echo "alias scsi_hostadapter xenblk" >> /etc/modules sed -i 's/sda/xvda/' /etc/fstab echo "hvc0" >> /etc/securetty yum -y install kernel
emerge --sync emerge --update portage emerge gentoo-sources genkernel #Update /usr/src/linux symlink if necessary sudo sed -i 's/sda/xvda/' /etc/fstab genkernel --menuconfig all
Enable the following in the kernel configuration:
Processor Type and Features -> Paravirtualized guest support -> "Y" Hit enter, go to "Xen guest support" -> "Y"
Then exit the configuration, save, and build.
Now add (or uncomment) the following line in /etc/inittab for console:
h0:12345:respawn:/sbin/agetty 38400 hvc0 linux
yum -y upgrade mkdir -p /boot/grub echo "alias eth0 xennet" > /etc/modprobe.conf echo "alias eth1 xennet" >> /etc/modprobe.conf echo "alias scsi_hostadapter xenblk" >> /etc/modprobe.conf echo "xvc0" >> /etc/securetty sed -i 's/sda/xvda/' /etc/fstab yum -y install kernel-xen
Now add (or uncomment) the following line in /etc/inittab for console:
8:2345:respawn:/sbin/mingetty xvc0
mkdir /boot/grub cp /etc/init/tty1.conf /etc/init/hvc0.conf sed -i 's/tty1/hvc0/' /etc/init/hvc0.conf sed -i 's/sda/xvda/' /etc/fstab apt-get -y install linux-virtual
mkdir /boot/grub cp /etc/init/tty1.conf /etc/init/hvc0.conf sed -i 's/tty1/hvc0/' /etc/init/hvc0.conf apt-get -y install linux-virtual
Contact Rackspace Cloud support and request the pv-grub feature, informing them that you have completed these steps and would like to use your own kernel. Your Cloud Server will be rebooted, and -- if all goes well -- will come back up with your new kernel. You may verify this with 'uname -a'.

Comments
Is pv-grub or pygrub
Pv-grub
In Archlinux, it's important
Re: xen support
ext3 bariers on Arch 3.x kernel
For latest stock kernel in Arch, I had to set barrier=0 in /etc/fstab e.g.:
/dev/xvda1 / ext3 defaults,barrier=0 0 1
/dev/xvda2 swap swap defaults,barrier=0 0 0
Otherwise, root fs will get mounted read-only very often with error messages like:
[ 8.389389] end_request: I/O error, dev xvda1, sector 1053144
[ 8.389406] end_request: I/O error, dev xvda1, sector 1053144
[ 8.389415] Buffer I/O error on device xvda1, logical block 131643
[ 8.389444] Aborting journal on device xvda1.
[ 8.390160] EXT3-fs (xvda1): error: ext3_journal_start_sb: Detected aborted journal
[ 8.390178] EXT3-fs (xvda1): error: remounting filesystem read-only
Re: Barrier
Curious. Thanks, Santo. We'll look into that and get the article updated appropriately.
This is also needed in gentoo
This is also needed in gentoo 3.1+ kernels.
Hi Jered,
Hi Jered,
I second Santo's comment. I just got linux 3.1 to install on my node today, and only by setting barrier=0 was I able to make any writes to disk. There may be a better way to make the disk writable, however I am unaware of it.
Also, a note: The uncompressed image does _not_ work with linux 3.1, while the vmlinuz-linux bzImage (installed by the Arch package "linux") _does_ work (my node is currently running on vmlinuz-linux; however, it kernel panicked with the uncompressed image).
Thanks!
Matt
Arch Xen link
Additional note: I found the Arch wiki's Xen page to be extremely helpful, in addition to this page.
pv-Grub
I would like to see a complete step-by-step for Ubuntu, with an explanation of each step. The procedure offered in the article is very abbreviated and contrast rather sharply with the one at http://failverse.com/setting-up-pv-grub-cloud-servers/
Why not just have pv-Grub enabled for instances by default? Some type of failover is needed to boot the original virtual image if the customer/new kernel does not boot.
Re: pv-grub setup
Our newer images actually do use pv-grub by default now, so as new versions are released for various distributions you should see them all with pv-grub support right off the bat.
We have to port this article over to Rackspace Cloud still, but you can follow the instructions in this Slicehost article since the procedure is the same:
http://articles.slicehost.com/2010/10/27/using-pv-grub-to-run-custom-ker...
Access to the command console and rescue mode would be done through the RS control panel, of course, but otherwise the instructions should still apply.
Add new comment