openstack server add volume -device can not assign an internal device name for volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Jammy+ Yoga nova 3:25.2.0-0ubuntu1
Even though I specified the name as vdd, the device-mapping is still vdb
$ openstack server add volume d261479e-
$ openstack volume show 9dc530f2-
[{'id': '9dc530f2-
$ virsh domblklist 1
Target Source
-------
vda /var/lib/
vdb cinder-
nova-compute.log
2023-12-06 06:45:36.991 348863 INFO nova.virt.
2023-12-06 06:45:37.322 348863 INFO nova.compute.
In code [1] we can see that whatever name we specify is simply ignored, and the generated name is used.
Even the latest version of the code [2] is still the same.
It seems that the current code doesn't support specifying a device name when attaching a volume.
I'm not sure if it's true that all attached volumes can only be assigned an alphabetical device name inside the vm.
Is there any other way to assign a device name inside the vm?
[1] https:/
[2] https:/
summary: |
- openstack server add volume -device can not assign a internal device + openstack server add volume -device can not assign an internal device name for volume |
I'm afraid this is expected behaviour, and we call it out in our API reference [1]:
device (Optional)
body
string
Name of the device such as, /dev/vdb. Omit or set this parameter to null for auto-assignment, if supported. If you specify this parameter, the device must not exist in the guest operating system. Note that as of the 12.0.0 Liberty release, the Nova libvirt driver no longer honors a user-supplied device name. This is the same behavior as if the device name parameter is not supplied on the request.
I agree that it's not necessarily clear or obvious, and we should perhaps consider removing this API parameter altogether (though other hypervisors besides libvirt might still support it), but that's the current state of things.
[1] https:/ /docs.openstack .org/api- ref/compute/ #attach- a-volume- to-an-instance