Commit Graph

48215 Commits

Author SHA1 Message Date
Eric Fried
0a8f019be0 nova.utils.get_ksa_adapter()
Provide a new method:

nova.utils.get_ksa_adapter(service_type, ks_auth=None, ks_session=None,
                           min_version=None, max_version=None))

...to configure a keystoneauth1 Adapter for a service.  The Adapter, and
its component keystoneauth1 artifacts not passed into the method, are
loaded based on options in the conf group corresponding to the specified
service_type.

The ultimate goal is to replace the various disparate mechanisms used by
different services to do endpoint URL and version discovery.  In Queens,
the original mechanisms will still take precedence, but (other than
[glance]api_servers - see the spec) will be deprecated.  In Rocky, the
deprecated options will be removed.

This change incorporates the above utility into endpoint discovery for
glance and ironic.  Future change sets will do the same for other
services (cinder, neutron, placement).

Change-Id: If625411f40be0ba642baeb02950f568f43673655
Partial-Implements: bp use-ksa-adapter-for-endpoints
Closes-Bug: #1707860
2017-10-09 08:24:40 -05:00
Jenkins
d19feee6dd Merge "[placement] correct error on bad resource class in allocation" 2017-09-25 21:49:06 +00:00
Jenkins
29ef2474d9 Merge "Copy some tests to a cellsv1 mixin" 2017-09-25 17:15:42 +00:00
Jenkins
98fe520d96 Merge "Add _wait_for_action_fail_completion to InstanceHelperMixin" 2017-09-25 16:38:20 +00:00
Jenkins
bb06759031 Merge "Remove allocations when unshelve fails on host" 2017-09-25 16:38:00 +00:00
Jenkins
835e4806b6 Merge "Add recreate test for unshelve offloaded instance spawn fail" 2017-09-25 16:15:34 +00:00
Jenkins
9d33071722 Merge "Add functional migrate force_complete test" 2017-09-25 15:06:20 +00:00
Jenkins
45488dcd38 Merge "Add live.migration.force.complete to the legacy notification whitelist" 2017-09-25 15:05:55 +00:00
Jenkins
216214da2c Merge "Change livesnapshot to true by default" 2017-09-25 15:04:00 +00:00
Jenkins
7cd9e3b8bb Merge "Add some inline code docs tracing the cold migrate flow" 2017-09-25 13:52:31 +00:00
Jenkins
ef0f6341f4 Merge "Add PowerVM hypervisor configuration doc" 2017-09-25 12:25:02 +00:00
Jenkins
52c634bbc7 Merge "Add default configuration files to data_files" 2017-09-25 12:13:14 +00:00
Jenkins
6a5673a16f Merge "Add datapath type information to OVS vif objects" 2017-09-25 10:47:19 +00:00
Jenkins
936442347c Merge "Add get_instance_objects_sorted()" 2017-09-25 09:20:51 +00:00
Jenkins
3766c1da02 Merge "Make 'fault' a valid joined query field for Instance" 2017-09-25 09:16:41 +00:00
Jenkins
0e5b8a74c0 Merge "Cleanup unused get_iscsi_initiator." 2017-09-23 01:48:29 +00:00
Lajos Katona
633ebd1e9b Add functional migrate force_complete test
This patch adds test that checkes that the resource allocation is properly
handled during live migration force complete.

Co-Authored-By: Dan Smith <dms@danplanet.com>
Related-Bug: #1712045
Change-Id: If958e64eda1260a8dd08078de2dae167c6a147bc
2017-09-22 20:48:03 +00:00
Dan Smith
b7b60a758d Copy some tests to a cellsv1 mixin
This patch moves some tests to a cellsv1-specific mixin class ahead of
changing how the plumbing in compute api works. Since we will make a hard
cutover to the new instance query method for all non-CellsV1 code, we
pre-duplicate these tests in a mixin here so we can just fix the base test
class when we make that cut. This makes it easier to just gut cellsv1
later instead of having to remove in-test conditionals for cellsv1.

Change-Id: Idec35d2aab591e988dbd10efb513700ce71521e5
2017-09-22 13:30:11 -07:00
Dan Smith
1feb78f82b Add get_instance_objects_sorted()
This just wraps the new multi-db instance query method with one that
returns an InstanceList of Instance objects.

