<p>This is done and merged recently. The serial number is set to the volume uuid. It is also valid to pass no device parameter on attach and the next available device will be used. The device name will be correct as long ad the guest kernel is 3.2 or greater.</p>

<div class="gmail_quote">On Sep 6, 2012 10:30 AM, "Steven Dake" <<a href="mailto:sdake@redhat.com">sdake@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
In KVM, the device parameter for the create_server_volume API has no<br>
impact on the device seen in the operating system.  Speaking to the KVM<br>
devs, they don't see a future where the OS will ever be able to assign a<br>
device name as specified in this API.  The OpenStack compute docs<br>
describe this limitation:<br>
<a href="http://docs.openstack.org/trunk/openstack-compute/admin/content/configure-nova-volume.html" target="_blank">http://docs.openstack.org/trunk/openstack-compute/admin/content/configure-nova-volume.html</a><br>
<br>
The reason this functionality is important is for many apps that use the<br>
volume server (heat in my case - <a href="http://www.heat-api.org" target="_blank">http://www.heat-api.org</a>), there must be<br>
a way to map an external device into a "known" location inside the VM.<br>
<br>
Consider the example where a user attaches 5 volumes to a server at<br>
about the same time - the internal VM will have no reasonable way of<br>
determining which attached disk maps to the internal /dev/vdx.<br>
<br>
A fairly simple solution to this problem is to specify the serial number<br>
during KVM volume attachment.  Then the volume would be available in the<br>
VM via:<br>
<br>
mount /dev/disk/by_id/my_disk_a<br>
<br>
and could be attached to the instance by:<br>
<br>
create_server_volume(x, y, 'my_disk_a')<br>
<br>
Another approach would be to add another parameter that defines the<br>
serial number (ie: create_server_volume(x, y, z, 'my_disk_a')<br>
<br>
If there is a preference to approaches, I'll work up the appropriate<br>
patches.<br>
<br>
Regards<br>
-steve<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div>