72 Commits

Author SHA1 Message Date
Dan Smith
45c5b80fd0 Add API support for rebuilding BFV instances
This adds a microversion and API support for triggering a rebuild
of volume-backed instances by leveraging cinder functionality to
do so.

Implements: blueprint volume-backed-server-rebuild
Closes-Bug: #1482040

Co-Authored-By: Rajat Dhasmana <rajatdhasmana@gmail.com>

Change-Id: I211ad6b8aa7856eb94bfd40e4fdb7376a7f5c358
2022-08-31 18:05:03 +05:30
Artom Lifshitz
4eddcf77c9 api-ref: Adjust BFV rescue non-support note.
Rescuing BFV instances became a thing in 2.87. Fix our api-ref.

Change-Id: I9c4fbea53b05490cf05ebd311b25791fa191af16
2021-11-22 14:19:25 -05:00
Stephen Finucane
5e2c31ab78 api: Add support for 'hostname' parameter
Add microversion 2.90, which allows allows users to configure the
hostname that will be exposed via the nova metadata service when
creating their instance.

Change-Id: I95047c1689ac14fa73eba48e19dc438988b78aad
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-14 11:42:43 +00:00
Matt Riedemann
e416b19ba1 api-ref: re-work resize action post-conditions
This change does a few things:

1. Moves the post-condition paragraph into an
   "Asynchronous Postconditions" section like other
   API references.

2. Drops the "RESIZED" VM status wording since what
   that probably meant was the server OS-EXT-STS:vm_state
   value would be "resized" but what was in the reference
   was (a) wrong and (b) redundant with the VERIFY_RESIZE
   status.

3. Re-words and links the resize_confirm_window config
   option wording since saying "if you set" a config option
   in the API reference does not really make sense since
   "you" (the non-admin cloud user) does not have control
   over how the cloud is configured.

Change-Id: I77830dfb738cd78c830dc3ce7ea88216c1eac7ef
2019-10-29 12:56:59 -04:00
Matt Riedemann
d3e38143a7 Add known limitation about resize not resizing ephemeral disks
It's a long known issue that resize does not resize ephemeral
disks attached to the server yet we continue to get bugs about
it and there is no one working on fixing it. As such this change
adds a note to the API reference for the resize server action API
mentioning the known limitation.

Change-Id: I31ca3627f2d3ef5a8db5eecf3759cd304b059963
Related-Bug: #1558880
2019-10-29 12:50:13 -04:00
Ghanshyam Mann
f7e672d302 Update api-ref for 2.75 to add config_drive in server update response
In 2.75, we missed to add the config_drive field in api-ref for
update server response
- I9d257a003d315b84b937dcef91f3cb41f3e24b53.

This commit updates the api-ref.

Change-Id: I46ab0b8650bf50a5384bb56027cdf0dc2a9bb2fe
Partial-Implements: blueprint api-consistency-cleanup
2019-08-20 12:58:36 +00:00
Matt Riedemann
ad75beee11 api-ref: add config_drive to 2.75 rebuild response parameters
Change I9d257a003d315b84b937dcef91f3cb41f3e24b53 and the 2.75
microversion returns the config_drive parameter in the rebuild
response and it's in the 2.75 rebuild response sample but was
missing from the response parameters table.

Change-Id: I89eca8638bc0d64b7f320f4ec5c49375bfebdb56
2019-08-19 15:01:35 -04:00
Ghanshyam Mann
b26bc7fd7a Multiple API cleanup changes
This microversion implements below API cleanups:

1. 400 for unknown param for query param and for request body.

2. Making server representation always consistent among all APIs
   returning the complete server representation.

3. Change the default return value of ``swap`` field from the empty string
   to 0 (integer) in flavor APIs.

4. Return ``servers`` field always in the response of GET
   hypervisors API even there are no servers on hypervisor

Details: https://specs.openstack.org/openstack/nova-specs/specs/train/approved/api-consistency-cleanup.html

Partial-Implements: blueprint api-consistency-cleanup

