Add AZ to instances and image/server to volumes
This syncs the event definitions and gnocci resources with
what was backported to Queens in downstream.
In order for those to be applied properly, need to set
ceilometer:
server:
publisher:
gnocchi:
enabled: True
create_resources: True
in the model for ceilometer (usually on mdb* nodes).
Change-Id: I6e3b04d4a34a29770af6a0e7cfe03d118bdef4c2
Related-Issue: PROD-33784
(cherry picked from commit 0c48ba8d4127b7774fd38b63aa1f4bd0ab7d48c0)
diff --git a/ceilometer/files/queens/event_definitions.yaml b/ceilometer/files/queens/event_definitions.yaml
index 917561b..83b4650 100644
--- a/ceilometer/files/queens/event_definitions.yaml
+++ b/ceilometer/files/queens/event_definitions.yaml
@@ -47,6 +47,11 @@
deleted_at:
type: datetime
fields: payload.deleted_at
+- event_type: compute.instance.create.end
+ traits:
+ <<: *instance_traits
+ availability_zone:
+ fields: payload.availability_zone
- event_type: compute.instance.update
traits:
<<: *instance_traits
@@ -77,6 +82,10 @@
fields: payload.status
created_at:
fields: payload.created_at
+ image_id:
+ fields: payload.glance_metadata[?key=image_id][0].value
+ instance_id:
+ fields: payload.volume_attachment[0].server_id
- event_type: ['volume.exists', 'volume.retype', 'volume.create.*', 'volume.delete.*', 'volume.resize.*', 'volume.attach.*', 'volume.detach.*', 'volume.update.*']
traits:
<<: *cinder_traits
diff --git a/ceilometer/files/queens/gnocchi_resources.yaml b/ceilometer/files/queens/gnocchi_resources.yaml
index a92ce7d..cd06dff 100644
--- a/ceilometer/files/queens/gnocchi_resources.yaml
+++ b/ceilometer/files/queens/gnocchi_resources.yaml
@@ -74,8 +74,16 @@
flavor_name: resource_metadata.(instance_type|(flavor.name)|flavor_name)
server_group: resource_metadata.user_metadata.server_group
event_delete: compute.instance.delete.start
+ event_create: compute.instance.create.end
event_attributes:
id: instance_id
+ display_name: display_name
+ host: host
+ availability_zone: availability_zone
+ flavor_id: instance_type_id
+ flavor_name: instance_type
+ user_id: user_id
+ project_id: project_id
event_associated_resources:
instance_network_interface: '{"=": {"instance_id": "%s"}}'
instance_disk: '{"=": {"instance_id": "%s"}}'
@@ -182,6 +190,8 @@
attributes:
display_name: resource_metadata.(display_name|name)
volume_type: resource_metadata.volume_type
+ image_id: resource_metadata.image_id
+ instance_id: resource_metadata.instance_id
event_delete: volume.delete.start
event_attributes:
id: resource_id