nova/doc/notification_samples/instance-pause-start.json
Balazs Gibizer 655942069a handle uninited fields in notification payload
Due to the not strict handling of uninitialized fields during
notification payload population it is possible that the emitted
notification missing some of the fields defined in the schema.

There are two problematic cases:
1) no load tirggered for lazy loaded fields. If the field was not
   loaded it is not added to the payload.
2) uninitialized, not lazy loadable fields are not added to the
   payload.

This patch makes sure that lazy load is triggered. If the field is
not lazy loadable and also not initialized then related payload
field will be set to None. If the payload field is not nullable
the code will fail to make sure that the inconsistency is detected.

The following changes cannot be split to different commits because
as soon as the generic schema population code is fixed every listed
notification starts behaving differently.

In some cases the availability_zone field of the Service object is left
unitialized by both the constructor and the obj_load_attr function this
caused that the availability_zone field of the service.update
notification was missing from the emitted notification payload.

The extra_specs field of the Flavor object is not lazy loadable and not
initialized in the Flavor destroy case. So the extra_specs field of the
FlavorPayload needed to be made nullable.

The projects field of the Flavor object is lazy loaded but when the
Flavor object is loaded as part of an Instance object Flavor is
orphaned and no lazy load is allowed on that Flavor object. In this
case the projects field of the FlavorPayload will be set to None to
signal that the information is not available. This also means that
the projects field of the FlavorPayload needed to be changed to
nullable.

The hosts and id fields of the Aggregate object is not initialized
during the create of the Aggregate before the aggregate.create.start
needs to be sent. Therefore these fields needs to be nullable.

Closes-Bug: #1653221
Change-Id: Ib122cd98ee0cc31938d5ff1d5c753053267a3bd4
2017-03-03 15:34:41 +01:00

76 lines
2.6 KiB
JSON

{
"event_type":"instance.pause.start",
"payload":{
"nova_object.data":{
"architecture":"x86_64",
"availability_zone":null,
"created_at":"2012-10-29T13:42:11Z",
"deleted_at":null,
"display_name":"some-server",
"display_description":"some-server",
"fault":null,
"host":"compute",
"host_name":"some-server",
"ip_addresses": [{
"nova_object.name": "IpPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.0",
"nova_object.data": {
"mac": "fa:16:3e:4c:2c:30",
"address": "192.168.1.3",
"port_uuid": "ce531f90-199f-48c0-816c-13e38010b442",
"meta": {},
"version": 4,
"label": "private-network",
"device_name": "tapce531f90-19"
}
}],
"kernel_id":"",
"launched_at":"2012-10-29T13:42:11Z",
"image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"metadata":{},
"locked":false,
"node":"fake-mini",
"os_type":null,
"progress":0,
"ramdisk_id":"",
"reservation_id":"r-npxv0e40",
"state":"active",
"task_state":"pausing",
"power_state":"running",
"tenant_id":"6f70656e737461636b20342065766572",
"terminated_at":null,
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.data": {
"flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
"name": "test_flavor",
"root_gb": 1,
"vcpus": 1,
"ephemeral_gb": 0,
"memory_mb": 512,
"disabled": false,
"rxtx_factor": 1.0,
"extra_specs": {
"hw:watchdog_action": "disabled"
},
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
},
"nova_object.version": "1.3",
"nova_object.namespace": "nova"
},
"user_id":"fake",
"uuid":"178b0921-8f85-4257-88b6-2e743b5a975c"
},
"nova_object.name":"InstanceActionPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.1"
},
"priority":"INFO",
"publisher_id":"nova-compute:compute"
}