Change-Id: I9d257a003d315b84b937dcef91f3cb41f3e24b53
2019-08-12 08:52:38 -05:00
Andreas Jaeger
dbe6321537 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that Neutron publishes to api-ref/network, not networking anymore.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: Id2cf3aa252df6db46575b5988e4937ecfc6792bb
2019-07-22 19:17:28 +02:00
Surya Seetharaman
c541ace518 Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``locked_reason`` to
``POST /servers/{server_id}/action`` request where the
action is lock. It enables the user to specify a reason when locking
a server.

The locked_reason will be exposed through ``GET servers/{server_id}``,
``GET /servers/detail``, ``POST /servers/{server_id}/action``  where
the action is rebuild and ``PUT servers/{server_id}`` requests' responses.

The InstanceActionNotification will emit the locked_reason
along with the other instance details. This patch hence changes the
payload object to include the "locked_reason" field.

Note that "locked" will be allowed as a valid filtering/sorting parameter
for ``GET /servers/detail`` and ``GET /servers`` from this new microversion.

Implements blueprint add-locked-reason

Change-Id: I46edd595e7417c584106487123774a73c6dbe65e
2019-05-11 21:48:27 +00:00
Matt Riedemann
4d0aab16ec api-ref: add more details to confirmResize troubleshooting
This does a few things:

1. Fixes the "migration_status" wording since that does not
   exist and could be confused as a field on the server
   resource which it is not, it is referring to the migration
   resource status.

2. Fixes the RESIZED status mention since that is not a real
   server status, it probably meant VERIFY_RESIZE (RESIZED is
   the name of the nova.compute.vm_states variable used in the
   code to set the VERIFY_RESIZE status in the API).

3. Adds words about options to correct the server status from
   ERROR after confirmResize fails, the most obvious being
   an admin resetting the server status to ACTIVE or the user
   hard rebooting the server.

Change-Id: I7de257ad78031d137616d724bee3fa1cbf40d6fa
Related-Bug: #1821594
2019-03-29 09:38:45 -04:00
Yongli He
2cc7c0e589 Adds the server group info into show server detail API.
The server-groups UUID add to response of 'GET /servers/{id}',
'PUT /servers/{server_id}" and rebuild API
'POST /servers/{server_id}/action'.

Change-Id: I4a2a584df56ece7beb8b12c0ce9b0e6b30237120
Implements: blueprint show-server-group
Co-authored-by: Gerry Kopec <Gerry.Kopec@windriver.com>
Signed-off-by: Yongli He <yongli.he@intel.com>
2019-02-28 14:22:46 -05:00
Takashi NATSUME
a925c8b06d api-ref: Add descriptions for vol-backed snapshots
Add descriptions about the createImage action
in the volume-backed servers case.

Change-Id: Iee81ee4ed6d6bbfa2c17955396d4ff7f36f08017
Closes-Bug: #1799495
2019-02-14 14:15:12 +00:00
Takashi NATSUME
442c7c68c2 api-ref: Body verification for the lock action
This patch adds more explanations for the lock action
in the Compute API reference and the Compute API guide.

Change-Id: Iae4a42351d11d5caade9a1a299b06fed862a7da4
Partial-Bug: #1793034
2019-01-17 04:05:50 +00:00
Takashi NATSUME
95d2f3c8e7 api-ref: Remove a description in servers-actions.inc
In the "Servers - run an action (servers, action)" section,
it says that you can attach a volume to a server.
But there are no APIs to attach a volume to a server
in the section.
The API is in the "Servers with volume attachments
(servers, os-volume_attachments)" section.

So remove the description in
the "Servers - run an action (servers, action)" section.

TrivialFix
Change-Id: I0bbfa98385930e21ac12815675851036c9a77621
2018-10-09 09:32:28 +09:00
Takashi NATSUME
cfaf8e571f api-ref: Move the evacuate action to admin action
The evacuate action can be performed by administrators only by default.
But there is the description of the evacuate action in
the "Servers - run an action (servers, action)" section.

It should be in the "Servers - run an administrative action
(servers, action)" section.
So move to the description of the evacuate action
into the administrative action section.

