792 Commits

Author SHA1 Message Date
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
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
c6d7d92c93 Merge "Add microversion to support extra_specs in flavor API." 2018-04-13 22:47:15 +00:00
Yikun Jiang
0baba40b1b Add microversion to support extra_specs in flavor API.
Exposes flavor extra_specs in the flavor representation since
microversion 2.61. Now users can see the flavor extra-specs
in flavor APIs response only and do not need to call
``GET /flavors/{flavor_id}/extra_specs`` API.

Flavor extra_specs will be included in Response body of the
following APIs:

* ``GET /flavors/detail``
* ``GET /flavors/{flavor_id}``
* ``POST /flavors``
* ``PUT /flavors/{flavor_id}``

Part of blueprint add-extra-specs-to-flavor-list

Change-Id: I048747633babf690a63c6de9773bff5547872053
2018-04-11 17:47:57 +08:00
Takashi NATSUME
a77af0076f api-ref: Fix parameter order in rebuild
It is a follow-up for If01b2dcfa9df8c0e80ad1da65115204fe321891b.
The 'progress' parameter has been changed to an optional parameter
in If01b2dcfa9df8c0e80ad1da65115204fe321891b.
Optional parameters should be after required parameters.
So fix parameter order in rebuild action.

And fix 'adminPass' as well.

Change-Id: I38e0cdd73e9b81b5c4c8bd69c1139f99db3c7773
2018-04-11 00:34:14 +00:00
Takashi NATSUME
39fbcfd518 api-ref: Parameter verification for servers.inc (3/3)
This patch completes parameter verification for servers.inc.

* Verifies remaining parameters
* Sorts parameters
* Adds missing parameters
* Removing unncessary parameters

Change-Id: If01b2dcfa9df8c0e80ad1da65115204fe321891b
Closes-Bug: #1738930
2018-04-11 00:33:52 +00:00
Takashi NATSUME
bab3184ced api-ref: Parameter verification for servers.inc (2/3)
This patch verifies BDM, fault and scheduler hint parameters.
A subsequent patch will verify other parameters.

Change-Id: If57aa3e37ebaa6fa13718480bb216d10664aa5b1
Partial-Bug: #1738930
2018-04-11 00:33:40 +00:00
Zuul
14f8b542e6 Merge "api-ref: add a note about volume-backed rescue not being supported" 2018-04-04 03:57:02 +00:00
Matt Riedemann
2e96bd1c02 api-ref: add a note about volume-backed rescue not being supported
This adds the same note for volume-backed instances not being
supported for the server rescue action as exists for the createBackup
action.

Change-Id: If4ba24f2fe15f479c353d0ea69bf0f1454540ef0
2018-03-27 14:03:41 -04:00
Takashi NATSUME
56283f167d api-ref: Parameter verification for servers.inc (1/3)
This patch verifies query parameters.
Subsequent patches will verify other parameters.

Change-Id: I6078c0c8ebc888dc120f446f228a3b0433b89a76
Partial-Bug: #1738930
2018-03-27 17:06:45 +09:00
Zuul
cd15c3d6ec Merge "Fix api-ref: nova image-meta is deprecated from 2.39" 2018-03-26 16:18:37 +00:00
zhufl
244f1e0278 Fix api-ref: nova image-meta is deprecated from 2.39
https://developer.openstack.org/api-ref/compute/#create-image-metadata
says "These will fail with a 404 starting from microversion 2.36",
but https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id35
says "2.39 Deprecates image-metadata proxy API", the system's
actual behaviour is that image-metadata proxy API will fail
with 404 starting from microversion 2.39, so this is to
fix the api-ref.

Change-Id: I159e5de59a228fde6c7a0647d3726ad3025b67ed
2018-03-26 06:31:20 +00:00
Matt Riedemann
e0c43ac7a7 api-ref: add a note in DELETE /os-services about deleting computes
As seen in I2717274bb1bd370870acbf58c03dc59cee30cc5e, if an
operator deletes a nova-compute service via the API but fails
to stop the actual nova-compute process, the API will delete the
services table and compute_nodes table records, but the nova-compute
process will hit the 'update_available_resource' periodic task and
re-create the compute node record, which at that point is orphaned
since it does not have an associated nova-compute service.

Restarting the nova-compute service _should_ recreate the service
table record for that host and then the user could attempt to
delete the service and compute node record again via this API, but
it's better to not have to find this out the hard way.

So this change adds a simple reminder that the nova-compute process
on the host should be stopped before deleting the compute service.

While in here, the link to the install guide about the various
compute services is also fixed.

