50680 Commits

Author SHA1 Message Date
Chris Dent
6efbed5e70 Fix link in placement contributor doc
A todo in the contributor/placement.rst slipped through the review
cracks and meant a bad link to 'link to spec once it merges' is in the
docs. This fixes it with the correct link to the spec.

Change-Id: I13daf9576dcb1229409826b4c4eac28c8bb1e23f
2018-04-20 12:27:40 +01:00
Zuul
8a407bd288 Merge "Block deleting compute services which are hosting instances" 2018-04-20 05:55:36 +00:00
Zuul
d274aeb6eb Merge "Add functional test for deleting a compute service" 2018-04-20 05:46:53 +00:00
Zuul
e3a9efab86 Merge "Add hide_hypervisor_id flavor extra_spec" 2018-04-20 05:21:38 +00:00
Zuul
5d87443c2d Merge "fix a typo" 2018-04-20 05:21:20 +00:00
Zuul
d079d26444 Merge "Log a warning and add nova-status check for old API service versions" 2018-04-20 05:21:00 +00:00
Zuul
43bbef900b Merge "Update os_compute_api:os-flavor-extra-specs:index docs for 2.47" 2018-04-20 05:20:51 +00:00
Zuul
7c27ced834 Merge "Remove mox in test_serversV21.py (2)" 2018-04-20 05:20:39 +00:00
Zuul
31c4c42bf9 Merge "Move update_task_state out of try/except" 2018-04-20 01:57:47 +00:00
Zuul
b1dcfd8159 Merge "Provide framework for setting placement error codes" 2018-04-20 00:33:21 +00:00
Zuul
5d54f5a866 Merge "Improve check capacity sql" 2018-04-19 23:59:39 +00:00
Zuul
1622e23d20 Merge "xenapi: Use XAPI pool instead of aggregate pool for shared SR migration" 2018-04-19 23:28:14 +00:00
Konstantinos Samaras-Tsakiris
edf67cfda2 Add hide_hypervisor_id flavor extra_spec
Blueprint add-kvm-hidden-feature added the capability of hiding the kvm
signature from guests. However, it was implemented only through an image
property.

A major reason for this feature is to allow passed-through Nvidia GPUs
to work correctly. GPU pci-passthrough is specified on the flavor's
extra_specs, without requiring an image with special properties.
Therefore, hiding the KVM signature should also be specifiable through
the flavor's extra_specs, in order to not require a special image for
this use case.

If the new flavor extra_spec is present and set to 'true', the libvirt
driver will produce an additional element to hide kvm's signature on
the vm, in the same way as with the image property
`img_hide_hypervisor_id`.

Implements: blueprint hide-hypervisor-id-flavor-extra-spec
Closes-Bug: 1757424
Change-Id: I41c5913b4148629b448ea5fb43b7597dc067dc22
2018-04-19 22:36:26 +00:00
wangqi
3827b8f450 fix a typo
Change-Id: I50b4dd5e2303355734111924eefc28ce27443067
2018-04-19 21:15:57 +00:00
Zuul
5cba8063c2 Merge "Use Queens UCA for nova-multiattach job" 2018-04-19 20:34:24 +00:00
Zuul
0e48e7b1d2 Merge "Deduplicate notification samples Rocky - 7" 2018-04-19 15:58:23 +00:00
leizhang
7c01dd1a65 Improve check capacity sql
During a benchmark on allocation creation, I found checking allocations
capacity occupied a great amount of time when allocation table is fairly
big. Add a check on resource provider id to reduce allocation records to
be joined with resource providers and inventories.

Change-Id: Ic36809fa7161c2aa07a42669b44046993e5db058
2018-04-19 21:10:55 +08: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
318d353d64 Merge "conf: Remove deprecated 'multi_instance_display_name_template' opt" 2018-04-19 08:31:52 +00:00
naichuans
9b7affcac1 xenapi: Use XAPI pool instead of aggregate pool for shared SR migration
xenapi is going to support pool-based multi-hosts OpenStack
environments, this patch is used to remove dependency to the
old aggregate-based-pools and add support to xenapi pool.
Also include unit test changes.
Updated configuring migrations document:
https://docs.openstack.org/nova/latest/admin/configuring-
migrations.html#configuring-migrations-xenserver-shared-storage
Other related documents will be updated in another patch.

Implements: blueprint live-migration-in-xapi-pool
Change-Id: I2c492c46e85c1df96aa7fdc12cdee0b1c7ba775e
2018-04-19 05:50:31 +00:00
Matt Riedemann
42f62f1ed2 Block deleting compute services which are hosting instances
This change makes "DELETE /os-services/{service_id}" fail
with a 409 response when attempting to delete a nova-compute
service which is still hosting instances.

Deleting a compute service also results in deleting the
related compute_nodes table entry for that service host.
The compute node resource provider in placement is tied
to the compute node via the UUID, and if we allow deleting
the compute service and node then the resource provider for
that node is effectively orphaned in Placement, along with
the instances which have allocations against that resource
provider.

Furthermore, restarting the compute service will create a
new service and compute_nodes record, and the compute node
would have a new UUID and resource provider. This will
affect scheduling for that host since Placement will be
reporting it as having available capacity which in reality
is not accurate.

A release note is included for the (justified) behavior
change in the API. A new microversion should not be required
for this since admins should not have to opt out of broken
behavior. Since this API did not previously expect to return
a 409 response, the "expected_errors" decorator is updated
and again, should not require a microversion per the
guidelines:

https://docs.openstack.org/nova/latest/contributor/microversions.html#when-a-microversion-is-not-needed

Change-Id: I0bd63b655ad3d3d39af8d15c781ce0a45efc8e3a
Closes-Bug: #1763183
2018-04-18 19:16:00 -04:00
Matt Riedemann
a80ac96362 Add functional test for deleting a compute service
This adds a functional test which asserts the things
related to bug 1756179 where deleting a compute service
does not also delete the related host mapping or resource
provider resources.

Also related to bug 1763183 in that it should not be
possible to delete a compute service that has instances
running on it since that will mess up resource tracking
in Placement.

Change-Id: I519c5abfe24b154998f481c8a86db239a75d4729
Related-Bug: #1756179
Related-Bug: #1763183
2018-04-18 19:15:50 -04: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
5cece4287b Remove mox in test_serversV21.py (2)
Replace stubs.Set with mock in
nova/tests/unit/api/openstack/compute/test_serversV21.py.

This patch completes stopping using mox in the file.

Change-Id: I0a1f3392cef358afe413bacd1eb1fd2199618f14
Implements: blueprint mox-removal
2018-04-16 23:12:33 +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