Change-Id: Iafdd77c14c702af24dbb3f5a3adecc45b3014c48
Closes-Bug: #1796054
2018-10-04 19:20:22 +09:00
Takashi NATSUME
330c950908 api-ref: Add descriptions for rebuild
Add descriptions about specifying a new image and
asynchronous postconditions in the rebuild operation
in the compute API reference.

Change-Id: I0fd136d07dffc2be845b4b9330fae98c7115789b
Closes-Bug: #1784387
2018-08-07 23:57:22 +00:00
Zuul
7f9cdb5d6d Merge "Fix being able to hard reboot a pausing instance" 2018-07-31 10:32:41 +00:00
jichenjc
1a079a6394 Mention server status in api-ref when rebuild
Add description about server status in active, shutoff,
error can accept a rebuild action.

Closes-Bug: 1775665

Change-Id: Id52acb9fdb264b337a6a9748049aeecd22901bf4
2018-06-28 00:21:13 +00:00
Brianna Poulos
8c7ca368b1 Add trusted_image_certificates to REST API
This change adds support for the trusted_image_certificates parameter,
which is used to define a list of trusted certificate IDs that can be
used during image signature verification and certificate validation. The
parameter may contain a list of strings, each string representing the ID
of a trusted certificate. The list is restricted to a maximum of 50 IDs.
The list of certificate IDs will be stored in the trusted_certs field of
the instance InstanceExtra and will be used to verify the validity of
the signing certificate of a signed instance image.

The trusted_image_certificates request parameter can be passed to
the server create and rebuild APIs (if allowed by policy):

* POST /servers
* POST /servers/{server_id}/action (rebuild)

The following policy rules were added to restrict the usage of the
``trusted_image_certificates`` request parameter in the server create
and rebuild APIs:

* os_compute_api:servers:create:trusted_certs
* os_compute_api:servers:rebuild:trusted_certs

The trusted_image_certificates parameter will be in the response
body of the following APIs (not restricted by policy):

* GET /servers/detail
* GET /servers/{server_id}
* PUT /servers/{server_id}
* POST /servers/{server_id}/action (rebuild)

APIImpact

Implements blueprint: nova-validate-certificates
Change-Id: Iedd3fea0e86648fae364f075915555dcb2c4f199
2018-06-13 15:52:59 -04:00
Matt Riedemann
3437baedf6 Fix being able to hard reboot a pausing instance
The allowed task states for a hard reboot include 'pausing'
but the instance.save(expected_task_states) doesn't include
'pausing', so if you try to hard reboot a pausing instance
it will fail with UnexpectedTaskStateError.

This makes the expected_task_states passed to Instance.save
use the same list of allowed task states that we use in the
check_instance_state decorator, and re-writes the unit test
to use an actual database to verify the Instance.save()
behavior and task state check in the DB API.

While we're at it, the API reference is updated to indicate
the allowed states for each type of reboot.

Change-Id: I5a21350e48a637e581d269fb567bb96c1899e174
Closes-Bug: #1768927
2018-05-03 16:30:46 -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
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
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
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
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
Matt Riedemann
ae9542eb7d api-ref: add note about rebuild not replacing volume-backed root disk
We've had several bugs about this over the years, and until we
actually decide to fix it (or not), we should point out the known
limitation that volume-backed root disks are not replaced during
a rebuild.

Like, if you have a volume-backed instance and rebuild with a new
image, the root disk is still the volume with the original image.

Change-Id: I145cab88f782e4b1e630cc432322bc8436413e71
Related-Bug: #1482040
2017-10-03 16:34:26 -04:00
Matt Riedemann
ac1449c28e api-ref: remove redundant preserve_ephemeral mention from rebuild docs
We already mention the preserve_ephemeral parameter in the request
parameters table, including the note that it's only useful for
baremetal instances, so we don't need to mention it again in the
description of the API.

Also adds a space between some list error codes.

Change-Id: I8712f0fdd06eee1bb9af439621481d1c69b6244c
2017-10-03 16:01:46 -04:00
Anne Gentle
d90a35ef65 API ref: associate floating IP requires Active status
- There is no available status.