Change-Id: I249cddc9191053bcf324b5887a65a16bb64b7a88
2017-09-22 13:30:11 -07:00
Dan Smith
d7f32099d0 Make 'fault' a valid joined query field for Instance
This makes us pass fault through to the db layer if requested,
instead of always relying on upper layers doing the fault-filling
legacy behavior.

Change-Id: Ibb4e8d96fbb091b2fbfad4997df29e800e1717a9
2017-09-22 13:30:11 -07:00
Jenkins
fa8d2294c9 Merge "Add tests to validate instance_list handles faults correctly" 2017-09-22 20:09:51 +00:00
Jenkins
3268ddc557 Merge "enhance api-ref for os-server-external-events" 2017-09-22 18:53:35 +00:00
Jenkins
a09a59c070 Merge "Remove method "_get_host_ref_from_name"" 2017-09-22 18:52:56 +00:00
Jenkins
d7ef8ae92f Merge "Add a regression test for bug 1718455" 2017-09-22 18:43:49 +00:00
Jenkins
995d224d0f Merge "Add fault-filling into instance_get_all_by_filters_sort()" 2017-09-22 18:41:27 +00:00
Jenkins
a0a8a3f339 Merge "Fix 500 if list servers called with empty regex pattern" 2017-09-22 17:36:12 +00:00
Sean Dague
980d0fcd75 Change livesnapshot to true by default
Because of past qemu bugs we set this to default off and required a
workaround to enable it. However these issues appear to be fixed, and
we should enable this by default for people (with the ability to turn
it off if it's causing crashes in their environment). Metacloud/Cisco
has been running default this way the entire time without issue.

Change-Id: I4545cc99683d311c41c8d6d8dc9787ea6ec6cbc9
2017-09-22 12:37:58 -04:00
Jenkins
a6b1ca62c4 Merge "docs: Rename cellsv2_layout -> cellsv2-layout" 2017-09-22 16:28:11 +00:00
Stephen Finucane
2f36a355f2 docs: Rename cellsv2_layout -> cellsv2-layout
Underscores make for really ugly URLs and every other document here is
now using hyphens for this very reason. Let's try to keep that going.

Change-Id: I5c99ff6b04ee97bac210a0d6762015225775c5ee
2017-09-22 15:56:44 +01:00
Rodolfo Alonso Hernandez
ce8bf6734e Add datapath type information to OVS vif objects
Added a new parameter to vif objects for modelling the following
OVS port profiles:
  - VIFPortProfileOpenVSwitch
  - VIFPortProfileFPOpenVSwitch

This new parameter named "datapath_type" is a string
coerced variable. The posible values stored in this
field are defined in [1].

This information is required by ``os-vif`` to define or ensure
correctly the datapath type of the OVS bridge when plugging a
port to this bridge. Currently the datapath type is hardcoded
in ``os-vif`` and doesn't work with anything other than the kernel
OVS versions.

[1] https://github.com/openstack/neutron/blob/11.0.0/neutron/plugins/ml2/drivers/openvswitch/agent/common/constants.py#L129

Depends-On: Ia813c39e2917ff373f8e1f85c75fc22d109c94d3
Related-Bug: #1632372

Change-Id: I6194606498bff177d9856ed9f0c86ca0a4eef32f
2017-09-22 14:49:47 +00:00
Dinesh Bhor
0cc94bfd59 Fix 500 if list servers called with empty regex pattern
If nova list API is called with empty regex pattern like below:
    http://<host-ip>/compute/v2.1/servers?name=""

it fails at db layer and returns 500 InternalServerError.

Empty string('') is a valid regex for re.compile [1] so nova-api fails
to catch it at schema layer and it is passed to databse for searching.
Database fails to search it with "REGEXP %(display_name_1)s)" and
'display_name_1' as u'' in sql query which leads to below error:

InternalError: (1139, u"Got error 'empty (sub)expression' from regexp")

This issue is there for every query parameter which is using below
regex parameter types defined in parameter_types.py:
    common_query_regex_param

This patch fixes this issue by rejecting the request with 400 if the
provided filter regex is empty string. If user is intending to filter
something, user must pass something to the filter, it cannot be a empty
string.

[1] https://github.com/openstack/nova/blob/16.0.0/nova/api/validation/validators.py#L40

Closes-Bug: #1718877
Change-Id: I3f6fa04dc7267279964e8e5dd2a790b997a40e4e
2017-09-22 14:02:11 +00:00
Matt Riedemann
4763dd86bf Add _wait_for_action_fail_completion to InstanceHelperMixin
This moves two nearly identical utility methods into the
InstanceHelperMixin for waiting for an instance action failure
event.

Change-Id: Idc011a8aa4b1aa9b35e793913e43e9835d5d08f2
2017-09-22 09:42:44 -04:00
Matt Riedemann
f18202185d Remove allocations when unshelve fails on host
When we unshelve an offloaded instance, the scheduler
creates allocations in placement when picking a host.

If the unshelve fails on the host, due to either the
instance claim failing or the guest spawn failing, we
need to remove the allocations since the instance isn't
actually running on that host.

Change-Id: Id2c7b7b3b4abda8a3b878fdee6806bcfe096e12e
Closes-Bug: #1713796
2017-09-22 09:12:54 -04:00
OpenStack Proposal Bot
6d67451859 Updated from global requirements
Change-Id: I3f1bcd1916d50db1052b68b0b73e1c2b3503b66c
2017-09-22 12:57:31 +00:00
Jesse Pretorius
10c4bf888f Add default configuration files to data_files
In order to make it simpler to use the default
configuration files when deploying services
from source, the files are added to pbr's
data_files section so that the files are
included in the built wheels and therefore
deployed with the code. Packaging and deployment
tools can then more easily use the default files
if they wish to.

This pattern is already established with similar
files for neutron and the glance metadefs as has
been mentioned in the related bug report.

Change-Id: I66e6525338e06f289a20ff2cdc2d108ffd6d30b2
Closes-Bug: #1718356
2017-09-22 11:36:56 +00:00
Jenkins
902a374012 Merge "Support pagination in instance_list" 2017-09-22 06:20:13 +00:00
Jenkins
afa1f2a4bd Merge "Add db.instance_get_by_sort_filters()" 2017-09-22 02:17:51 +00:00
Jenkins
96cca48923 Merge "Make instance_list honor global query limit" 2017-09-22 00:38:12 +00:00
Jenkins
853989efd4 Merge "Add base implementation for efficient cross-cell instance listing" 2017-09-22 00:24:22 +00:00
chohoor
4cec53d74e Remove method "_get_host_ref_from_name"
"_get_host_ref_from_name" has never be called, so we need to
remove the method.

Change-Id: I6fdefaaa16cac24f35671d844793471b0882a824
2017-09-22 07:18:26 +08:00
Sylvain Bauza
016d3efa39 Add a regression test for bug 1718455
Moving an instance that was created concurrently by a multiple instances create
call no longer works in Pike because of a wrong RequestSpec field lookup.
Verifying that regression so the next change will fix it.

Change-Id: I26d1c90578b3dfb183bbf77ac758c2743dbced28
Related-Bug: #1718455
2017-09-21 23:18:06 +00:00
Matt Riedemann
56232e5de9 Add recreate test for unshelve offloaded instance spawn fail
This adds a functional test to recreate bug 1713796 where
allocations are not cleaned up from the compute node when
unshelving an offloaded server fails when spawning the
guest.

Change-Id: I3237ec954f6504513c8ef5a6ba43f57d0d2622a3
Related-Bug: #1713796
2017-09-21 19:11:31 -04:00
Jenkins
bed3b5136d Merge "Drop support for the Cinder v2 API" 2017-09-21 22:42:03 +00:00
esberglu
ba9f6a7dd7 Add PowerVM hypervisor configuration doc
This adds the hypervisor configuration documentation for using the
PowerVM nova compute driver.

Change-Id: Id96e8ac68d8d89d856f8defd2774aac3df2ccb34
2017-09-21 16:29:28 -05:00
Jenkins
52268672da Merge "api-ref: fix default sort key when listing servers" 2017-09-21 19:42:02 +00:00
Jenkins
c72d484881 Merge "Move libvirts dmcrypt support to privsep." 2017-09-21 19:41:29 +00:00
Jenkins
c40eb08f64 Merge "Transform servergroup.delete notification" 2017-09-21 19:41:01 +00:00
Jenkins
3cf375580d Merge "Transform servergroup.create notification" 2017-09-21 19:37:09 +00:00
Jenkins
adb1d8b4a5 Merge "Update docs to include standardization of VM diagnostics" 2017-09-21 17:57:32 +00:00
Jenkins
f211c9a9d9 Merge "neutron: handle binding:profile=None during migration" 2017-09-21 17:26:47 +00:00