Change-Id: I68f2074814c3ae890888a5c75fd2870bb99f0e08
Related-Bug: #1646255
2018-03-16 13:54:26 -04:00
Zuul
31814746b0 Merge "Address nits in change I7e01f95d7173d9217f76e838b3ea71555151ef56" 2018-03-01 12:55:57 +00:00
Matt Riedemann
8e2000efc8 Clarify wording in listing instance actions for deleted instances
The ability to list instance actions for deleted servers was
added in the 2.21 microversion, so we should update the wording
to make that clear.

Change-Id: Ibf05d5bd2c70aa579bb2a688d4d5fa63278176d2
2018-02-26 10:31:52 -05:00
Zuul
1a762d00e2 Merge "Add server filters whitelist in server api-ref" 2018-02-02 02:02:52 +00:00
Zuul
19829aa2e2 Merge "api-ref: Fix parameter type in server-migrations.inc" 2018-01-30 23:02:33 +00:00
ghanshyam
f5cb62a1f4 Add server filters whitelist in server api-ref
We maintain the whitelist for valid server filters key
but have not documented those clearly.

This patch adds whitelist for non-admin and admin users.

Change-Id: Idc031916c804a18876551113a0fd57d4a463cd63
2018-01-30 09:24:46 +00:00
Zuul
988f86374d Merge "Fix 'all_tenants' & 'all_projects' type in api-ref" 2018-01-27 11:32:08 +00:00
gaofei
a9769a8488 Replace curly quotes with straight quotes
Sphinx's "smart quotes" feature will ensure these are replaced during
generation of docs.

Change-Id: I96412d86ac67c0dbaa0edb88815daa795e3cb1d8
2018-01-23 09:25:05 +00:00
ghanshyam
6a75cb2ef9 Fix 'all_tenants' & 'all_projects' type in api-ref
'all_tenants' and 'all_projects' are query param to
list the resources for all tenants/projects.

Checking of this query param in code is different in different APIs.
- GET /servers and /servers/detail API checks the value of 'all_tenants'
  strictly as boolean if there is one present.
- other APIs just checks the presence of it in req,
  like GET /os-server-groups, /os-fping

api-ref mentioned this param types as integer, boolean or string.

This commit make api-ref consistent to have type of this query param
as string.

Change-Id: I5297e6baa1e3d06adfc9d29d2bc56124119b9c8c
Closes-Bug: #1734427
2018-01-23 02:30:09 +00:00
Ildiko Vancsa
7e6ae9afd9 [api] Allow multi-attach in compute api
This change introduces a new microversion which must be used
to create a server from a multiattach volume or attach a multiattach
volume to an existing server instance.

Attaching a multiattach volume to a shelved offloaded instance is not
supported since an instance in that state does not have a compute host
so we can't tell if the compute would support the multiattach volume
or not. This is consistent with the tagged attach validation with 2.49.

When creating a server from a multiattach volume, we'll check to see
if all computes in all cells are upgraded to the point of even supporting
the compute side changes, otherwise the server create request fails with
a 409. We do this because we don't know which compute node the scheduler
will pick and we don't have any compute capability filtering in the
scheduler for multiattach volumes (that may be a future improvement).

Similarly, when attaching a multiattach volume to an existing instance,
if the compute isn't new enough to support multiattach or the virt
driver simply doesn't support the capability, a 409 response is returned.
Presumably, operators will use AZs/aggregates to organize which hosts
support multiattach if they have a mixed hypervisor deployment, or will
simply disable multiattach support via Cinder policy.

The unit tests are covering error conditions with the new flow. A new
functional scenario test is added for happy path testing of the new boot
from multiattach volume flow and attaching a multiattach volume to more
than one instance.

Tempest integration testing for multiattach is added in change
I80c20914c03d7371e798ca3567c37307a0d54aaa.

Devstack support for multiattach is added in change
I46b7eabf6a28f230666f6933a087f73cb4408348.

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

Implements: blueprint multi-attach-volume
Change-Id: I02120ef8767c3f9c9497bff67101e57e204ed6f4
2018-01-22 10:45:13 -05:00
Takashi NATSUME
312327b759 api-ref: Fix parameter type in server-migrations.inc
When the parameter is always 'null', it should be defined as 'none'.
So fix the parameter type of the 'force_complete'
in "Force Migration Complete Action" API.

And add an additional description for the action.

Change-Id: Ic0dd390a87d0d5a88d9a08fdaa9e59ee99f6e7c4
Closes-Bug: #1744688
2018-01-22 19:18:25 +09:00
Stephen Finucane
bcfd1eebe8 trivial: Remove crud from 'conf.py'
No need to have any of this here.

Change-Id: I87c291126bdb9bd3c45232e1041fd9355e953955
2018-01-18 10:39:24 +00:00
Stephen Finucane
62ea2ff04d Fix openstackdocstheme options for api-ref
Initialize the parameter for current openstackdocstheme so that report a
bug feature works and displays all parameter including git URL and SHA.