Change-Id: If1a2696e63830ae38b4a0c4e2488fb16d33650d8
Closes-bug: 1618883
2017-07-25 16:11:00 +00:00
Chris Friesen
90636e0f33 show flavor info in server details
Add a new microversion to change the flavor field in the server
details to display a subset of the flavor information instead of
just a link to the original flavor.

This is more reliable since it shows the actual instance size, while
the flavor may have been deleted/recreated in the meantime or the
flavor extra-specs may have been modified.

Implements: blueprint instance-flavor-api
Change-Id: If646149efb7eec8c90bf7d07c39ff4c495349941
2017-06-02 12:09:24 -04:00
Takashi NATSUME
cbf83a01fb api-ref: Example verification for servers-actions.inc
* Example for the rebuild action

  The functional test is modified and
  the example is replaced with v2.26 examples.

* Example for the rescue action

  The example in API reference is replaced with
  the example with 'rescue_imgae_ref'.

Parameters for the rebuild action and the rescue action
are also fixed.

The patch completes the parameter verification and
the example verification of servers-actions.inc.

Change-Id: Iaf8808b13d1fdfead50da4cd447b3893578f76dd
Implements: blueprint api-ref-in-rst-pike
2017-05-22 00:19:19 +00:00
Takashi NATSUME
5532d6f404 Add a functional test for 'removeFloatingIp' action
Add a functional test for 'removeFloatingIp' action.
Rename the example file for 'addFloatingIp' action
to clarify that it is a request body example.

Change-Id: Ic865318fa640eb17d1317fb3d5f064788ebf44e7
2017-05-08 19:32:53 +00:00
Jenkins
eeb1bfcec8 Merge "2.45: Remove Location header from createImage and createBackup responses" 2017-04-25 22:28:38 +00:00
Jenkins
b57bb0431c Merge "api-ref: Parameter verification for servers-actions (3/4)" 2017-04-25 21:13:17 +00:00
Jenkins
729f5bea45 Merge "api-ref: Parameter verification for servers-actions (2/4)" 2017-04-25 21:09:54 +00:00
Matt Riedemann
66b0cf3337 2.45: Remove Location header from createImage and createBackup responses
This changes the response for the createImage and createBackup
server action APIs to no longer return a Location header and instead
returns a json dict body with the snapshot image ID. This is done
in a new microversion.

Implements blueprint remove-create-image-location-header-response

Closes-Bug: #1679285

Change-Id: Idc899ee76b8265b1c9e0871b6c7c277424cdd442
2017-04-25 15:52:14 -04:00
Matt Riedemann
0a03f0123c api-ref: move createBackup to server-actions
The createBackup API is by default an admin-or-owner API, so it
should live in server-actions rather than server-admin-actions.

