Commit Graph

50653 Commits

Author SHA1 Message Date
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
Kevin_Zheng 586a18ab32 Deduplicate notification samples Rocky - 7
This patch refactors the sample files of:

* instance-update
* instance-update-tags

notifications to use a common InstanceUpdatePayload sample data.

Change-Id: I8720556ed8a9ce7f1db165a793fbb7070954cc5a
2018-04-19 20:33:17 +08:00
Zuul 324899c621 Merge "Fix docs for confirmResize action" 2018-04-18 15:41:35 +00:00
Matt Riedemann 203572a8ae Fix docs for confirmResize action
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
2018-04-18 13:09:27 +00:00
Zuul 619f7c23b3 Merge "Remove placement config check" 2018-04-18 04:56:54 +00:00
Zuul b86e5f6f82 Merge "Deduplicate notification samples Rocky - 6" 2018-04-18 01:45:16 +00:00
Zuul c4beb5c8b7 Merge "Deduplicate notification samples Rocky - 5" 2018-04-17 22:51:50 +00:00
Zuul f95c8c2ba5 Merge "Deduplicate notification samples Rocky - 4" 2018-04-17 22:51:42 +00:00
Zuul e45b9c98ce Merge "Remove redundant _do_check_can_live_migrate_destination" 2018-04-17 22:25:40 +00:00
Zuul f106094e96 Merge "libvirt: Report the allocated size of preallocated file based disks" 2018-04-17 21:16:42 +00:00
imacdonn b3c3f2fda8 Remove placement config check
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
2018-04-17 20:53:08 +00:00
Zuul 71ca8822ac Merge "Parse forbidden in extra_specs" 2018-04-17 20:50:15 +00:00
Zuul f66454c99c Merge "Remove mox in test_serversV21.py (1)" 2018-04-17 19:24:10 +00:00
Zuul 147b1f1d5c Merge "doc: BFV instances and IsolatedHostsFilter" 2018-04-17 18:41:19 +00:00
Zuul e1346ac8ca Merge "Deduplicate notification samples Rocky - 3" 2018-04-17 18:41:03 +00:00
Zuul b2e013a3a9 Merge "Deduplicate notification samples Rocky - 2" 2018-04-17 18:40:53 +00:00
Chris Dent 2c51688558 Parse forbidden in extra_specs
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
2018-04-17 18:18:43 +01:00
Kevin_Zheng a687748cec Deduplicate notification samples Rocky - 6
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
2018-04-17 18:57:34 +02:00
Kevin_Zheng fd025e591b Deduplicate notification samples Rocky - 5
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
2018-04-17 18:57:27 +02:00
Kevin_Zheng f9bb4dcb3a Deduplicate notification samples Rocky - 4
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
2018-04-17 18:56:54 +02:00
Zuul 1599464c71 Merge "Deduplicate notification samples Rocky - 1" 2018-04-17 16:17:10 +00:00
Zuul c0b476beab Merge "Transform aggregate.update_metadata notification" 2018-04-17 15:01:36 +00:00
Sylvain Bauza 1f2715f5e2 doc: BFV instances and IsolatedHostsFilter
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
2018-04-17 14:25:07 +00:00
Matthew Booth 01836132f5 Remove redundant _do_check_can_live_migrate_destination
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
2018-04-17 14:56:34 +01:00
Zuul 88adde8bba Merge "Document how to disable notifications" 2018-04-17 08:46:45 +00:00
Zuul 09af976016 Merge "remove ec2 in service and cmd" 2018-04-17 06:20:23 +00:00
Zuul 888cd51e42 Merge "Remove RequestContext.instance_lock_checked" 2018-04-16 23:55:27 +00:00
Takashi NATSUME 4e86736c58 Remove mox in test_serversV21.py (1)
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
2018-04-17 08:09:07 +09:00
Zuul ddd3495d8e Merge "List instances performace optimization" 2018-04-16 19:46:30 +00:00
Lee Yarwood 23bd8f6263 libvirt: Report the allocated size of preallocated file based disks
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
2018-04-16 20:33:42 +01:00
Zuul f0400313f3 Merge "Don't log a warning for InstanceNotFound with deleted VIFs" 2018-04-16 18:29:23 +00:00
Matt Riedemann 11528966ba Document how to disable notifications
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
2018-04-16 14:12:12 -04:00
Zuul fb0b785169 Merge "Add config drive link to api-guide" 2018-04-16 15:32:05 +00:00
jichen 92bce2558f Add config drive link to api-guide
link api-guide to doc of nova.
Removed the TODO.

Change-Id: Ib7b9453535b43e5c5cec6ee252a5790fc278f0c0
2018-04-16 11:36:27 +08:00
jichen e285070ec7 Fix doc link for api
doc link has an issue.
Trivial Fix

Change-Id: I949711ebfc51a09bbdc344fa0e242b924e66a29f
2018-04-16 11:14:16 +08:00
Kevin_Zheng 71ee33c124 Deduplicate notification samples Rocky - 3
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
2018-04-16 09:25:39 +08:00
Kevin_Zheng fda3cdeb5f Deduplicate notification samples Rocky - 2
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
2018-04-16 09:21:19 +08:00
Kevin_Zheng 414f5d4d67 Deduplicate notification samples Rocky - 1
This patch refactors the sample files of:

* instance-rebuild-start
* instance-rebuild-end
* instance-rebuild-error
* instance-restore-start
* instance-resotre-end
* instance-resume-start
* instance-resume-end

notifications to use a common InstanceActionPayload sample data.

Change-Id: I459c39a5dcb928ec3bb03fe144afa0f1ea82f95b
2018-04-16 09:19:43 +08:00
Zuul 35e9c2bccf Merge "Move xenapi partition copies to privsep." 2018-04-14 14:44:10 +00:00
Zuul 3bf1542b7d Merge "Sync xenapi and libvirt on what flags to pass e2fsck." 2018-04-14 02:23:01 +00:00
Zuul 0b0754c64c Merge "[placement] Support forbidden traits in API" 2018-04-14 00:48:44 +00:00
Zuul be50734bfd Merge "[placement] Filter allocation candidates by forbidden traits in db" 2018-04-14 00:48:27 +00:00
Zuul e7f63e15dd Merge "[placement] Filter resource providers by forbidden traits in db" 2018-04-14 00:48:04 +00:00
Zuul 930e089b80 Merge "[placement] Parse forbidden traits in query strings" 2018-04-14 00:47:50 +00:00
Zuul 5c2242be03 Merge "Address nits in Idf57fb5fbc611abb83943bd7e36d3cebf03b3977" 2018-04-14 00:47:20 +00:00
Zuul 877d868c12 Merge "Add host to API and Conductor" 2018-04-14 00:47:10 +00:00
Zuul 8d575360b7 Merge "Skip placement on rebuild in same host" 2018-04-13 22:47:45 +00:00
Zuul c6d7d92c93 Merge "Add microversion to support extra_specs in flavor API." 2018-04-13 22:47:15 +00:00
Zuul d2166ed072 Merge "Rename network.utils to network.linux_utils." 2018-04-13 22:47:05 +00:00
Zuul c76484de28 Merge "Add host field to InstanceActionEvent" 2018-04-13 18:51:45 +00:00