9578 Commits

Author SHA1 Message Date
Stephen Finucane
5734d078fc placement: adds REST API for nested providers
Adds a new microversion (1.14) to the placement REST API for supporting
nested resource providers.

For POST /resource_providers and PUT /resource_providers/{uuid}, a new
optional 'parent_provider_uuid' field is added to the request payload.

For GET /resource_providers/{uuid} responses, the
'parent_provider_uuid' field and a convenience field called
'root_provider_uuid' are provided.

For GET /resource_providers, a new '?in_tree=<rp_uuid>' parameter is
supported. This parameter accepts a UUID of a resource provider. This
will cause the resulting list of resource providers to be only the
providers within the same "provider tree" as the provider identified by
<rp_uuid>

Clients for the placement REST API can specify either
'OpenStack-API-Version: placement 1.14' or 'placement latest' to handle
the new 'parent_provider_uuid' attribute and to query for resource
providers in a provider tree.

Change-Id: I4db74e4dc682bc03df6ec94cd1c3a5f5dc927a7b
blueprint: nested-resource-providers
APIImpact
2017-12-06 10:48:09 -06:00
Zuul
6c043b7ea6 Merge "Updated from global requirements" 2017-12-06 10:49:23 +00:00
Zuul
7730395cdf Merge "[placement]Enhance doc for placement allocation list" 2017-12-05 13:32:38 +00:00
Zuul
f79aa34529 Merge "Add description for resource class creation" 2017-12-05 13:16:59 +00:00
Zuul
0b0dd6d1a1 Merge "Deprecate the IronicHostManager" 2017-12-05 13:16:45 +00:00
Zuul
a7e4c51faf Merge "Fix wrong argument order in functional test" 2017-12-05 13:01:10 +00:00
Zuul
2166231ce1 Merge "[placement] Add aggregate link note in API ref" 2017-12-05 11:31:03 +00:00
Zuul
fa17a2d949 Merge "Use ksa adapter for keystone conf & requests" 2017-12-05 10:29:18 +00:00
Zuul
51b88af252 Merge "Add regression test for rebuilding a volume-backed server" 2017-12-05 05:28:12 +00:00
OpenStack Proposal Bot
62ede10c78 Updated from global requirements
Change-Id: Ie061672ccc10a03040b12d9723704b9f93c095af
2017-12-05 03:19:38 +00:00
Zuul
dc0706dfb7 Merge "Updated from global requirements" 2017-12-05 02:52:42 +00:00
Takashi NATSUME
ad9933957f Fix wrong argument order in functional test
Fix the wrong order of mock arguments.
The mocks are not used in the test,
but fix it to privent mistakes in the future.

TrivialFix
Change-Id: Iad694b900180a310589483aeda46244a7fc5b408
2017-12-05 11:22:36 +09:00
Takashi NATSUME
af7149f926 [placement] Add aggregate link note in API ref
The aggregate link has been added in resource provider APIs
since microversion 1.1.
But the note is missing in Placement API reference.
Add the note.

The allocations link is missing in the response example
of "Update resource provider" API.
Add it as well.

Change-Id: I325ff34c8b436429c2a2623cf1fb16b368807d29
Closes-Bug: #1733317
2017-12-04 22:07:33 +00:00
Matt Riedemann
22cf178fd7 Add regression test for rebuilding a volume-backed server
Commit 984dd8ad6add4523d93c7ce5a666a32233e02e34 makes rebuild
check to see if the user is rebuilding an instance with a new
image and if so, to run the scheduler filters again since the
new image might not work with the current host for the instance,
and we rebuild to the same host that the instance is already
running on.

The problem is the instance.image_ref attribute is not set for
a volume-backed (boot-from-volume) instance, so the conditional
in the rebuild() method is always True, which means we always run
through the scheduler for volume-backed instances during rebuild,
even if the image in the root disk isn't changing.

This adds a functional regression test to recreate the bug.

Change-Id: If79c554b46c44a7f70f8367426e7da362d7234c8
Related-Bug: #1732947
2017-12-04 15:58:36 -05:00
OpenStack Proposal Bot
47b62fd423 Updated from global requirements
Change-Id: I8f3eb4fbd2df8f73385869057415cc7094bc489e
2017-12-03 21:25:02 +00:00
Zuul
78d87f0ddc Merge "[placement] set accept to application/json if accept not set" 2017-12-02 03:15:45 +00:00
jichenjc
39e8926484 Add description for resource class creation
POST /placement/resource_classes with incorrect format body
of the resource class name lead to something like:

JSON does not validate: u'_FPGA' does not match '^CUSTOM\\_[A-Z0-9_]+$'
with return code 400

we should add this into doc

Change-Id: Iab264f6d731a5f757a992d9bd148e7eb30922b9d
2017-12-02 01:24:37 +00:00
Zuul
863c13ef5c Merge "Remove old-style quotas code" 2017-12-01 02:53:17 +00:00
Zuul
2ebc3f79e3 Merge "[placement] Add 'CUSTOM_' prefix description in API ref" 2017-12-01 01:44:01 +00:00
Zuul
58d1dc0c9d Merge "[placement] Fix parameter order in placement API ref" 2017-12-01 01:42:27 +00:00
Zuul
610e7bf6cf Merge "[placement] Fix format in placement API ref" 2017-12-01 01:42:01 +00:00
Eric Fried
f40d35889c Use ksa adapter for keystone conf & requests
nova.api.openstack.identity.verify_project_id now uses the common
get_ksa_adapter utility to create an Adapter from common keystoneauth1
configuration options.  This is effectively identical to the prior
functionality, with the addition of support for Adapter conf options
such as `region_name` and `valid_interfaces` which should almost never
need to be overridden.

As part of blueprint use-ksa-adapter-for-endpoints, this provides a
consistent mechanism for endpoint communication from Nova.

Change-Id: I2204c8bed8936d5bed0f410284d2a563f84e7100
Partial-Implements: bp use-ksa-adapter-for-endpoints
2017-11-30 22:33:01 +00:00
jichenjc
0900f86b6d [placement]Enhance doc for placement allocation list
add a note about when the non-existing consumer id input result

Change-Id: I2a19d8fe8dda5754112361be5ceac8a0dc747ae9
2017-11-30 20:41:08 +00:00
melanie witt
d165ce00b1 Remove old-style quotas code
In Pike, we re-architected quotas to count resources for quota usage
instead of tracking it separately and stopped using reservations.
During an upgrade to Queens, old computes (Pike) will be using
new-style quotas and so the old-style quotas code is no longer needed.

Change-Id: Ie01ab1c3a1219f1d123f0ecedc66a00dfb2eb2c1
2017-11-30 16:13:20 +00:00
Takashi NATSUME
13c1a39567 [placement] Fix format in placement API ref
In "Delete traits" API of Placement API reference,
the format of response codes description is wrong.
"409 Conflict if the name to delete has associations with any"
is bold, but "ResourceProvider." is not.
So fix it.

TrivialFix
Change-Id: I963c350bfc339d4db769b0bfd6bba1087fa065e0
2017-11-30 08:36:40 +00:00
Zuul
0946a084e9 Merge "Remove deprecated TrustedFilter" 2017-11-29 20:05:26 +00:00
Zuul
d90cb2f333 Merge "placement: add nested resource providers" 2017-11-29 19:55:39 +00:00
OpenStack Proposal Bot
705729f3c7 Updated from global requirements
Change-Id: I3129f3c1b41a68d6c03d43f7bc1dba4a1d2b882d
2017-11-29 09:08:01 +00:00
Zuul
f847822354 Merge "Updated from global requirements" 2017-11-29 02:22:37 +00:00
OpenStack Proposal Bot
a1861e9e99 Updated from global requirements
Change-Id: Ie857878bbf063fa687cba2e745329c3fc9ae1f92
2017-11-28 23:07:37 +00:00
Jay Pipes
77ef172f65 placement: add nested resource providers
Adds initial support for storing the relationship between parent and
child resource providers. Nested resource providers are essential for
expressing certain types of resources -- in particular SR-IOV physical
functions and certain SR-IOV fully-programmable gate arrays. The
resources that these providers expose are of resource class
SRIOV_NET_VF and we will need a way of indicating that the physical
function providing these virtual function resources is tagged with
certain traits (representing vendor_id, product_id or the physical
network the PF is attached to).

The compute host is a resource provider which has an SR-IOV-enabled
physical function (NIC) as a child resource provider. The physical
function has an inventory containing some total amount of SRIOV_NET_VF
resources. These SRIOV_NET_VF resources are allocated to zero or more
consumers (instances) on the compute host.

                    compute host (parent resource provider)
                         |
                         |
                      SR-IOV PF  (child resource provider)
                         :
                        / \
                       /   \
                    VF1    VF2   (inventory of child provider)

