Commit Graph

97 Commits

Author SHA1 Message Date
Stephen Finucane 2b02b66bae objects: Remove 'bandwidth' fields from notifications
Finish up removing these entries from the versioned instance
notifications. They're useless since we dropped support for the XenAPI
virt driver. The underlying model is retained for now: that will be
handled separately.

Change-Id: I774c50fca99bc655ca5010e3b9d8247b739293b3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-11-03 17:33:43 +00:00
Stephen Finucane 9d1683f70f virt: Remove 'get_all_bw_counters' API
This one is a little more involved because there are persistent objects
and versioned notifications to worry about, neither of which we can
remove right now.

Change-Id: Ic7c330ee1cccdc44a2a555c16cb6090eecbf6ce1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-11-24 15:29:21 +00:00
Surya Seetharaman c541ace518 Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``locked_reason`` to
``POST /servers/{server_id}/action`` request where the
action is lock. It enables the user to specify a reason when locking
a server.

The locked_reason will be exposed through ``GET servers/{server_id}``,
``GET /servers/detail``, ``POST /servers/{server_id}/action``  where
the action is rebuild and ``PUT servers/{server_id}`` requests' responses.

The InstanceActionNotification will emit the locked_reason
along with the other instance details. This patch hence changes the
payload object to include the "locked_reason" field.

Note that "locked" will be allowed as a valid filtering/sorting parameter
for ``GET /servers/detail`` and ``GET /servers`` from this new microversion.

Implements blueprint add-locked-reason

Change-Id: I46edd595e7417c584106487123774a73c6dbe65e
2019-05-11 21:48:27 +00:00
Ifat Afek 0240c7b5b6 The field instance_name was added to InstanceCreatePayload
The field instance_name was missing from Nova instance notifications.
It was added to instance.create.* notifications, as discussed in:
http://lists.openstack.org/pipermail/openstack-discuss/2018-December/001141.html

Change-Id: I52f3186d1bcda0c23a471f9bfd2c55763262658f
2019-01-15 15:27:07 +00:00
Gábor Antal 23efc549a1 Transform instance.live_migration_force_complete notification
The instance.live_migration_force_complete.start and
instance.live_migration_force_complete.end notifications have been
transformed to the versioned notification framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I2e9a474457a7597a9febc111b13a67ddcf45f29e
Implements: bp versioned-notification-transformation-rocky
2018-07-16 00:12:37 +09:00
Zuul 202c147f3c Merge "Transform instance.live_migration_rollback_dest notification" 2018-07-15 13:25:45 +00:00
Zuul 13dbe1a58d Merge "Transform instance.live_migration_post notification" 2018-07-15 13:14:54 +00:00
Gábor Antal ab2279eb09 Transform instance.rebuild_scheduled notification
The instance.rebuild_scheduled notification has been transformed
to the versioned notification framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I640562b8dd049ff5b6fea9286dc3082b9d837ed3
Implements: bp versioned-notification-transformation-rocky
2018-07-09 09:55:40 +09:00
Béla Vancsics 379cf65d82 Transform instance.live_migration_post notification
The instance.live_migration_post.start and
instance.live_migration_post.end notifications have been transformed to
the versioned notification framework.

Co-Authored-By: Alex Szarka <szarka@inf.u-szeged.hu>
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: If9993d5edab5a2f141387a8eb294a9645667ee6b
Implements: bp versioned-notification-transformation-rocky
2018-07-05 20:24:46 +09:00
Gábor Antal 8ddbe07e8f Transform instance.live_migration_rollback_dest notification
The instance.live_migration_rollback_dest.start and
instance.live_migration_rollback_dest.end notifications has been
transformed to the versioned notification framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I8129cbd1785133d4cc1b70bbba6bd7fcc1d21f4a
Implements: bp versioned-notification-transformation-rocky
2018-07-05 13:19:32 +09:00
shuangyang.qian 2bca6431e6 Add action initiator attribute to the instance payload
The instance action notifications contain the user id and the
project id of the owner of the instance. However an instance
action might be initiated by another user. It could be another
user from the same project or can be an admin from the admin project.
To be able to distinguish between the user who initiated the instance
action from the user owning the instance we need to add two new
fields to the instance action notifications, action_initiator_user
and action_initiator_project

