Public bug reported:

On paravirtualised Xen, cloud-init will not rerun grub. KVM may also
have issues.

The problem is at:
 
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/CloudConfig/cc_grub_dpkg.py
line 47.

The 'if' condition at line 36 handles the case where a block major
device is presented as /dev/sda1 (or /dev/xvda1), which it detects by
the absence of /dev/sda or /dev/xvda (as appropriate). This takes into
account the odd EC2 way of doing things.

The else condition at line 42 is run in a non-EC2 mode, where either the
block major itself is a filing system, or the block major contains a
partition table. The for loop at line 47 then runs through 'all' the
first block minor devices (i.e. first partitions), then (if it fails to
find any) the block majors.

The first issue is that running on Xen on HVM with PV drivers, the
emulated device is PCI unplugged early in the boot sequence, so there is
no /dev/sda or /dev/sda1, just /dev/xvda and /dev/xvda1. Line 47 will
thus not pick this up. /dev/xvda and /dev/xvda1 should thus be added to
this line.

The second issue is that I /think/ /dev/vda should be listed before
/dev/sda, and /dev/vda1 before /dev/sda1. This is because running on
kvm, both devices will appear under some circumstances (e.g. where the
cloud provider cannot determine whether the OS has PV drivers or not so
provides both emulated and PV drevice), and I think it's desirable that
grub thinks it is installing on the virtual device /dev/vda1.

IE I think the line should be:
  for dev in ("/dev/xvda", "/dev/vda", "/dev/sda", "/dev/xvda1", "/dev/vda1", 
"/dev/sda1"):

Complete untested patch attached.

** Affects: cloud-init (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-init in Ubuntu.
https://bugs.launchpad.net/bugs/961240

Title:
  cloud-init does not run grub on PV Xen and KVM has issues

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/961240/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to