The resource provider model gets two new fields:

 - root_provider_uuid: The "top" or "root" of the tree of nested
   providers
 - parent_provider_uuid: The immediate parent of the provider, or None
   if the provider is a root provider.

The database schema adds two new columns to the resource_providers
table that contain the internal integer IDs that correspond to the
user-facing UUID values:

 - root_provider_id
 - parent_provider_id

The root_provider_uuid field is non-nullable in the ResourceProvider
object definition, and this code includes an online data migration to
automatically populate the root_provider_id field with the value of the
resource_providers.id field for any resource providers already in the
DB.

The root_provider_id field value is populated automatically when a
provider is created. If the parent provider UUID is set, then the
root_provider_id is set to the root_provider_id value of the parent. If
parent is unset, root_provider_id is set to the value of the id
attribute of the provider being created. The corresponding UUID values
for root and parent provider are fetched in the queries that retrieves
resource provider data using two self-referential joins.

The root_provider_id column allows us to do extremely quick lookups of
an entire tree of providers without needing to perform any recursive
database queries.

Logic in this patch ensures that no resource provider can be deleted if
any of its children have any allocations active on them. We also check
to ensure that when created or updated, a resource provider's parent
provider UUID actually points to an existing provider.

It's important to point out that qualitative trait information is only
associated with a resource provider entity, not the resources that
resource provider has in its inventory. This is the reason why nested
resource providers are necessary. In the case of things like NUMA nodes
or SRIOV physical functions, if a compute host had multiple SRIOV
physical functions, each associated with a different network trait,
there would be no way to differentiate between the SRIOV_NET_VF
resources that those multiple SRIOV physical functions provided if the
containing compute host had a single inventory item containing the
total number of VFs exposed by both PFs.

Change-Id: I2d8df57f77a03cde898d9ec792c5d59b75f61204
blueprint: nested-resource-providers
Co-Authored-By: Moshe Levi <moshele@mellanox.com>
2017-11-28 15:29:28 -05:00
Matt Riedemann
aa19ae204c Deprecate the IronicHostManager
The use_baremetal_filters and baremetal_enabled_filters options
along with the ExactRamFilter, ExactCoreFilter and ExactDiskFilter
filters were all deprecated in Pike:

  I843353427c90142a366ae9ca63ee4298b4f3ecd4

The IronicHostManager is configurable and relies on those options,
so if those options are deprecated then the IronicHostManager should
also be deprecated.

The sticky part with this is going to be filters that don't work with
ironic nodes today, like the NUMATopologyFilter, so a note is left
in the use_baremetal_filters option code to remind us that we can't
likely remove any of this until all filters work with ironic nodes.

Change-Id: Iebc74a09990dcda8cf0ee2a41f9ae1058d2a182a
2017-11-28 15:23:48 -05:00
zhangyangyang
f01cd1c1e0 Remove deprecated TrustedFilter
The TrustedFilter and the related trusted_computing config options
were deprecated in Pike:

  If6e53feeb97e6050c1eb7962110ed89504c952fc

Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>

Change-Id: I0a7ab3a4fb2cfad567a8644bed4de574393ee11a
2017-11-28 14:54:31 -05:00
Zuul
beb17c6b5c Merge "[placement] Clean up TODOs in allocations.yaml gabbit" 2017-11-28 19:09:07 +00:00
Zuul
fcd71f6798 Merge "[placement] Fix GET PUT /allocations nits" 2017-11-28 19:01:43 +00:00
Zuul
19ae741b0e Merge "[placement] POST /allocations to set allocations for >1 consumers" 2017-11-28 19:01:37 +00:00
Zuul
8eed30f01d Merge "Don't overwrite binding-profile" 2017-11-28 15:45:49 +00:00
Zuul
58df9def2e Merge "Update document related to host aggregate" 2017-11-28 15:26:28 +00:00
Chris Dent
18e6a44f9d [placement] Fix GET PUT /allocations nits
In the review of I49f5680c15413bce27f2abba68b699f3ea95dcdc, a few
non-blocking nits were identified. This change addresses some of
those nits, fixing some typos, clarifying method names and what
microversion is in use at particular times.

