Use https instead of http to ensure the safety without containing our
account/password information
Change-Id: Iff85d63353b858e0df28bf2e2c9557e6737b7aba
The 'discoverable' policy is not documented as it will be removed in a
future change.
blueprint policy-docs
Change-Id: If69440c4a792c7810e148312e8f3b8d788b496cd
Some callers of instance_get_all_by_host are passing
in columns_to_join=[], like the _sync_scheduler_instance_info
periodic task in the compute manager, to avoid unnecessary
joins with other tables.
The problem was columns_to_join wasn't being passed through
to _instance_get_all_query which builds the actual query
method, and defaults to join on info_cache and security_groups.
This fixes the problem by passing through columns_to_join and
provides tests to show it working both with and without the joins.
Change-Id: I69f2ddca8fb0935e03b0f426891d01360940a85a
Closes-Bug: #1680616
This test was not testing instance_get_all_by_host,
it was testing _instance_get_all_uuids_by_host,
which is completely redundant with the same test
that comes right after it.
¯\_(ツ)_/¯
Change-Id: Ia0331e3f622f17067bf5900f92b3f8ff2aff966e
Closes-Bug: #1680614
This patch remove the stevedore extension point for server
create.
This patch move all the extension points into ServersController
class attribute 'server_create_func_list'. This is for
backward-compatible with the stevedore extension interface.
The final goal is that merging all of those extended code into
the ServerController. So this is a middle step for refactor.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: I9a8f56037b35e89543626922221b910ab8b1917e
To get rid of all of stevedore extension point. The
jsons-chema extension point of server create should be
removed. This patch moves all of extended json-schema into
ServerControoler's class attributes 'schema_func_list'.
But the final goal is that merging all of those extended
json-schema into server's main json-schema. So this is a
middle step for all of those refactor for removing stevedore.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: Id8ba6a0383cf236259224ace2df3c3d89f82f27d
The Nova API doesn't support extension anymore. There is no way
to disable any API in the Nova now. So the check for 'os-networks'
is useless now, also as the 'os-networks' is always enabled now,
the check for neutron is useless also.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: I393ca6e91d3bd5b4799386db641366e9e4c3a171
The server_groups API currently queries whole instance objects to
determine which of the group members are not deleted. This hits the
cell database and also grabs a ton of data. This patch makes it use
the newly-minted InstanceMappingList to draw the same conclusion,
which is both more effcient and does not require teaching it about
multiple cells.
Related to blueprint cells-aware-api
Change-Id: If571f9e7c9d0ef6265a249ff808d30a24ab462af
This provides a bulk lookup for things that need it, such as the
server_groups api module.
Related to blueprint cells-aware-api
Change-Id: I8bd5c9611b7ba076116aac50f4c9bfea6fb41034
We added this to make sure that we were compatible with Mitaka computes
when get-me-a-network was added in Newton. That compatibility is no
longer a concern in Pike. Remove the check, which would otherwise need
to be multi-cell-ified.
Related to blueprint cells-aware-api
Change-Id: I3168616b7878915c0c33286cd5629e8d01366de3
This makes the HostAPI module know enough about cells to support
the os-hypervisors, os-services, and several other API modules that
deal with hosts and services.
Note that this introduces a conflict where duplicate-id resources could
be returned from the API because they are in different DBs with different
key namespaces. For now, we return an error in the delete case where an
ambiguous result could cause us to delete the wrong service. This is
a fundamental problem across several of our APIs and is being worked as
a separate improvement.
Related to blueprint cells-aware-api
Change-Id: If1e03c9343b8cc9c34bd51c2b4d25acdb21131ff
This extends the previous patch to target cells during compute node
discovery to also target cells when fetching information about
instances prior to scheduling.
Change-Id: Idb9b969620c24f2b83f3205f95a9aab9daa28513
Previously, the 'type' of the hypervisor network device, was exposed to
the guest directly. That does not make sense, as
a.) this leaks needless information into the guest
b.) the guest cannot be reasonably expected to make decisions
based on a type of link that is present underneath the
virtual device that is presented to the guest.
c.) guests then are forced to either continuously track these types
or to assume that unknown type is "phy".
This limits the exposure of types to a specific list. Any other
type will be shown to the guest as 'phy'.
Change-Id: Iea458fba29596cd2773d8d3565451af60b02bcca
Closes-Bug: #1642679
Change fe3d6dba3d1db8f97dab4baffcc11dda56368096 removed the
ability to specify a full classpath to load up your own
scheduler driver. After that point stevedore extensions had
to be used from setup.cfg.
Change 6832a417c93046750ec7eff51eb59be802fd70dc encoded the
supported in-tree scheduler driver options by using the
"choices" kwarg with the scheduler.driver option. This means
if you specify something not in that list, you get a ValueError.
So the part in the help text about registering your own
stevedore extension is a lie since it would still fail because
of "choices".
Change-Id: I60ce26f7370b71b2dc266d582d9b17d35e8cd9c1
We plan to allow PUT requests to create/update both custom traits
and custom resource classes, without bodies. Prior to this change,
the code would not all a PUT, POST or PATCH to not have a body. This was
added in I6e7dffb5dc5f0cdc78a57e8df3ae9952c55163ae which was fixing an
issue with how webob handles exceptions.
This change does two things:
* It address the problem from bug #1623517, fixed in the change id'd
above, in a more narrow fashion, making sure the data source that
causes the KeyError is non-empty right before it is used. This allows
simplifying the following change.
* If a request has a content-length (indicating the presence of a body),
verify that there is also a content-type. If not, raise a 400.
basic-http.yaml has been change to modify one gabbi test to check a
response body is correct and to add another test to confirm that the
code that is doing the content-length check is passed through.
Change-Id: Ifb7446fd02ba3e54bbe2676dfd38e5dfecd15f98
Closes-Bug: #1674392
Related-Bug: #1623517
The config opts of extension black/white list 'extensions_blacklist'
and 'extensions_whitelist' are deprecated for a long time. It's time
to remove it.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: Ide8c302619825c7b41ee52baa7128c5bb2341aa4
The Nova API doesn't support the extension anymore. The API
unittest shouldn't disable any part of Nova API. This patch
removes the tests which disable part of API in scheduler hints.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: I90544eb3fa51a6cf6347ea4bcecee92c837f7888
These were originally added in Newton for get-me-a-network
but are now used for other purposes, like cells v2 and volume
reservations in Pike:
63805735c25a54ad1b9b97e05080c1a6153d8e22
This change just makes the wording more generic and removes
a TODO about removing the cache in Ocata, which is no longer
applicable.
Change-Id: I9cabe075c70424b167f5e340d05d28fa18f7d276
This wasn't walking the correct directory and it wasn't
including the API database migrations.
Change-Id: Idff0e8089faf4025a080a5842ff65eaad7b6fdb8
Closes-Bug: #1680240
This fixes a regression from some local delete code added for cells v2
where it assumed that if an instance did not have a host, it wasn't
scheduled to a cell yet. That assumption misses the fact that the
instance won't have a host if it was shelved offloaded. And to be
shelved offloaded, the instance had to have first been built on a host
in a cell.
So we simply duplicate the same check as later in the _delete() method
for instance.host or shelved-offloaded to decide what the case is.
Obviously this is all a giant mess of duplicate delete path code that
needs to be unwound, and that's the plan, but first we're fixing
regressions and then we can start rolling this duplication all back
so we can get back to the single local delete flow that we know and love.
Change-Id: Ie2063f621618c1d90aeb59f0f1d7da351862ea9f
Closes-Bug: #1678326
Once an instance is in a cell and we do a local delete from
the API, we aren't actually detaching volumes and destroying
BDMs.
Related-Bug: #1675570
Change-Id: Ie3e2dfd4b0f1bb3dff4080f460bf8bb40d69f4f4
This is needed for an upcoming change which introduces
a functional test which shelves a server. Shelving a server
creates a snapshot image and in the real world, glance sets
the size and status attributes on the image when it's created
in glance. Our FakeImageService wasn't doing that, so tests
that are running at the same time with the same fake noauth
credentials are listing images and picking up the shelve
snapshot image which doesn't have size or status set and
that produces a KeyError in the API code.
Change-Id: I70d1505c915e80156aaa4d27a7d47e437b40b6f1
This fixes a regression in Ocata where we were always
decrementing quota usage during instance delete even
if we failed to delete the instance. Now the reservation
is properly committed after the instance is destroyed.
The related functional test is updated to show this working
correctly now.
Change-Id: I5200e72c195e12b5a069cbae3f209492ed569fb4
Closes-Bug: #1678326
This was spotted from someone validating the fix for
bug 1670627. They reported that even though they failed
to delete an instance in ERROR state that was in cell0,
the quota usage was decremented.
This is because we committed the quota reservation
to decrement the usage before actually attempting to destroy
the instance, rather than upon successful deletion.
The rollback after InstanceNotFound is a noop because of
how the Quotas.rollback method noops if the reservations
were already committed. That is in itself arguably a bug,
but not fixed here, especially since the counting quotas
work in Pike will remove all of the reservations commit and
rollback code.
Change-Id: I12d1fa1a10f9014863123ac9cc3c63ddfb48378e
Partial-Bug: #1678326
When we're going down the local delete path for cells v2 in the API
and instance.destroy() fails with an InstanceNotFound error, we are
racing with a concurrent delete request and know that the instance
is alread deleted, so we can just return rather than fall through to
the rest of the code in the _delete() method, like for BDMs and
console tokens.
Change-Id: I58690a25044d2804573451983323dde05be9e5d6
Closes-Bug: #1680211
With cells v2, we need to be clear about what is cells v1 and
what is cells v2 in our documentation. This makes a note in the
os-cells api-ref about that being for cells v1 and also adds a
line saying the entire API is admin-only by default.
Change-Id: I2a06e2c4921ce7172aab33818054dd37b5ef9a65
The 'discoverable' policy is not documented as it will be removed in a
future change.
blueprint policy-docs
Change-Id: I751cbde145ed486cd47e2ea6ff66d41914f0552b
The Nova API doesn't support the extension anymore. The API
unittest shouldn't disable any part of Nova API. This patch
removes the tests which disable part of API in user data
unittests.
Partial-implement-blueprint api-no-more-extensions-pike
Change-Id: I7f9721d67aa978699c3d34dc36ade1288adf0667