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
This patch refactors the sample files of:
* instance-update
* instance-update-tags
notifications to use a common InstanceUpdatePayload sample data.
Change-Id: I8720556ed8a9ce7f1db165a793fbb7070954cc5a
The docs had three things wrong:
1. The server status would be VERIFY_RESIZE, not VERIFY_RESIZED.
2. The RESIZED value is on the OS-EXT-STS:vm_state field, not
vm_status.
3. The migration record status must be "finished", which is what
gets set on the migration record in the _finish_resize() method
in ComputeManager and used in the comptue API.confirm_resize()
method. "confirming" status is what the API sets the migration
record to before casting to nova-compute to finish the
confirmation.
Stepping back, this is too many conditionals for what is really
needed. So rather than fix all three items individually, this
change simply fixes the first one and removes the other two since
the 'status' is based on the 'vm_state' internally, and a non-admin
user cannot list migrations anyway, and the _finish_resize()
method sets the migration status *before* the vm_state.
Closes-Bug: #1764878
Change-Id: Ib751686880ee824cf0693a649f47c828f515b471
Removes a check that prevented compute from starting when config option
placement.[os_]region_name was not set. The check was not appropriate
since that option is not (otherwise) required. The check was originally
added to catch upgrades to Ocata, where placement (newly) needed to be
configured. Since we're well past that point now, the check is no longer
necessary.
Change-Id: I973180d6a384b32838ab61d4e6aaf73c255fd116
Closes-Bug: 1751692
Accept forbidden traits in the processing of extra_specs, with the
format of:
trait:CUSTOM_MAGIC=forbidden
This will be transformed into required=!CUSTOM_MAGIC when the traits
are assembled into a request to GET /allocation_candidates.
Implements blueprint forbidden-traits-in-nova
Change-Id: I31e609aef47d2fea03f279e4bfdd30f072d062b4
This patch refactors the sample files of:
* instance-soft_delete-start
* instance-soft_delete-end
* instance-suspend-start
* instance-suspend-end
* instance-trigger_crash_dump-start
* instance-trigger_crash_dump-end
notifications to use a common InstanceActionPayload sample data.
Change-Id: I8c31f44a3a3460e044ff73e0779a08ae49133f64
This patch refactors the sample files of:
* instance-live_migration_abort_start
* instance-live_migration_abort_end
* instance-shutdown-start
* instance-shutdown-end
notifications to use a common InstanceActionPayload sample data.
refactors the sample files:
* instance-snapshot-start
* instance-snapshot-end
notifications to use a common InstanceActionSnapshotPayload sample data.
Change-Id: I762b619c4410e3ff4a3660fc318832f81f523c05
This patch refactors the sample files of:
* instance-volume_attach-start
* instance-volume_attach-end
* instance-volume_attach-error
* instance-volume_detach-start
* instance-volume_detach-end
notifications to use a common InstanceActionVolumePayload sample data.
and refactor:
* instance-volume_swap-start
* instance-volume_swap-end
* instance-volume_swap-error
notifications to use a common InstanceActionVolumeSwapPayload sample data
Change-Id: I51fd194ac3b95be96db2676b4abf3df5a14d0faa
Since BFV instances don't have a specific image attached to them, the
filter will consider them as not having a specific image, hence not
isolated. Correcting the doc.
Change-Id: Ib235fca1365ee7a38b94600960ee3947f448c4a9
This was added in change I8c2f1a67 with the note:
===
We'll want to add claims around the logic of this method, so it's better
if there is a nested method that does the business logic to
avoid deep nesting that makes the code less readable.
===
AFAICT this logic was never added, and the indirection has always been
redundant.
Change-Id: Ie01f2c056a85e08a46c2461f1952cfdbaac3a547
Replace stubs.Set for the following methods with mock in
nova/tests/unit/api/openstack/compute/test_serversV21.py.
* nova.compute.api.API.get
* nova.compute.api.API.get_all
Subsequent patches will replace stubs.Set in test cases.
Change-Id: Ib0f55b40357cc714a9be9add76b0dc94169f1afc
Implements: blueprint mox-removal
At present the Libvirt driver can preallocate file based disks using the
fallocate command and importantly the `-n` option. This option allocates
blocks on the filesystem past the initial EOF of a given file:
```
$ touch test.img ; fallocate -n -l $(( 1024 * 1024 )) test.img
$ ll -lah test.img
-rw-rw-r--. 1 stack stack 0 Apr 16 13:28 test.img
$ du -h test.img
1.0M test.img
```
This results in a miscalculation of the total disk overcommit for file
based (excluding ploop) disks as os.path.getsize is currently used to
determine the allocated size of these disks:
```
>>> import os
>>> os.path.getsize('test.img')
0
```
Using the above example the disk overcommit would be reported as 1.0M as
the disk appears empty yet will report a potential (virtual) size of 1.0M.
However as the required blocks have already been allocated on the
filesystem the host will report disk_available_least as missing an
additional 1.0M, essentially doubling the allocation for each disk.
To correct this the allocated size of file based (excluding ploop) disks
is reported using `disk_size` from the `qemu-img info` command. This
should ensure blocks allocated past the EOF of the file are taken into
account and correctly reported as allocated.
A future change should ultimately remove the use of the `-n` option with
fallocate, however as this would not help disks that have already been
allocated this has not been included in this change to simplify backports.
Change-Id: If642e51a4e186833349a8e30b04224a3687f5594
Closes-bug: #1764489
This adds information to the "notification_format" config
option help and notifications docs on how to disable notifications.
While updating the config option help text, a stale reference
to Pike is removed.
Change-Id: I736025a0a88fc969831558805687b642da8cd365
Closes-Bug: #1761405
This patch refactors the sample files of:
* instance-shelve-start
* instance-shelve-end
* instance-shelve_offload-start
* instance-shelve_offload-end
* instance-unshelve-start
* instance-unshelve-end
notifications to use a common InstanceActionPayload sample data.
Change-Id: Ic64f89d33a985cf6121ddc198380902a5e936ec4
This patch refactors the sample files of:
* instance-resize-start
* instance-resize-end
* instance-resize-error
* instance-resize_finish-start
* instance-resize_finish-end
notifications to use a common InstanceActionPayload sample data.
Change-Id: I4b3728a18d604f07ebffe45eec457e47bba98b7e