Add the volume_type_id attribute for volumes

This change adds the volume_type_id attribute to volume.size
notification samples and the volume Gnocchi resource type.

The volume_type_id attribute contains the ID for the volume type
of a volume. The current volume_type attribute stores the name
of the volume type instead.

The volume.size pollster already adds the volume_type_id
attribute to polling samples, so no changes were required there.

Note that the volume_type attribute returned by Cinder volume
notifications is actually the volume type ID (not the name).
This causes issues when populating the volume_type attribute
in Gnocchi, addressed in another patch [1].

[1]: https://review.opendev.org/c/openstack/ceilometer/+/940758

Change-Id: I079be170f10357e001bbe1c17df8541bf523d402
This commit is contained in:
Callum Dickinson 2025-02-05 15:26:14 +13:00
parent 38c2144e27
commit ce3ab93cb8
4 changed files with 28 additions and 0 deletions

View File

@ -130,6 +130,7 @@ metric:
metadata:
display_name: $.payload.display_name
volume_type: $.payload.volume_type
volume_type_id: $.payload.volume_type
image_id: $.payload.glance_metadata[?key=image_id].value
instance_id: $.payload.volume_attachment[0].server_id

View File

@ -200,6 +200,15 @@ resources_update_operations = [
"value": {"type": "string", "min_length": 0, "max_length": 255,
"required": False}
}]},
{"desc": "add volume_type_id to volume",
"type": "update_attribute_type",
"resource_type": "volume",
"data": [{
"op": "add",
"path": "/attributes/volume_type_id",
"value": {"type": "string", "min_length": 0, "max_length": 255,
"required": False}
}]},
]

View File

@ -242,6 +242,7 @@ resources:
attributes:
display_name: resource_metadata.(display_name|name)
volume_type: resource_metadata.volume_type
volume_type_id: resource_metadata.volume_type_id
image_id: resource_metadata.image_id
instance_id: resource_metadata.instance_id
event_delete:

View File

@ -0,0 +1,17 @@
---
features:
- |
Added the ``volume_type_id`` attribute to ``volume.size`` notification
samples, which stores the ID for the volume type of the given volume.
- |
Added the ``volume_type_id`` attribute to ``volume`` resources in Gnocchi,
which stores the ID for the volume type of the given volume.
upgrade:
- |
``meters.yaml`` has been updated with changes to the ``volume.size``
notification meter. If you override this file in your deployment,
it needs to be updated.
- |
``gnocchi_resources.yaml`` has been updated with changes to the
``volume`` resource type. If you override this file in your deployment,
it needs to be updated.