cc_mounts may need to translate device names for xvda or virtio

Bug #611137 reported by Scott Moser
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
High
Scott Moser
Lucid
Won't Fix
Medium
Jos Boumans

Bug Description

As shown in cloud-config syntax at [1], cloud-init allows the user to a name that will appear in the metadata service instead of a device name. For example, the user can specify:
  - [ ephemeral0, /mnt, auto, "defaults,noexec" ]

If the metadata service contains something like:
 'block-device-mapping': {'ami': 'sda1',
                          'ephemeral0': 'sda2',
                          'root': '/dev/sda1',
                          'swap': 'sda3'},

Then an entry in /etc/fstab will be added for 'sda2'.

There are 2 possibilities that the string 'sda2' will be wrong.
a.) on ec2, we're using a -virtual kernel, or some kernel without a patch to make xen block devices show up as 'sdX' rather than 'xvdX'. Currently our -ec2 kernels have xen block devices as sdX, but this may change.
b.) on eucalyptus, with virtio as root device and/or ebs. In this case, the metadata service will still likely have 'sdX' but the kernel devices would be named vdX.

In either case, some trickery will have to be done to decide to rename.

Really, this is just a general problem with the metadata service provided by the hypervisor believing it knows certain things about the OS that is running in it.

--
[1] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/annotate/head%3A/doc/examples/cloud-config.txt

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: eucalyptus-nc 2.0~bzr1211-0ubuntu1
ProcVersionSignature: User Name 2.6.32-305.9-ec2 2.6.32.11+drm33.2
Uname: Linux 2.6.32-305-ec2 i686
Architecture: i386
Date: Thu Jul 29 03:06:03 2010
Ec2AMI: ami-e930db80
Ec2AMIManifest: ubuntu-images-testing-us/ubuntu-maverick-daily-i386-server-20100727.manifest.xml
Ec2AvailabilityZone: us-east-1b
Ec2InstanceType: m1.small
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: eucalyptus

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
affects: eucalyptus (Ubuntu) → cloud-init (Ubuntu)
Revision history for this message
Scott Moser (smoser) wrote :

verified with 2.0~bzr1211-0ubuntu1 that with virtio root, you get:
 'block-device-mapping': {'emi': 'sda1',
                          'ephemeral': 'sda2',
                          'ephemeral0': 'sda2',
                          'root': '/dev/sda1',
                          'swap': 'sda3'},
while
$ cat /proc/partitions
major minor #blocks name

 252 0 2132992 vda
 252 1 1441792 vda1
 252 2 94000 vda2
 252 3 597167 vda3

Revision history for this message
Scott Moser (smoser) wrote :

I've verified also that with virtio root, /mnt (ephemeral0) is not mounted.

Revision history for this message
Scott Moser (smoser) wrote :

This is fixed in cloud-init 0.5.14

Changed in cloud-init (Ubuntu):
assignee: nobody → Scott Moser (smoser)
importance: Undecided → High
status: New → Fix Released
Revision history for this message
Pete Crossley (peterc) wrote :

I merged this change to DataSourceEc2.py to my local repo for lucid could we get this applied to lucid updates as well?

Jos Boumans (jib)
description: updated
Revision history for this message
Scott Moser (smoser) wrote :

this is confirmed on lucid if you boot a maverick or newer kernel with it.

Changed in cloud-init (Ubuntu Lucid):
status: New → Confirmed
assignee: nobody → Jos Boumans (jib)
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

just for easy reference, the fix was applied to trunk at revno 237 http://paste.ubuntu.com/1517992/

Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.