Change-Id: Iff15340502ce43eba3b98db26aa0652b1da24504
2017-11-28 12:25:13 +00:00
Chris Dent
a51f5b0d4d [placement] POST /allocations to set allocations for >1 consumers
This provides microversion 1.13 of the placement API, giving the
ability to POST to /allocations to set (or clear) allocations for
more than one consumer uuid.

It builds on the recent work to support a dict-based JSON format
when doing a PUT to /allocations/{consumer_uuid}.

Being able to set allocations for multiple consumers in one request
helps to address race conditions when cleaning up allocations during
move operations in nova.

Clearing allocations is done by setting the 'allocations' key for a
specific consumer to an empty dict.

Updates to placement-api-ref, rest version history and a reno are
included.

Change-Id: I239f33841bb9fcd92b406f979674ae8c5f8d57e3
Implements: bp post-allocations
2017-11-28 12:15:53 +00:00
Zuul
07389edc7e Merge "[placement] Symmetric GET and PUT /allocations/{consumer_uuid}" 2017-11-28 11:09:03 +00:00
Zuul
60bc74dbe6 Merge "Refined fix for validating image on rebuild" 2017-11-28 03:48:43 +00:00
Zuul
d743253bd6 Merge "Updated from global requirements" 2017-11-27 20:57:50 +00:00
Dan Smith
c93f0bba6b Refined fix for validating image on rebuild
This aims to fix the issue described in bug 1664931 where a rebuild
fails to validate the existing host with the scheduler when a new
image is provided. The previous attempt to do this could cause rebuilds
to fail unnecessarily because we ran _all_ of the filters during a
rebuild, which could cause usage/resource filters to prevent an otherwise
valid rebuild from succeeding.

This aims to classify filters as useful for rebuild or not, and only apply
the former during a rebuild scheduler check. We do this by using an internal
scheduler hint, indicating our intent. This should (a) filter out
all hosts other than the one we're running on and (b) be detectable by
the filtering infrastructure as an internally-generated scheduling request
in order to trigger the correct filtering behavior.

Closes-Bug: #1664931
Change-Id: I1a46ef1503be2febcd20f4594f44344d05525446
2017-11-27 15:52:45 -05:00
OpenStack Proposal Bot
a6172036a5 Updated from global requirements
Change-Id: I8c54e6fa64d89f99ff19e1cfc3530e9c3ec25d0f
2017-11-25 18:22:04 +00:00
Zuul
d92ee548ee Merge "Add migration_get_by_uuid in db api." 2017-11-24 18:25:11 +00:00
Takashi NATSUME
a7c5c06fc1 [placement] Add 'CUSTOM_' prefix description in API ref
In the following resource class APIs,
the name of a resource class must start with 'CUSTOM_'.
If not, the request returns a 'Bad Request (400)' response code.
It should be described in the API reference. So add it.

* POST /resource_classes
* PUT /resource_classes/{name}

Change-Id: I132c532678bb74a460515067187fbf1e30885335
Closes-Bug: #1733308
2017-11-23 21:01:10 +00:00
Takashi NATSUME
74bb0f7453 [placement] Fix parameter order in placement API ref
Optional parameters should be after required paramenters.
Parameters added in microversions should be after
original parameters.
So fix them.

Change-Id: I5e3f5df5601d3747debed273e09a8b9b18046a96
Closes-Bug: #1728557
2017-11-23 21:01:07 +00:00
Moshe Levi
e40f78bf09 Don't overwrite binding-profile
Currently when providing existing direct port, nova-compute
will overwrite the binding-profile information with pci_vendor_info
and pci_slot. The binding-profile will be used to request
NIC capabilities for SR-IOV ports [1]. This also allows to distinguish
which neutron mechanism driver will bind the port [2].

This patch updates the behaviour that on update port it will update,
rather than overwrite, the binding-profile information with
pci_vendor_info and pci_slot. And on unbind port it will remove
only the pci_vendor_info and pci_slot from the port binding-profile
rather than unsetting the entire field.

[1] https://review.openstack.org/#/c/435954/
[2] https://review.openstack.org/#/c/499203/

Closes-Bug: #1719327

Change-Id: Id847949b4761d51a14e5c2f39552f60a47889aa9
2017-11-22 04:30:51 +00:00
Zuul
e92593ba13 Merge "Update bindep.txt for doc builds" 2017-11-22 03:44:14 +00:00