cloud-init does not run grub on PV Xen and KVM has issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
On paravirtualised Xen, cloud-init will not rerun grub. KVM may also have issues.
The problem is at:
http://
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.
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Low |
Changed in cloud-init (Ubuntu): | |
status: | New → Triaged |
The attachment "untested patch to fix loop over devices" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]