Change-Id: I649d8a27baa8840bc1bb567fef027c749c663432
Closes-bug: #1744658
Blueprint: add-action-initiator-to-instance-action-notifications
2018-07-03 18:45:44 +00:00
Yikun Jiang 0b9b37fe9a Add instance.unlock notification
The instance.unlock versioned notification is introduced in this
patch.

The unlock operation just changes the instance.locked to False in
API, we send the notification after db operation.

Change-Id: Ic750c33b4f88ba9c62ea8cba86915c6010f2cd6f
blueprint: trigger-notifications-when-lock-unlock-instances
2018-06-25 19:25:39 +00:00
Yikun Jiang 102cdb9315 Add instance.lock notification
The instance.lock versioned notification is introduced in this
patch.

The lock operation just changes the instance.locked to True in
API, we send the notification after db operation.

Change-Id: I03a13afa91c29f4fee25336cb82ea5c887eae2f8
blueprint: trigger-notifications-when-lock-unlock-instances
2018-06-21 10:29:31 +08:00
Matt Riedemann dc9fb5842c Fix nits from trusted certs notification change
This is a follow up to address a few nits in change
Ib5b50a3889ab15d5aac992f92e9be372a915eeff.

Change-Id: I08ce4a9f5bb33761d8c5ff82ef9faf874ac97fcc
2018-06-15 08:34:12 -04:00
Brianna Poulos e8ed9aacf8 Add notification support for trusted_certs
Add the 'trusted_image_certificates' field to InstanceCreatePayload
and InstanceActionRebuildPayload notifications.

Change-Id: Ib5b50a3889ab15d5aac992f92e9be372a915eeff
2018-06-14 16:16:00 +02:00
Alex Szarka e7bdd19f0e Transform instance.exists notification
This patch contains the instance.exists related notification
transformation. The functional test for instance_usage_audit
periodic task case is added in a subsequent patch.

Change-Id: I1a0afa0e8740c229db77c18b932e316196880de5
Implements: bp versioned-notification-transformation-rocky
2018-06-05 12:51:30 +00:00
Kevin_Zheng 94de8d75ff Add request_id to instance action notifications
As it was agreed on the Rocky PTG [1] it is useful to have the
request_id of in the payload of every instance action versioned
notification. For example it could help the deployer connect
the state change described in the notification with the user
action, the request, on the REST API.

So this patch proposes to extend the InstanceActionPayload
versioned object with a new request_id field and populate
the request_id from the context object used for emitting
the instance action notifications.

[1] https://etherpad.openstack.org/p/nova-ptg-rocky L391

Implements: bp add-request-id-to-instance-action-notifications

Change-Id: I7243b60938d6e9c7c2bc2aacdba5c667cca8ec9b
2018-04-19 13:06:59 -04:00
Béla Vancsics 67f1c98898 Transform live_migration.post.dest notifications
The following notifications has been transformed to
the versioned notification framework.

* live_migration.post.dest.start
* live_migration.post.dest.end

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I510136a7eb0a832dfe469cb68d06d1b9472d9ae4
Implements: bp versioned-notification-transformation-rocky
2018-03-13 11:19:44 +00:00
Zuul 62543e666c Merge "Transform instance.resize_prep notification" 2018-01-27 01:36:42 +00:00
Zuul 508a971bf8 Merge "Transform instance-evacuate notification" 2018-01-26 12:48:07 +00:00
Gábor Antal d775dd7066 Transform instance.resize_prep notification
The instance.resize_prep.start and instance.resize_prep.end
notifications are transformed to the versioned framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: If33d092e8688ed4d4864b2f7130104ab85ce1ea4
Implements: bp versioned-notification-transformation-queens
2018-01-25 09:30:50 +09:00
Alex Szarka 575fd9bbd2 Transform instance-evacuate notification
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: Ie1914b1f5f71c23dd441dafaea9e4261541d338d
Implements: bp versioned-notification-transformation-queens
2018-01-22 17:49:32 +09:00
Béla Vancsics 8ec0b43904 Transform instance.resize_confirm notification
The instance.resize_confirm.start and instance.resize_confirm.end
notifications are transformed to the versioned framework.

