Re-opening this bug as we're seeing a mismatch between the block device path presented by Juju and the actual block device associated with a cinder volume.
The 'device' attribute of the attachment that is created for a volume in OpenStack is foobar; there is no way that Nova/Libvirt/Qemu and enforce this in the guest (think windows guests) and the block device path will be allocated when the udev events fire for the block device presentation.
That said Nova does make an effort to inject some metadata into the block device name via libvirt/qemu (this only works for virtio devices):
Re-opening this bug as we're seeing a mismatch between the block device path presented by Juju and the actual block device associated with a cinder volume.
The 'device' attribute of the attachment that is created for a volume in OpenStack is foobar; there is no way that Nova/Libvirt/Qemu and enforce this in the guest (think windows guests) and the block device path will be allocated when the udev events fire for the block device presentation.
That said Nova does make an effort to inject some metadata into the block device name via libvirt/qemu (this only works for virtio devices):
$ sudo udevadm info --query=all --name=/dev/vdc pci0000: 00/0000: 00:06.0/ virtio3/ block/vdc id/virtio- abf836a3- 0dcf-48d9- 9 path/pci- 0000:00: 06.0 path/virtio- pci-0000: 00:06.0 uuid/305ec52e- 4e50-4a51- ac35-85dd0a84a2 32 /dev/disk/ by-uuid/ 305ec52e- 4e50-4a51- ac35-85dd0a84a2 32 /dev/disk/ by-path/ pci-0000: 00:06.0 /dev/disk/ by-path/ virtio- pci-0000: 00:06.0 /dev/disk/ by-id/virtio- abf836a3- 0dcf-48d9- 9 /devices/ pci0000: 00/0000: 00:06.0/ virtio3/ block/vdc filesystem 305ec52e- 4e50-4a51- ac35-85dd0a84a2 32 ENC=305ec52e- 4e50-4a51- ac35-85dd0a84a2 32 pci-0000: 00:06.0 TAG=pci- 0000_00_ 06_0 abf836a3- 0dcf-48d9- 9 D=2059336
P: /devices/
N: vdc
S: disk/by-
S: disk/by-
S: disk/by-
S: disk/by-
E: DEVLINKS=
E: DEVNAME=/dev/vdc
E: DEVPATH=
E: DEVTYPE=disk
E: ID_FS_TYPE=xfs
E: ID_FS_USAGE=
E: ID_FS_UUID=
E: ID_FS_UUID_
E: ID_PATH=
E: ID_PATH_
E: ID_SERIAL=
E: MAJOR=252
E: MINOR=32
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZE
$ openstack volume list
| abf836a3- 0dcf-48d9- 9cb0-ff679665ba 8b | tools | in-use | 200 | Attached to jamespage-bastion on /dev/vdc |
The ID_SERIAL of the volume matches the start of the UUID allocated for the volume by cinder.
We think this is the only reliable way to map a cinder volume to the actual block device presented within an OpenStack Cloud.