Public bug reported:

When a cloud image is launched in a kvm based cloud, two disk references
to the same disk appear (/dev/sda and /dev/vda). The former is emulated
(slow) and the latter is paravirtualised (fast). Both appear because (a)
cloud providers cannot know a priori whether the kernel on the disk
image (which is an opaque blob to them) has support for the PV devices,
and thus needs to supply emulated devices, and (b) because even where
the kernel does support PV devices, the boot loader may not, instead
using BIOS calls which only work for emulated devices in many case.

When the cloud images boot up, they have a kernel command line
ROOT=LABEL=foobar, and similarly mount by LABEL in fstab. The problem
here is that there are 2 disks with the same label, and unfortunately
the kernel seems to scan them in module initialisation order (at least I
think that's what's happening). As sd_mod is built in, this causes
/dev/sda to be selected in preference to /dev/vda.

Possible solutions here would be:

1. To emulate the Xen4 unplug school of thought, where the (virtual)
hardware for the PCI device is unplugged early on boot, in a similar
manner to Xen4- this would require extensive hypervisor changes, and may
break existing images which are (stupidly) configured to run with
/dev/sda as root even when /dev/vda is available.

2. To implement an ordering of preferred boot devices, and always prefer
/dev/xvda and /dev/vda over /dev/sda.

3. To compile sd_mod in a modular manner, and blacklist this on the
kernel command line. The disadvantage here is that for (e.g.) Xen3
hypervisors, this blacklisting would have to be removed.

4. To add some code to the beginning of the sd module source (but leave
it built in) so that if a given kernel option is given (e.g.
sd_kvm_disable=1), then the sd module would not init (and add relevant
devices) if it was running on a kvm virtual machine. cloud images could
then have the appropriate additional line in grub.

I would suggest (4) is the simplest here, but others may have better
ideas.

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

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/900799

Title:
  Cloud images on kvm use wrong disks

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to