[sdk] empty image dict if volume is attached

thoralf schulze t.schulze at tu-berlin.de
Fri Oct 9 12:50:26 UTC 2020


hi there,

openstack instances that have a cinder volume attached as their primary 
block device won't return any information regarding the image that has 
been used during their creation:

openstack server show -f shell -c image -c volumes_attached test1
image=""
volumes_attached="id='c0650208-f39c-4427-a73b-e1aa88531016'"

vs.

openstack server show -f shell -c image -c volumes_attached test2
image="Ubuntu 20.04 LTS (5cf81857-0dba-497e-ad9a-23a88dd97506)"
volumes_attached=""

as a result, this information won't be available in ansible inventories 
created with the relevant plugin¹ either … this is unfortunate, since i 
need to set certain variables for ansible based on the image resp. the 
operating system an instance uses.

now, the necessary information seems to be available as a volume's metadata:

openstack volume show -f shell -c volume_image_metadata 
c0650208-f39c-4427-a73b-e1aa88531016
volume_image_metadata="{'signature_verified': 'False', 'hw_rng_model': 
'virtio', 'hypervisor_type': 'qemu', 'os_distro': 'centos', 'os_type': 
'linux', 'image_id': '1572c62f-438c-4a70-be84-973fef0d3c77', 
'image_name': 'CentOS 8', 'checksum': 
'd89eb49f2c264d29225cecf2b6c83322', 'container_format': 'bare', 
'disk_format': 'qcow2', 'min_disk': '10', 'min_ram': '1024', 'size': 
'716176896'}"

… would it be a good idea to extend openstacksdk to look for image_name 
in the volumes attached to an instance and use this value for the image key?

thank you very much & with kind regards,
t.

¹ - 
https://docs.ansible.com/ansible/latest/collections/openstack/cloud/openstack_inventory.html 
, this plugin makes use of openstacksdk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x0B3511419EA8A168.asc
Type: application/pgp-keys
Size: 3913 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20201009/32b6be0f/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20201009/32b6be0f/attachment-0001.sig>


More information about the openstack-discuss mailing list