Change-Id: Ifdc08a1df39f30944d45e2001d590b34a963d062
Closes-Bug: #1679314
2017-04-25 12:05:48 -04:00
He Jie Xu
03ce169884 Deprecate Multinic, floatingip action and os-virtual-interface API
The following APIs which are considered as proxies of Neutron networking
API, are deprecated and will result in a 404 error response in new
Microversion:

     POST /servers/{server_uuid}/action
     {
         "addFixedIp": {...}
     }
     POST /servers/{server_uuid}/action
     {
         "removeFixedIp": {...}
     }
     POST /servers/{server_uuid}/action
     {
         "addFloatingIp": {...}
     }
     POST /servers/{server_uuid}/action
     {
         "removeFloatingIp": {...}

And the nova-network specific API for query server's interfaces is
deprecated also:

     GET /servers/{server_uuid}/os-virtual-interfaces

Partial implement blueprint deprecate-multinic-proxy-api

Change-Id: I1848db384a825d3b166f113b30ebad92113af8e5
2017-04-25 12:04:05 -04:00
Takashi NATSUME
08a113fdaa api-ref: Parameter verification for servers-actions (3/4)
This patch fixes the parameters of the following actions.

* removeSecurityGroup
* resize
* resume
* revertResize

Subsequent patches will fix the patameters of the other actions
in servers-actions.inc.

Change-Id: Ie470138ac53404369f4fc717bf979b94060c5652
Implements: blueprint api-ref-in-rst-pike
2017-04-25 11:37:28 +09:00
Takashi NATSUME
f38a234f9b api-ref: Parameter verification for servers-actions (2/4)
This patch fixes the parameters of the following actions.

* lock
* pause
* reboot
* removeFloatingIp

Subsequent patches will fix the patameters of the other actions
in servers-actions.inc.

Change-Id: I33210b5d8cfb359e4cc9ef37fe74b71d30a9acc5
Implements: blueprint api-ref-in-rst-pike
2017-04-24 00:51:07 +00:00
Takashi NATSUME
962dae61dc api-ref: Parameter verification for servers-actions (1/4)
This patch fixes the parameters of the following actions.

* addSecurityGroup
* changePassword
* confirmResize
* createImage

Subsequent patches will fix the patameters of the other actions
in servers-actions.inc.

Change-Id: Ifaa1ed25c034e649ea4012f4998c571c38d404a1
Implements: blueprint api-ref-in-rst-pike
2017-04-17 01:20:57 +00:00
Jenkins
b5a9ebf4f2 Merge "Add server-action-removefloatingip.json file and update servers-actions.inc" 2017-04-07 18:34:30 +00:00
Jenkins
9b1ec228df Merge "Fix api-ref for adminPass behavior" 2017-03-31 15:17:35 +00:00
libing
e0582bf174 Add server-action-removefloatingip.json file and update servers-actions.inc
Part of bp:api-ref-in-rst-pike

Change-Id: I6a7dbbd5d999fef557a110a6828a317e2e8da3c0
2017-03-31 14:12:38 +00:00
Takashi NATSUME
47bd7be882 api-ref: Fix wrong HTTP response codes
* POST /servers

  The 413 response code has not been expected
  since I470b53af45ff47c1dec98d09d7a426a29ca1efc6.
  So remove 413.

* POST /server/{server_id}/action

  In 'Rebuild' action, the 413 response code has not been expected
  since I470b53af45ff47c1dec98d09d7a426a29ca1efc6.
  So remove 413.

  In 'Rescue' action, the normal response code is actually 200
  instead of 202.
  So fix it.

Change-Id: I6e91d3ac751777f48ab084395a66cb3f83bfcca2
Implements: blueprint api-ref-in-rst-pike
Closes-Bug: #1677452
2017-03-30 13:51:07 +09:00
ghanshyam
78dee1de59 Fix api-ref for adminPass behavior
This commit fix the below doc issue for adminPass
 -'adminPass' attrbiure is only return in response if
  'enable_instance_password' configuration option is set to true
 - evacuate API stop returning adminPass from 2.14 microversion
   so max version for this field is 2.13.
 - if 'adminPass' is not present in request then, operation auto generate one.

Change-Id: I636657ed30b33da0a2df73b222c4ce5d8388a3d8
2017-03-28 06:51:01 +03:00
Jenkins
b672f35de6 Merge "Add description for Image location in snapshot" 2017-03-17 19:30:48 +00:00
Ken'ichi Ohmichi
095322657d Clarify os-stop API description
The original changed description tried to explain the instance
data still exists after the API operation, but that was not clear.
This patch makes it clear as possible for users.
In addition, this patch removes the related sentence of os-start
to avoid the same confusion.

Change-Id: I46c4d24a67717807f4c6650a739f7855108783e9
2017-03-16 11:16:49 -07:00
jichenjc
72081ded4d Add description for Image location in snapshot
snapshot action nova will return image URL in response header
better to provide this info to end user for their reference.

Also, the backup header description is changed as well.

Change-Id: I15cf228b4a5a2d0dbae5fa76ec6821487e7808ed
Closes-Bug: 1657998
2017-03-13 19:09:08 +08:00
Pavel Kholkin
df6e2d37f2 [proxy-api] microversion 2.39 deprecates image-metadata proxy API
Almost all proxy APIs were deprecated in microversion 2.36.
But the sub-resource image-metadata of image was forgotten to deprecate.
This patch deprecates the image-metdata API from 2.39.

Implements blueprint deprecate-image-meta-proxy-api
Closes-bug: #1614578

Change-Id: I5507337ab6fe4a377f66dec3fe275d75618cd7b4
2016-12-07 19:22:43 +03:00