backport grub-legacy-ec2 from maverick to lucid

Bug #671103 reported by Scott Moser on 2010-11-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Scott Moser

Bug Description

Binary package hint: cloud-init

I'm investigating backporting support for guest managed kernels into 10.04 guest UEC images.

Doing so would allow 10.04 guest images that were running on EC2 and 10.10 UEC hosts to run 'apt-get dist-upgrade && reboot' and boot into their new kernel. Currently, the 10.04 guests cannot manage their own kernel under either UEC or EC2.

The solution in place for 10.10 is to use grub-pc to load the kernel on UEC and legacy-grub-ec2 to load the kernel on EC2.

In order to do this, we will need to pull the legacy-grub-ec2 package (a binary package built from cloud-init's source) to lucid.

I've done that backport and have a ppa build available at .

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: cloud-init 0.5.10-0ubuntu1.3
ProcVersionSignature: User Name 2.6.32-309.18-ec2
Uname: Linux 2.6.32-309-ec2 i686
Architecture: i386
Date: Thu Nov 4 18:39:55 2010
Ec2AMI: ami-480df921
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: us-east-1d
Ec2InstanceType: t1.micro
Ec2Kernel: aki-6603f70f
Ec2Ramdisk: unavailable
PackageArchitecture: all
 PATH=(custom, user)
SourcePackage: cloud-init

===== SRU Information =====
* impact of the bug: This is not so much a bug as a missing feature from 10.04. With current 10.04 based EC2 images, an instance was not able to perform a kernel upgrade with 'apt-get dist-upgrade && reboot'. This is because the linux kernel is loaded by the hypervisor rather than a bootloader whos configuration is controlled by the instance. Near the end of the 10.04 cycle, Amazon announced "pv-grub" support. This allowed instances to manage their own kernel by managing /boot/grub/menu.lst
* how the bug has been addressed: In maverick, the grub-legacy-ec2 package was added under the cloud-init source package. This package manages /boot/grub/menu.lst much the same as grub-0.97 would (it is primariliy a source copy).
* minimal patch: The changes are available in my branch at [1], the diff can be seen from tip of that branch to revision 16 (current lucid-updates) [2].
* instructions on how to reproduce the bug:
  Two bugs that are fixed by suggested changes:
  1. system will not boot given a pv-grub kernel
    * launch a lucid instance with pv-grub kernel
      ec2-run-instances --instance-type t1.micro --kernel aki-407d9529 ami-b2b443db
  2. system will not reboot into new kernel
    * launch a lucid instance
      ec2-run-instances --instance-type t1.micro ami-42887c2b
    * install a newer kernel
      sudo apt-get update && sudo apt-get dist-upgrade && sudo reboot
    * reconnect, and verify old kernel is used.
* regression potential: The possibility for regression is centered around the fact that this change will cause
  * new ubuntu images to load with a ramdisk
  * kernel to boot with console=hvc0 parameter (used currently in maverick)
  There is *no* potential for regression on running systems, only on systems where a user chooses to install grub-legacy-ec2 *and* modifies their instance to use pv-grub.

Scott Moser (smoser) wrote :
Scott Moser (smoser) wrote :

Marking fix-released. maverick has this already.

Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Scott Moser (smoser) on 2010-11-04
Changed in cloud-init (Ubuntu Lucid):
assignee: nobody → Scott Moser (smoser)
importance: Undecided → High
milestone: none → ubuntu-10.04.2
status: New → Confirmed
Scott Moser (smoser) on 2010-11-05
description: updated

Accepted cloud-init into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See for documentation how to enable and use -proposed. Thank you in advance!

Changed in cloud-init (Ubuntu Lucid):
status: Confirmed → Fix Committed
tags: added: verification-needed
Scott Moser (smoser) wrote :

## I ran an instance of ami-8c0c5cc9
## (us-west-1 ebs/ubuntu-lucid-10.04-i386-server-20101020)

% ec2-run-instances --region us-west-1 --instance-type t1.micro ami-8c0c5cc9

## Then added -proposed archive and installed grub-legacy-ec2 and cloud-init
## and grub-pc (bug 671097)

$ apt-cache policy grub-legacy-ec2
  Installed: (none)
  Candidate: 0.5.10-0ubuntu1.4
  Version table:
     0.5.10-0ubuntu1.4 0
        500 lucid-proposed/main Packages
$ sudo apt-get install grub-legacy-ec2 cloud-init grub-pc
Unpacking grub-legacy-ec2 (from .../grub-legacy-ec2_0.5.10-0ubuntu1.4_all.deb) ...
Adding `diversion of /usr/sbin/grub-set-default to /usr/sbin/grub-set-default.real by grub-legacy-ec2'
Setting up grub-legacy-ec2 (0.5.10-0ubuntu1.4) ...
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.lst file ...

Could not find /boot/grub/menu.lst file.
Generating /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-2.6.32-25-generic-pae
Found kernel: /boot/vmlinuz-2.6.32-309-ec2
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

$ /sbin/halt

## Now, after installing, on the client, I stop the instance and change
## the kernel to amazon's pv-grub kernel
## aki-99a0f1dc ec2-public-images-us-west-1/pv-grub-hd0-V1.01-i386.gz.manifest.xml

% iid=i-cec74e8a
% ec2-modify-instance-attribute --region us-west-1 --kernel aki-99a0f1dc ${iid}
% ec2-start-instances --region us-west-1 ${iid}

## Then, ssh to the started instance, and verify that options in
## /boot/grub/menu.lst actually took. The command line should have 'console=hvc0' on it
## without using pv-grub, the kernel command line will only have 'root=/dev/sda1'.

$ cat /proc/cmdline
root=UUID=ce492d03-a18c-4075-871e-1631ed7e0244 ro console=hvc0

Scott Moser (smoser) on 2010-11-29
tags: added: verification-done
removed: verification-needed
Scott Moser (smoser) wrote :

I found a bug in this -proposed update. Bug 683890.

tags: added: verification-failed
removed: verification-done
Martin Pitt (pitti) wrote :

Accepted cloud-init into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See for documentation how to enable and use -proposed. Thank you in advance!

tags: removed: verification-failed
tags: added: verification-needed
Scott Moser (smoser) wrote :

Shoot. I just marked this as verification done. I had actually done the verification at bug 683890 comment 3 (2010-12-03). Its been a week since then, can we have this get through to -updates now?

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.5.10-0ubuntu1.5

cloud-init (0.5.10-0ubuntu1.5) lucid-proposed; urgency=low

  * make grub-config code run on instance first boot so user is not
    prompted on grub upgrade (LP: #683890, LP: #683379)

cloud-init (0.5.10-0ubuntu1.4) lucid-proposed; urgency=low

  * add grub-legacy-ec2 to support utilizing pv-grub
   rebooting into new kernels (LP: #671103)
 -- Scott Moser <email address hidden> Thu, 02 Dec 2010 09:42:17 -0500

Changed in cloud-init (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers