[Openstack] [Nova] [Cinder] Block device name / ordering

Matt Riedemann mriedem at linux.vnet.ibm.com
Thu Feb 18 02:11:11 UTC 2016



On 2/17/2016 6:49 PM, Bruno L wrote:
> Hi everyone,
>
> Could not figure this one out based on docs, wiki, or previous posts on
> the mailing list.
>
> We use KVM as our hypervisor on the Catalyst Cloud in New Zealand.
> Unlike Xen, KVM does not support setting the device name (eg: /dev/vdc)
> of a cinder volume within the guest. If a user specifies the device name
> it is ignored and cinder will display the device name that has been
> assigned.
>
> To what extent is the device name (mountpoint) displayed by Cinder /
> Nova reliable? Is Cinder just naming attachments in alphabetical order
> hoping that it is correct, or actually obtaining the device name from
> the hypervisor?
>
> If a user attaches 2 volumes with the same size to a compute instance
> (eg: one for a database and one for media assets), how can he or she
> identify which one is what? From what I can see on our compute
> instances, the device ID or UUID does not match the volume name or UUID
> displayed by OpenStack. What is the best way to ensure you are dealing
> with the correct device?
>
> Do you know if there is work going on in KVM to allow a device name to
> be specified like in Xen?
>
> Cheers,
> Bruno
>
> Catalyst Cloud
> http://www.catalyst.net.nz/catalyst-cloud
>
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>

It's not actually cinder that's picking the device name (mountpoint), 
it's the libvirt driver (more specifically, the 
nova.virt.libvirt.blockinfo code).

The change to ignore the user-supplied device name for the libvirt 
driver went into liberty [1]. I don't know all of the details behind it, 
but my understanding was requesting a specific device was not reliable 
with libvirt, so it's best to let libvirt pick the mountpoint for you. 
ndipanov and/or danpb in the #openstack-nova freenode channel would be 
able to give more information.

As for figuring out which mountpoint the attachments are on, you have to 
wait for the volume status to go to 'in-use' and then from the volume 
GET you can get the attachment information (there should be a list of 
dicts in the response that have the attachment IDs and mountpoints in 
them). I believe since we don't support multiattach for volumes yet in 
nova, there would only be one attachment in the list.

As for figuring out what's what, if you are naming the volumes that 
you're attaching to something like 'db' and 'media', then you should 
know which is which, right? Then just get the mountpoint from the volume 
attachment meta that's available via the Cinder REST API.

Hope this helps.

[1] https://review.openstack.org/#/c/189632/

-- 

Thanks,

Matt Riedemann





More information about the Openstack mailing list