We need to add openstackdocstheme as extension so that the parameter are
properly initialized. html_context is not needed anymore. The display of
time of last commit is done by openstackdocstheme.

Change-Id: Ic46f5ff6bc42b48ce9de5f5bf3a2193ed75fb063
Closes-Bug: #1743728
2018-01-18 10:38:51 +00:00
Zuul
4258d743eb Merge "Do not attempt volume swap when guest is stopped/suspended" 2018-01-15 16:15:38 +00:00
Matt Riedemann
1b46015f23 Address nits in change I7e01f95d7173d9217f76e838b3ea71555151ef56
Change-Id: I687de92de0ff088e9f1e64223ce40d87443bf36f
2018-01-11 11:18:05 -05:00
Kevin_Zheng
92a0fc0b9f Add pagination and Changes-since filter support for os-migrations.
This patch adds pagination support and changes-since filter
for os-migrations API.

Users can now use 'limit' and 'marker' to perform paginate
query of running migrations list. Users can also filter the
results according to the migrations' updated time.

The ``GET /os-migrations`` and server migrations APIs will now
return a uuid value in addition to the migrations id in the response,
and the query parameter schema of the ``GET /os-migrations`` API no
longer allows additional properties.

Co-Authored-By: Yikun Jiang <yikunkero@gmail.com>

Implement: blueprint add-pagination-and-change-since-for-migration-list
Change-Id: I7e01f95d7173d9217f76e838b3ea71555151ef56
2018-01-10 14:02:53 -05:00
Takashi NATSUME
6f92e3906b api-ref: Fix incorrect parameter name
In os-instance-actions.inc,
the 'instance_actions_links' parameter should be 'links'
in the response of "GET /servers/{server_id}/os-instance-actions" API.

Change-Id: If333b6e063fe68c09706584890ae2753f1b7c84f
Closes-Bug: #1740107
2017-12-26 18:44:38 +09:00
Kevin_Zheng
0c480d795f Add pagination and changes-since for instance-actions
This patch adds pagination support and changes-since filter
for os-instance-actions API.

Users can now use 'limit' and 'marker' to perform paginate
query of instance action list. Users can also filter the
results according to the actions' updated time.

Co-Authored-By: Yikun Jiang <yikunkero@gmail.com>

Implement: blueprint pagination-add-changes-since-for-instance-action-list

Change-Id: I1a1b39803e8d0449f21d2ab5ef96d4060e638aa8
2017-12-14 07:42:17 +00:00
Zuul
29e453df8e Merge "Deprecate file injection" 2017-12-13 21:08:27 +00:00
Matt Riedemann
126c3d4c78 Deprecate file injection
This microversion makes the following changes:

1. Deprecates personality files from POST /servers and the rebuild
   server action APIs.
2. Adds the ability to pass new user_data to the rebuild server
   action API.
3. Personality / file injection related limits and quota resources
   are removed from the limits, os-quota-sets and os-quota-class-sets
   APIs.

Implements blueprint deprecate-file-injection

Change-Id: Ia89eeb6725459c35369e8f790f68ad9180bd3aba
2017-12-12 09:22:21 -05:00
Takashi NATSUME
35dd1f9185 api-ref: Fix a description for 'guest_format'
There is a wrong format 'ephemeral' in the description.
So remove it and valid formats ('ext2', 'ext3', 'ext4' and 'xfs')
are added.
The parameter is optional, so fix it as well.

Change-Id: Icc04cac3a287955ab1a98b7813e3c7ec8183b120
Closes-Bug: #1736502
2017-12-12 04:53:32 +00:00
Zuul
54f45b530c Merge "Enable cold migration with target host(2/2)" 2017-11-30 07:38:03 +00:00
Takashi NATSUME
d2ce4ca9ec Enable cold migration with target host(2/2)
This function enables users to specify a target host
when cold migrating a VM instance.

This patch modifies the migration API.

APIImpact
    Add an optional parameter 'host' in cold migration action.

Change-Id: Iee356c4dd097c846b6ca8617ead6a061300c83f8
Implements: blueprint cold-migration-with-target-queens
2017-11-29 20:48:16 -05:00
Zuul
ad2b8f0402 Merge "Add 'all_tenants' for GET sec group api ref" 2017-11-29 22:53:55 +00:00
ghanshyam
37987ee385 Add 'all_tenants' for GET sec group api ref
GET /os-security-groups API accept 'all_tenants' [1]
as one of the query param to list all tenants sec groups.
But that is missing in api-ref [2]

