Commit Graph

20 Commits

Author SHA1 Message Date
Kevin_Zheng 2a0f2a0d27 Add full traceback to ExceptionPayload in versioned notifications
This patch adds full traceback to ExceptionPayload in versioned
notifications.

The instance fault field and instance-action REST API has already
provide the traceback to the admin users (controlable through policy)
and the notifications are also admin only things as they are emitted
to the message bus by default. So it is assumed that security is not
a bigger concern for the notification than for the REST API.

On the ML [1] post there was no objection to add new string field to the
ExceptionPayload that will hold the serialized traceback object.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-March/128105.html

Implements: blueprint add-full-traceback-to-error-notifications

Change-Id: Id587967ea4f9980c292492e2f659bf55fb037b28
2018-06-19 16:46:46 +08:00
Balazs Gibizer 470d165d04 Deduplicate instance.create notification samples
This patch refactors the sample files of instance.create notifications.
As these notifications use a different payload class as the most of the
instance notifications a new common payload sample fragment was also
needed.

Change-Id: I7a8e9507ee30d404e075a46e48070a0f94276e33
2017-11-28 17:17:15 +01:00
Matt Riedemann 48259c2bd7 Add FlavorPayload.description for versioned notifications
This adds the description field to the FlavorPayload
for versioned notifications on flavor create/update/delete
notifications.

Part of blueprint flavor-description

Change-Id: I9a5dc8b603b5e4e0d37c59cf2749e3ffc217580c
2017-11-14 09:14:12 -05:00
Takashi NATSUME bf17be9e8f Add 'updated_at' field to InstancePayload in notifications
Change-Id: Iddc5ec3b5053ddf5dce73c86edca26c4552d451b
Implements: bp versioned-notification-transformation-pike
Closes-Bug: #1684860
2017-07-25 19:31:21 +02:00
Kevin_Zheng f665565d69 Add tags to instance.create Notification
This patch added a new field 'tags' to InstanceCreatePayload.

Partial-implement: bp additional-notification-fields-for-searchlight
Partial-implement: blueprint support-tag-instance-when-boot

Change-Id: Iefaa9da4e136fd5e823bf7b11c8aa5b4cd6d7de8
2017-07-24 18:05:05 -04:00
Balazs Gibizer 1928ec5606 Add BDM to InstancePayload
This patch adds bdm related data to InstancePayload. As loading BDM
can be expensive a new configuration flag 'bdms_in_notifications' is
introduced. If this is set to false (as by default) then the instance
notifications will contain 'null' value in block_devices field.
If this configuration flag is set to true then the block devices will
be loaded from the db and will be included in the notification payload.

Implements: bp additional-notification-fields-for-searchlight
Change-Id: I18e7483ec9a484a660e1d306fdc0986e1d5f952b
2017-07-12 16:55:17 +02:00
Balazs Gibizer bae0deb137 Add key_name field to InstancePayload
Add key_name field to InstancePayload which means every instance.<action>
notification now have key_name field based on the instance.key_name.

Change-Id: I39059c5077c790aa85dff6b4563f581c54536b86
Implements: bp additional-notification-fields-for-searchlight
2017-06-28 11:32:21 +02:00
Balazs Gibizer f756964b22 Add keypairs field to InstanceCreatePayload
Add keypairs field to instance.create notifications based on
instance.keypairs field.

Change-Id: I30e068d4de4b45f34308665de37d4cb9d6502111
Implements: bp additional-notification-fields-for-searchlight
2017-06-28 11:03:44 +02:00
Balazs Gibizer 3b72d60589 Add separate instance.create payload type
There are two parallel efforts to add new fields to the instance.create
notification only. Currently instance.create notification uses the generic
InstanceActionPayload ovo as the payload type. This patch creates a separate
InstanceCreatePayload ovo so that fields like keypairs and tags can be added
only to this specific payload class later in separate patches.

The keypair and tags field are not added directly to the base InstancePayload
class because both field need extra db query to fetch. So sending them at
every instance action (e.g. reboot) could cause db load.

The version of the instance.create payload is not bumped as the content
of the payload is the same just the name of the type is changed.

Change-Id: I90fb7beb450100de8f4e542921b99f043c529a0f
2017-06-16 15:28:57 +02:00
Sujitha bb7d5214a4 Adding auto_disk_config field to InstancePayload
Add auto_disk_config field to InstancePayload based on
instance.auto_disk_config boolean value. If true, set it to
AUTO else MANUAL.

Implements: bp additional-notification-fields-for-searchlight
Change-Id: I18af99479562e2fe5e74e6e1252b804b074fee58
2017-04-21 12:45:39 +02:00
Dan Smith 03b4c67b22 Set instance.availability_zone whenever we schedule
This ensures that instance.availability_zone reflects what AZ the
instance is actually in. In the case where no AZ was requested at
boot, previously this would always be some default value, which
isn't as useful to the things that need to consider what AZ the
instance is actually in (without doing all the aggregate math to
determine it on the fly).

Related to blueprint cells-aware-api
Change-Id: I8d426f2635232ffc4b510548a905794ca88d7f99
2017-03-23 09:30:40 -07:00
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
Jenkins 5ba04f4335 Merge "Improve flavor sample in notification sample tests" 2017-01-23 15:03:31 +00:00
Jenkins 0308c00d0d Merge "Update notification for flavor" 2017-01-11 21:58:06 +00:00
Balazs Gibizer af17b95073 Improve flavor sample in notification sample tests
This patch adds an extra_specs key to the flavor used in the
instance action sample test to make the samples more realistic.

Change-Id: I5ec2b536469daaea16efb1ef1537a951dc52997a
Implements: bp flavor-notifications
2017-01-11 19:50:20 +01:00
Jenkins 799efc7631 Merge "Notifications for flavor operations" 2017-01-11 16:45:50 +00:00
Matt Riedemann e05f678e0a Update notification for flavor
This patch adds versioned notification for flavor update operation.

Implement blueprint: flavor-notifications

Change-Id: I770e3c0c1675bbb7844b13826f3fdc48ad5491a2
2017-01-11 11:16:49 -05:00
liyingjun 8d9b3d6b9d Notifications for flavor operations
This patch implements the versioned notifications for flavor
create and destroy.

Implement blueprint: flavor-notifications

Change-Id: Icc2169b87ffba4e7e2079076a82029156c584c6a
2017-01-09 20:39:58 +08:00
Anusha Unnam 5c796cbfba Add more field's in InstancePayload
Add instance's locked field and instance's
display_description field in InstancePayload.

Implements: bp additional-notification-fields-for-searchlight

Change-Id: Iceae25ca8a0d7f2e5f22cab1364215bda2fae93c
2016-12-29 16:34:26 +00:00
Gábor Antal 94563ade46 Transform instance.create.error notification
Along with the transformation changes, I modified notify_about_instance_action
method so it can handle errors now. (It wraps the exception object into an
ExceptionPayload.)

Implements: bp versioned-notification-transformation-ocata

Change-Id: I171990290c8de529c9521a5ee556f97b18b741b0
2016-11-22 15:03:52 -05:00