Change-Id: I6a51542216340299d250576714e303f74e0ceb0f
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Co-Authored-By: stewie925 <st3wty@att.com>
Co-Authored-By: MikeG451 <michael.glaser@att.com>
Implements: bp versioned-notification-transformation-queens
2018-01-18 08:01:10 +09:00
Béla Vancsics df7442ee5a Transform rescue/unrescue instance notifications
The rescue (instance.rescue.start and instance.rescue.end) and unrescue
(instance.unrescue.start and instance.unrescue.end) notifications are
transformed to the versioned framework.

This patch also fixes the power state of the server
when unrescuing it with the fake compute driver.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: Ib1d03c6d693e3b04886c638c956e35809fed8fc2
Implements: bp versioned-notification-transformation-queens
Closes-Bug: #1742133
2018-01-14 02:15:18 +00:00
stewie925 ac0745babd Transform instance.resize_revert notification
The instance.resize_revert.start and instance.resize_revert.end
notifications are transformed to the versioned framework.

Change-Id: Ia86c8804b284ed4ad72a1993c454ec373c063b99
Implements: bp versioned-notification-transformation-queens
2017-12-04 20:54:39 -05:00
Zuul 67849aed50 Merge "Fix the usage of instance.snapshot notification sample" 2017-11-23 13:06:18 +00:00
Zuul 491052995a Merge "Transform instance-live_migration_pre notification" 2017-11-23 12:47:43 +00:00
Béla Vancsics 2578a308e6 Transform instance-live_migration_pre notification
The instance.live_migration_pre.start and instance.live_migration_pre.end
notifications has been transformed to the versioned notification framework.

Co-Authored-By: Elod Illes <elod.illes@ericsson.com>
Change-Id: Ied6e9016e7406365c9d0beb281eeb31b7d0cf71b
Implements: bp versioned-notification-transformation-queens
2017-11-22 16:59:13 +01:00
Balazs Gibizer ff4f58fcd2 Fix the usage of instance.snapshot notification sample
The instance.snapshot.start and .end notification sample file was
attached to two different Notification ovo by mistake. This caused that
the samples are appeared in the notification dev-ref twice.

This patch removes the duplication and adds a simple check to the doc
generation code to detech such problems in the future.

Change-Id: I8478c134f9cdb08c02a44e1838dbacede5523914
Closes-Bug: #1732685
2017-11-21 11:03:52 +00:00
Zuul 3813a8ef63 Merge "Fix missing versioned notification sample" 2017-11-13 18:38:12 +00:00
Alex Szarka b4b61240f7 Transform instance-live_migration_abort notification
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: I27608f60dd5f8458e476286c6991c47dba7852b1
Implements: bp versioned-notification-transformation-queens
2017-11-06 16:05:16 +01:00
Takashi NATSUME 97eb866619 Fix missing versioned notification sample
Add the 'instance-interface_attach-error' notification sample
to the nova document.

Change-Id: Ife45fd30fd723675b45c7170e02358ab352e05e0
CLoses-Bug: #1728884
2017-11-06 05:51:58 +00:00
Béla Vancsics cfa4bfedbb Transform instance.trigger_crash_dump notification
Co-Authored-By: Balazs Gibizer <balazs.gibizer@ericsson.com>
Co-Authored-By: Gábor Antal <antal@inf.u-szeged.hu>
Change-Id: I10f120e4ff227f96d6c3fdd4a7123f13b84c4337
Implements: bp versioned-notification-transformation-queens
2017-10-20 18:40:54 +02:00
Jenkins 871c824328 Merge "Add snapshot id to the snapshot notifications" 2017-10-12 19:52:13 +00:00
Balazs Gibizer 581c537cf5 Add snapshot id to the snapshot notifications
The versioned instance.snapshot.start and .end notifications now
contain the id of the image that stores the instance snapshot.