..1
e9104dbaef/nova/network/security_group/neutron_driver.py (L178)
e9104dbaef/nova/compute/api.py (L5096)

..2 https://developer.openstack.org/api-ref/compute/#list-security-groups

Closes-Bug: #1734406

Change-Id: I2946f05716c9030f7880ac423cc64b49c04b2992
2017-11-28 05:37:15 +00:00
Guoqiang Ding
66a44c95f1 Update the documentation links
The documentation about "ops-guide" has been moved.

Change-Id: I151d1f989cb032c3a3775e5bfffcec58a2cf0121
2017-11-28 11:07:36 +08:00
Zuul
1a289f1c02 Merge "api-ref: fix the type on the block_device_mapping_v2 parameter" 2017-11-23 00:07:30 +00:00
Zuul
497da9f90f Merge "api-ref: Fix an example in "Delete Assisted Volume Snapshot"" 2017-11-21 05:31:11 +00:00
Takashi NATSUME
5444e7ff3a api-ref: Add a description of 'key_name' in rebuild
In rebuild operation, users can unset the existing keypair
by setting 'key_name' to 'null' in a request body.
(The function has been added in
I23886a89c25f811cfbe7e2500ce7ff52f9162966).

But it is not described obviously in API reference.
So add an additional description in API reference.

Change-Id: I2d1b8eddd8555ad6896541b308895dc537686168
2017-11-21 02:00:51 +00:00
Takashi NATSUME
4f6005f787 api-ref: Fix an example in "Delete Assisted Volume Snapshot"
In "Delete Assisted Volume Snapshot",
there is an incorrect example in the description for
the 'delete_info' parameter.
So fix it.

Change-Id: I0b984bee06b0890d7705b9e47a5f975266b6a670
Closes-Bug: #1726254
2017-11-21 02:00:32 +00:00
Zuul
8fd4f9a029 Merge "api-ref: make a note about os:scheduler_hints being a top-level key" 2017-11-20 15:18:38 +00:00
Matt Riedemann
1f97f8399a api-ref: fix the type on the block_device_mapping_v2 parameter
The block_device_mapping_v2 parameter is a list of dicts, so
we need to fix the type in the api-ref description.

Change-Id: I099bd8adcfc57ae31010d68b5a5b46ffe68bac8d
2017-11-17 21:16:41 -05:00
Matt Riedemann
034d7f3795 Add microversion to allow setting flavor description
This adds the new microversion to allow providing
a description when creating a flavor, returning a
flavor description when showing flavor details, and
updating the description on an existing flavor.

Implements blueprint flavor-description

Change-Id: Ib16b0de82f9f9492f5cacf646dc3165a0849d75e
2017-11-15 22:10:39 +00:00
Matt Riedemann
26aefdfc0d api-ref: make a note about os:scheduler_hints being a top-level key
People get confused that os:scheduler_hints is not part of the
'server' portion of the POST /servers request body, it's actually
a separate top-level entry. This change makes a note of that in
the parameter description.

Change-Id: Id176c185dedcda970d1cd730267e2c5861b5b9c0
2017-11-14 13:26:56 -05:00
Zuul
691d99af63 Merge "block_device_mapping_v2.bus_type is missing from api-ref" 2017-11-14 12:37:01 +00:00
LIU Yulong
751f5dec11 Enable reset keypair while rebuilding instance
This patch adds `key_name` param to instance rebuild
API. Then the user could reset the instance keypair
when rebuilding. If set key_name to None, the API
will unset the keypair of the instance.

APIImpact

Implements blueprint: rebuild-keypair-reset

Change-Id: I23886a89c25f811cfbe7e2500ce7ff52f9162966
2017-11-13 10:49:02 +08:00
Kevin_Zheng
b6ed91d05c block_device_mapping_v2.bus_type is missing from api-ref
block_device_mapping_v2.bus_type is missing from
POST /servers API reference. This patch add it.

Change-Id: I998cf6195d72c80649e9e0fd43be0cf37f8e2f48
Closes-Bug: #1713895
2017-11-09 09:33:09 +08:00
Matt Riedemann
a6fcfb28ae api-ref: document caveats with scheduler hints
I noticed this while working on change
I49ffebcd129990f1835f404d98b51732a32171eb and I realized
the scheduler_hints in the legacy filter_properties
dict is a bit different than what's in the RequestSpec
object, namely that the request validation schema is
per-hint. Some require a single value, like 'group', and
some accept a list of values, like 'different_host'.

Given how nebulous scheduler hints are, we should probably
note these in the API reference for the parameter, especially
because scheduler hints should not be considered interoperable.

Change-Id: I74114fc56bee2bebf4a5f5d6823ec968cad9a8e9
2017-10-30 16:14:28 -04:00