[openstack-dev] [nova] Disk attachment consistency

Martin Packman martin.packman at canonical.com
Tue Aug 14 16:59:59 UTC 2012


On 14/08/2012, Vishvananda Ishaya <vishvananda at gmail.com> wrote:
>
> Third question: what do we do if someone specifies a device value to a kvm
> cloud that we know will not work. For example the vm has /dev/vda and
> /dev/vdb and they request an attach at /dev/vdf. In this case we know that
> it will likely show up at /dev/vdc.

This was pretty confusing when I was writing a script using volumes,
but not for the common case.

In general the code does:
* attach volume passing the value /dev/vdz
* mount using the /dev/disk/by-label/%(volume_name)s

So, the fact the disk actually comes up at /dev/vdc doesn't matter.
Attaching two volumes however fails, nova needs a different value like
/dev/vdy even though it's not where the disk shows up.

Creating a new volume is a little more complicated, but grepping dmesg
for the path and formatting with the right label name will be simple
enough to replace with neater code if the api starts returning a disk
id in future.

Martin



More information about the OpenStack-dev mailing list