Change-Id: I1c8c038078bbe1a5914a92d44b3e977287294a88
Implements: bp versioned-notification-transformation-queens
2017-10-12 09:13:13 +00:00
Balazs Gibizer ad33ae5771 use already loaded BDM in instance.create
In I18e7483ec9a484a660e1d306fdc0986e1d5f952b BDM was added to the instance
notifications. In general to add BDM to the payload an exta DB query is
needed. However the BDM is already locaded before the
notify_about_instance_create is called to send the notification. In this cases
loading the BDM again is unnecessary as the already loaded BDM can be reused.

This patch makes sure that notify_about_instance_create is called with the
already loaded BDM.

The remaining instance related versioned notification calls does not have
BDM already loaded.

Change-Id: Ic25de45c18348206f0309da6d4997f4bf336acb2
Closes-Bug: #1718226
2017-10-09 17:57:52 +02:00
Balazs Gibizer c4fadfd4d2 use already loaded BDM in instance.<action>
In I18e7483ec9a484a660e1d306fdc0986e1d5f952b BDM was added to the instance
notifications. In general to add BDM to the payload an exta DB query is
needed. However in some places the BDM is already separately before the
notify_about_instance_action is called to send the notification. In this cases
loading the BDM again is unnecessary as the already loaded BDM can be reused.

This patch makes sure that notify_about_instance_action is called with the
already loaded BDM. There will be subsequent patches to do the same with
other notify calls.

Change-Id: I391554d3904a5a60b921ef4714a1cfd0a64a25c2
Related-Bug: #1718226
2017-10-09 17:50:12 +02:00
Előd Illés 08599b0892 Add instance.interface_detach notification
Based on the following discussion:
http://lists.openstack.org/pipermail/openstack-dev/2017-September/121978.html

removeFixedIp action is deprecated, so instead of transforming its
notification, the instance.interface_detach versioned notification is
introduced.

Change-Id: Id4fa9eba59ef958ce514d9eb43346adf095b8b6e
Implements: blueprint versioned-notification-transformation-queens
2017-09-22 14:32:34 +02:00
Előd Illés 5a70f23ec5 Add instance.interface_attach notification
Based on the following discussion:
http://lists.openstack.org/pipermail/openstack-dev/2017-September/121978.html

addFixedIp action is deprecated, so instead of transforming the
instance.add_fixed_ip notification (https://review.openstack.org/#/c/332876),
instance.interface_attach versioned notification is introduced.

Change-Id: Id8d2c48c9c864554a917596e377d30515465fec1
Implements: bp versioned-notification-transformation-queens
2017-09-21 16:56:42 +02:00
Béla Vancsics 804dd877dc Transform instance.resize.error notifications
The instance.resize.error notification
is transformed to the versioned framework.

Change-Id: Ieb4ae4605fee8fbf58de4c5efb3c00083b4bd62c
Implements: bp versioned-notification-transformation-queens
2017-09-12 14:18:58 +00: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
Jenkins 24b275756e Merge "Transform instance.live_migration_rollback notification" 2017-06-26 18:26:24 +00:00
JinLi 53bcae7f69 Transform instance.soft_delete notifications
The instance.soft_delete.start and instance.soft_delete.end notifications
are transformed to the versioned framework.

Change-Id: I608b13f843a623f549b38459902aaff287254a95
Co-Authored-By: Jin Li <jl7351@att.com>
Implements: bp versioned-notification-transformation-pike
2017-06-20 11:07:16 +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
Balazs Gibizer 8548d3138b remove ugly local import
To avoid cyclic dependency a local import is introduced in
I1399d15285677aab4dd79704d21fbaf2bb5e1361 but it can be
removed with a small refactoring as proposed here.

The original get_nw_info_for_instance() is kept in nova.compute.utils
as a proxy to avoid changes in a lot of other source files. That
removal will be done in a subsequent patch.

Change-Id: I32231126483d419358acc40d353edd45af744a1f
2017-06-13 13:30:06 +02:00
Béla Vancsics ce893e37fa Transform instance.live_migration_rollback notification
Change-Id: Ic6cd58095cf5313325a7302a746467f57d0e0371
Implements: bp versioned-notification-transformation-pike
2017-06-08 21:03:33 +00:00