The current rebuild testing in test_instance_action changes the image
used by the instance, therefore the actions tested in
test_instance_action had to be in specific order as testing rebuild
also changes the output json.
The rebuild test was moved from test_instance_action to its own method,
and now all the actions in test_instance_actions keeps the instance in
the same state.
Change-Id: Id0a7aaf8575d69deb89d3842b54fc23ee05b2153
Implements: bp versioned-notification-transformation-pike
This patch adds notifications when instance
tags changed, as tag is commonly used for
searching and filtering, and projects like
searchlight depends on the notifications.
To avoid unnecessarily building a notification
payload when notifications are disabled, this
change also adds the if_notifications_enabled
decorator to send_instance_update_notification.
Change-Id: I03c8e8225e51fd80580772752c0b292987e34218
Implements: bp send-tag-notification
New objects are children of NovaObject class. Such parent
will give us a good control of objects versioning. Also it
will force contributors to dump objects version in case of
any changes. These objects will be used to transmit data
via RPC. Old objects were used only for storing data.
During RPC transmission they are transform into dictionaries.
It is not right approach because we will have some problems
in case of adding new diagnostics fields.
Version of compute RPC was bumped.
Also some changes were made in libvirt driver method
get_instance_diagnostics(). These changes were made to fill
new fields of 'Diagnostics' object.
Implementation of method get_instance_diagnostics()
for other virt drivers will be changed in future patches.
blueprint: restore-vm-diagnostics
Change-Id: I5e2d116df045f803c654f7810b939b5fc859cfbf
Now that the services table has a uuid field and we'll be exposing
that out of the REST API, we should include the uuid in the
service.update notification payload.
Part of blueprint service-hyper-uuid-in-api
Change-Id: I8c400086a8dce9317a39f7e65c8d098d93af335d
When we destroy a flavor it's happening in the API database now.
Right after we delete the flavor, we send a delete notification
which will attempt to lazy-load projects, but because the flavor
is deleted, that will result in a FlavorNotFound from the API DB
in method _get_projects_from_db. Because of our fallback code to
the main cell DB we'll then call flavor_access_get_by_flavor_id
which returns an empty list and that's what goes into the
notification, but it's not accurate since the empty list implies
there are/were no projects with access to that flavor, when in
reality we don't know.
This handles the delete notification case by orphaning the flavor
object so that when the notification emit happens, the
NotificationPayloadBase gets an OrphanedObjectError and just
sets projects to None, which is a better representation in the
notification payload that we don't have that data.
The tests needed some work since they were not actually comparing
the payload to the flavor object before, they were comparing to
fields in the DB representation of the flavor, which doesn't
include the projects field as it's a joined column.
Change-Id: I6868efab22cf9f1eb9006589a5b62618434c3ba3
Closes-Bug: #1687012
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
Tags field is added to the InstanceUpdatePayload based on the
tags field fo the related Instance object. Adding tags to instance.create
notification will be handled in the bp tag-instances-when-boot.
Implements: bp additional-notification-fields-for-searchlight
Change-Id: Ifad6487de200767fc16d035ad830c77bba49154a
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
instance.reboot notifications is transformed to the new versioned framework.
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: Ie58365b9fea9e6d061cbcf1b59e61e276e3ff775
Implements: bp versioned-notification-transformation-pike
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: I8340817977ed7b15bb85d266de4fe9eedb0b0fa0
Implements: bp versioned-notification-transformation-pike
Handling rebuild.error:
https://review.openstack.org/#/c/396621/
Co-Authored-By: Béla Vancsics <vancsics@inf.u-szeged.hu>
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: If624c2691830584851e9c97693cd7b7e73e73bb2
Implements: bp versioned-notification-transformation-pike
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
This patch finishes to remove the 'check_attach' call from Nova
completely. As Cinder already performs the required checks as part
of the 'reserve_volume' (os-reserve) call it is unnecessary to check the
statemachine in Nova also and it can lead to race conditions.
The missing 'reserve_volume' call is added to the BFV flow. In case of
build failure the volume will be locked in 'attaching' state until the
instance in ERROR state is cleaned up.
We also check AZ for each volume attach operation which we haven't
done for unshelve. A release note is added to enable 'cross_az_attach'
in case the user does not care about AZ.
The compute service version had to be bumped as the old computes still
perform 'check_attach', which will fail when the API reserves the
volume and the volume state moves to 'attaching'. If the computes
are not new enough the old check will be called as opposed to
'reserve_volume'.
Closes-Bug: #1581230
Change-Id: I3a3caa4c566ecc132aa2699f8c7e5987bbcc863a
We need to signal that the compute is Ocata and since the placement is now
mandatory for Ocata, we want to hard-fail if the conf is not correct.
Depends-On: I573149b9415da2a8bb3951a4c4ce71c4c3e48c6f
Change-Id: I3919f652040f2be2641420dd469af01b268e65c9
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
This patch implements the versioned notifications for flavor
create and destroy.
Implement blueprint: flavor-notifications
Change-Id: Icc2169b87ffba4e7e2079076a82029156c584c6a
The aggregate.delete.start and aggregate.delete.end notifications
has been transformed to the versioned notification framework.
Implements: bp versioned-notification-transformation-ocata
Change-Id: I911e7aef813380291e6cf166eac91b53215a3726
The aggregate.create.start and aggregate.create.end notifications
has been transformed to the versioned notification framework.
The notification payload contains the 'id' of the aggregate which
is the db primary key. It is added because the REST API also
uses the db id instead of the uuid in the os-aggregates' requests
and responses.
Implements: bp versioned-notification-transformation-ocata
Change-Id: I92fe504a8f7dc19b0e1df5884045d4bc0d9e4f98
Add instance's locked field and instance's
display_description field in InstancePayload.
Implements: bp additional-notification-fields-for-searchlight
Change-Id: Iceae25ca8a0d7f2e5f22cab1364215bda2fae93c
The instance.snapshot.start and instance.snapshot.end notifications
are transformed to the versioned framework.
Change-Id: I0bde5fce14c181d47f5ad052a68382e01bf95524
Implements: bp versioned-notification-transformation-ocata
The instance.finish_resize.start and instance.finish_resize.end
notifications are transformed to the versioned framework.
Change-Id: I2ca79040a91368212fdf50593ef012a669a4a12a
Implements: bp versioned-notification-transformation-ocata
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
We don't need image_name as an extra usage information, because
in the versioned notification, we have image_uuid which can be used
to get the name of the image from glance, if needed.
Change-Id: I1f3ea8d74a2e59049447c3045a293ce0babfb427
Implements: bp versioned-notification-transformation-ocata
Instance.shutdown.start and instance.shutdown.end notifications
are transformed to the new versioned framework.
Change-Id: I01732837cf5a54ecd04b00771bac92c9864cd3b0
Implements: bp versioned-notification-transformation-ocata