Commit Graph

1049 Commits

Author SHA1 Message Date
Zuul bb71b953c7 Merge "api: Address issues with remote consoles APIs" 2025-06-27 17:32:18 +00:00
Stephen Finucane c4f81a54d5 api: Address issues with remote consoles APIs
* Add a note explaining presence of xvpvnc console type
* Make 'url' mandatory in create response
* Remove unnecessary description fields: we will populate these later
* De-deuplcate request body schemas
* Re-add references to the rdp console to the api-ref

Change-Id: I5555b8cf7a83fad689e98522850b5550b49566ed
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-26 18:49:59 +01:00
Zuul 64ca204c9c Merge "api: Address issues with instance actions API" 2025-06-16 15:05:21 +00:00
Stephen Finucane a0af4648b5 api: Address issues with hypervisors APIs
* Address an off-by-one error: the cpu_info field was modified in v2.28,
  not v2.27,
* Correct the api-ref to indicate that the 'servers' field is not
  actually required and will be missing if '?with_servers=false', while
  the 'name' and 'uuid' fields of servers entries *are* required.
* Clarify a comment about the above in the schemas.
* Uncouple the '_hypervisor_response' and '_hypervisor_detail_response'
  helper schemas. The minor increase in lines of code is worth it for
  the decrease in complexity.
* Add the 'host_ip', 'hypervisor_type', and 'hypervisor_version' fields
  to the list of required fields for "detail"-style responses (show and
  detailed list).
* Make the 'current_workload', 'disk_available_least', 'free_disk_gb',
  'free_ram_mb', 'host_ip' and 'running_vms' fields of the hypervisor
  "detail"-style responses nullable, and the 'current_workload',
  'disk_available_least', 'free_disk_gb', 'free_ram_mb' and
  'running_vms' fields of the deprecated statistics API nullable.

Change-Id: Ibe55b44e65fe17141c63cceae8a003816ffe4f23
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-11 13:07:54 +01:00
Stephen Finucane f09904f62d api: Address issues with instance actions API
The user_id and project_id fields can be null. Explain why.

Change-Id: I34353ec7e55845a83f5e2f1dc4b41dead4ac5c81
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-10 11:50:50 +01:00
Masahito Muroi 509820f156 Use dict object for request_specs_dict in the _list_view
The request_specs_dict in the _list_view is initialized as a
defaultdict object in order to return empty string as default.
But the request_spec_dict is replaced with a normal dict object in
the v2.96 microversion, then if server list and RequestSpec missmatch
happens by any reason, the List Server API and the List
Server Detail API hit 500 Internal server error because of key error.

This commit updates the req_spec_dict to use normal dict object, then
it returns sentinel object if there is no appropriate
request_spec object.

Closes-Bug: #2095364
Change-Id: If282b8709954f276cb5d48114437809d771a9958
2025-04-04 17:06:25 +09:00
Ghanshyam Mann 7a00971b8f Fix microversion 2.98 doc/tests for update/rebuild APIs
microversion 2.98 changed the GET and GET list details
API response to expand the image field
- https://review.opendev.org/c/openstack/nova/+/939649

but when we change the views/servers.py then update server
and rebuild server API response also gets updated.
- https://review.opendev.org/c/openstack/nova/+/939649/12/nova/api/openstack/compute/views/servers.py#595

The microversion change actually changed the response for
the update and rebuild API but did not update the documentation
about this change. Neither added test for rebuild and update
which verify the response change.

Since microversion 2.75, we have made all these 4 APIs response
consistent.

Implements: blueprint image-properties-in-server-show

Change-Id: Ifc2edc59c601391a31fd8953c742969e5b368767
2025-02-28 17:13:59 +00:00
Ghanshyam Mann f9e89bc0d1 Fix microversion 2.96 for update/rebuild APIs
microversion 2.96 changed the GET and GET list details
APi response to add a new field 'pinned_availability_zone'
- https://review.opendev.org/c/openstack/nova/+/904568

but when we change the views/servers.py then update server
and rebuild server API response also gets updated.
- https://review.opendev.org/c/openstack/nova/+/904568/17/nova/api/openstack/compute/views/servers.py#309

The microversion change actually changed the response for
the update and rebuild API but did not update the documentation
about this change. Neither added test for rebuild and update
which verify the response change.

Since microversion 2.75, we have made all these 4 APIs response
consistent.

Change-Id: I31fbb3c5e689302713bfb7a254c5d0cc12de2dc4
2025-02-28 17:06:18 +00:00
Douglas Viroel 2db8af71dd Add support for showing scheduler_hints in server details
Nova currently lacks a straightforward way to expose scheduler hints
associated with a server. This change extends existing Nova's
API to allow users to retrieve this information when it is available.
It adds a new API microversion to support returning the associated
scheduler_hints in ``GET /servers/{server_id}``, `GET /servers/detail``,
``PUT /servers/{server_id}`` and ``POST /server/{server_id}/action``
(rebuild) responses.

Implements: blueprint show-scheduler-hints-in-server-details
Change-Id: If0070cfbc218e0515bf3b58fc8c5067ae22c7072
2025-02-26 17:50:25 -03:00
Michael Still cbc263f6bc libvirt: allow direct SPICE connections to qemu
This patch adds a new console type, "spice-direct", which provides
the connection information required to talk the native SPICE protocol
directly to qemu on the hypervisor. This is intended to be fronted
by a proxy which will handle authentication separately.

A new microversion is introduced which adds the type "spice-direct"
to the existing "spice" protocol.

An example request:

POST /servers/<uuid>/remote-consoles
{
  "remote_console": {
    "protocol": "spice",
    "type": "spice-direct"
  }
}

An example response:

{
  "remote_console": {
    "protocol": "spice",
    "type": "spice-direct",
    "url": "http://localhost:13200/nova?token=XXX";
  }
}

This token can then be used to lookup connection details for the
console using a request like this:

GET /os-console-auth-tokens/<consoletoken>

Which returns something like this:

{
  "console": {
    "instance_uuid": <uuid>,
    "host": <hypervisor>,
    "port": <a TCP port number>,
    "tls_port": <another TCP port number>,
    "internal_access_path": null
  }
}

APIImpact

Change-Id: I1e701cbabc0e2c435685e31465159eec09e3b1a0
2025-02-22 08:25:38 +11:00
Rajesh Tailor 05c6b6cdbb Add support for showing image properties in server show response
This change adds a new api microversion to add support for
including image properties in ``server show`` and ``server list
--long`` responses as well as in response for ``server rebuild``
instance action.

Implements: blueprint image-properties-in-server-show
Change-Id: Ic135389954e43e6478288c0cdcffd780915cdb40
2025-02-12 10:57:03 +05:30
Stephen Finucane 37e3d960f4 api-ref: Update note on flavor disabled property
This is not admin-only as suggested by the api-ref. In addition, there is
no mechanism available to disable flavors so this will always be false.

Change-Id: Ie1906366c8f141c6f6c58f21b0ff67eb827df4c8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-01-08 11:52:29 +00:00
René Ribaud 5e508a09b3 Attach Manila shares via virtiofs (API)
This patch introduce the REST API modifications to attach/detach a share
and list/show share mappings.

Manila is the OpenStack Shared Filesystems service.
These series of patches implement changes required in Nova to allow the shares
provided by Manila to be associated with and attached to instances using
virtiofs.

Implements: blueprint libvirt-virtiofs-attach-manila-shares

Change-Id: I0255a5697cd4ea148bd91c4f6fd183841d69a333
2024-11-27 14:09:42 +01:00
Zuul e4bd839547 Merge "Update api-ref for 2.95: evacuate to STOPPED" 2024-10-26 06:01:29 +00:00
Balazs Gibizer 3c0eadae0b Reject AZ changes during aggregate add / remove host
After this patch nova rejects the add host to aggregate API action
if the host has instances and the new aggregate for the host would
mean that these instances need to move from one AZ (even from the
default one) to another. Such AZ change is not implemented in nova
and currently leads to stuck instances.

Similarly nova will reject remove host from aggregate API action if the
host has instances and the aggregate removal would mean that the
instances need to change AZ.

Depends-On: https://review.opendev.org/c/openstack/tempest/+/821732

Change-Id: I19c4c6d34aa2cc1f32d81e8c1a52762fa3a18580
Closes-Bug: #1907775
2024-05-08 14:56:56 +02:00
Zuul a031921f42 Merge "Note the deleyad address view" 2024-04-29 18:59:37 +00:00
afazekas 25c13220c6 Note the deleyad address view
The addresses field containes delayed (cached) information,
due to internal implementation details.
This used to be considered API contact breakage,
but apperently no plan for fixing it.

Change-Id: I8db2800ede0276d60138369ec2d60c55a1791040
2024-04-29 17:30:10 +00:00
Artom Lifshitz a8cfa5abc1 Update api-ref for 2.95: evacuate to STOPPED
When we added evacuate to STOPPED in microversion 2.95 in
d732ee38a1, we never updated our
api-ref. This patch just adds a sentence explaining how evacuate
behaves starting in 2.95.

Related: bp/allowing-target-state-for-evacuate
Change-Id: I1ed7211bcdd85547d3c7d8d396b6efab36b835c6
2024-04-21 13:40:57 -04:00
Rajesh Tailor c98c8d84ee Add support for showing requested az in output
As of now, the server show and server list --long output
shows the availability zone, that is, the AZ to which the
host of the instance belongs. There is no way to tell from
this information if the instance create request included an
AZ or not.

This change adds a new api microversion to add support for
including availability zone requested during instance create
in server show and server list --long responses.

Change-Id: If4cf09c1006a3f56d243b9c00712bb24d2a796d3
2024-03-01 21:39:04 +05:30
Ghanshyam Mann 0c1e1ccf03 HyperV: Remove RDP console API
RDP console was only for HyperV driver so removing the
API. As API url stay same (because same used for other
console types API), RDP console API will return 400.

Cleaning up the related config options as well as moving its
API ref to obsolete seciton.

Keeping RPC method to avoid error when old controller is used
with new compute. It can be removed in next RPC version bump.

Change-Id: I8f5755009da4af0d12bda096d7a8e85fd41e1a8c
2024-02-13 12:24:38 -08:00
Ghanshyam Mann 3e47439a68 HyperV: Remove RDP console connection information API
The RDP console was only available for HyperV driver, therefore its
connection information via API ``os-console-auth-tokens`` will now return
HTTP ``400 (BadRequest)`` error.

Starting from 2.31 microversion, this API return connection info
for all other console type.

Change-Id: I94e590eb4cbe3b2d8eff7fe881f7b98af8979be2
2024-02-13 19:28:07 +00:00
Ghanshyam Mann c76c72cfe0 Remove HyperV: cleanup doc/code ref
Cleanup doc/code ref of HyperV driver.

Change-Id: I6cd8fb90829e040bfd356ff6b1c41aa9a1c906d2
2024-02-07 12:08:07 -08:00
Zuul ca0a279727 Merge "[codespell] fix typos in api-ref" 2023-12-11 10:22:20 +00:00
Sean Mooney 320c6fadde [codespell] fix typos in api-ref
this change uses codespell to fix typos in
the api-ref and updates setup.cfg to exclude more
binary types and build files.

Change-Id: Ife9bf9a87c70126969bf43f7aa4a3645617de901
2023-10-03 01:09:59 +01:00
Stephen Finucane c2ab7918e4 doc: Remove crud from conf.py file
Change-Id: Ie8078739d077a903e3ad83d27b178eda416b0859
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-02 11:11:23 +01:00
Sylvain Bauza 2d320f9b00 Add a new policy for cold-migrate with host
We add a new specific policy when a host value is provided for cold-migrate,
but by default it will only be an admin-only rule in order to not change
the behaviour.

Change-Id: I128242d5f689fdd08d74b1dcba861177174753ff
Implements: blueprint cold-migrate-to-host-policy
2023-06-26 11:34:12 +02:00
Artom Lifshitz 9980b9ad52 Microversion 2.94: FQDN in hostname
Extend microversion 2.90 to allow FQDNs in the hostname parameter.
Multi-create with --hostname continues to be refused, returning error
400 to the user. This simplifies the code by not needing to handle any
sort of suffix or prefix mangling of the FQDN to handle multiple
instances. No other changes are made - not Neutron integration,
metadata API changes (the FQDN will appear as-is in places where the
hostname currently appears), etc.

Change-Id: I47e397dc6da8263762479cc8ae4f8777a6d9d811
Implements: bp/fqdn-in-hostname
2023-01-17 10:59:37 -05:00
Patrick Hampson 8f1cc5a8f0 Doc: Fix list servers detailed response param
Change-Id: If94895d0fc4b5a59febd02e127fbf93959084fee
2022-10-28 21:55:12 +00:00
Amit Uniyal b7356303cd Updated flavors doc
Flavor with special characters in flavor ID is not allowed to create

Closes-Bug: 1920938
Change-Id: I600ae07f7fb039c9ccf461c4bf74ae42d9a3744f
2022-09-17 17:40:52 +00:00
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
Sylvain Bauza a755e5d9f2 api: Drop generating a keypair and add special chars to naming
As agreed in the spec, we will both drop the generation support for a keypair
but we'll also accept @ (at) and . (dot) chars in the keyname, all of them in
the same API microversion.

Rebased the work from I5de15935e83823afa545a250cf84f6a7a37036b4

APIImpact

Implements: blueprint keypair-generation-removal
Co-Authored-By: Nicolas Parquet <nicolas.parquet@gandi.net>

Change-Id: I6a7c71fb4385348c87067543d0454f302907395e
2022-07-28 11:05:50 +02:00
René Ribaud 09239fc2ea Allow unshelve to a specific host (REST API part)
This adds support to the REST API, in a new microversion, for specifying
a destination host to unshelve server action when the server
is shelved offloaded.
This patch also supports the ability to unpin the availability_zone of an
instance that is bound to it.

Note that the functional test changes are due to those tests using the
"latest" microversion 2.91.

Implements: blueprint unshelve-to-host
Change-Id: I9e95428c208582741e6cd99bd3260d6742fcc6b7
2022-07-22 10:22:34 +02:00
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
Zuul 276fb9c5c7 Merge "Add some missing parameters in docs of os-cells" 2021-09-01 17:06:06 +00:00
budebao 191712594d Add some missing parameters in docs of os-cells
Change-Id: I48c68e135bdfa7229eac6b242b7f80b005761ee8
2021-08-25 16:53:47 +08:00
Zuul 33e46b1aec Merge "api: Introduce microversion 2.89 adjusting os-volume_attachments" 2021-08-24 21:38:48 +00:00
Lee Yarwood ac21c6674c api: Introduce microversion 2.89 adjusting os-volume_attachments
This microversion adds attachment_id and bdm_uuid as stored in the
underlying bdm record while also removing the duplicate id field from
the responses of ``GET /servers/{server_id}/os-volume_attachments`` and
``GET /servers/{server_id}/os-volume_attachments/{volume_id}``.

To accomidate this within the _translate_attachment_summary_view helper
is folded into _translate_attachment_detail_view with the remaining
caller in the now deprecated os-volumes API now replaced with a static
dictionary.

Blueprint: add-attachmentid-to-responses-of-the-os-volume-attachments-api
Change-Id: I977c3fd9bbb1e1d42e6979222137e7366d2815e8
2021-08-24 12:07:41 +01:00
Stephen Finucane 289438b4c2 docs: Drop references to non-filter scheduler drivers
Take the opportunity to clean up the docs quite a bit, ultimately
combining two disparate guides on the scheduler into one.

Change-Id: Ia72d39b4774d93793b381359b554c717dc9a6994
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-08-23 16:45:37 +01:00
Balazs Gibizer 559404c23b trivial: fix word duplication in api ref
Change-Id: I3878fb9f36bb05dbb949f137a5d5c6664a27b69f
Closes-Bug: #1920256
2021-03-22 09:22:39 +01:00
Zuul 6517c56429 Merge "api-ref: Add notes about volume attach and detach being async" 2021-01-20 17:54:42 +00:00
Stephen Finucane 40e0578683 api-ref: Clarify 'all_tenants' command
An empty value for the 'all_tenants' query parameter of '/servers' and
'/servers/detail' means the value defaults to 'True', i.e. requesting
'/servers?all_tenants' is the same as '/servers?all_tenants=1'. Clarify
this, since the current wording is confusing.

Change-Id: Ib5fdd3b73aa5179e0379ee8f465e4118107786be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #1909745
2021-01-15 15:21:08 +00: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
Zuul 9757eebcba Merge "fup: Fix os-volume_attachments api-ref parameters" 2021-08-25 10:16:21 +00:00
Lee Yarwood a057bbc406 fup: Fix os-volume_attachments api-ref parameters
Change-Id: Ibf5ca2969065262f4aa14b3764af74af37d88408
2021-08-24 19:03:57 +01:00
Stephen Finucane 1f67ce2496 api: Drop statistics-style fields from os-hypervisors
Introduce API microversion 2.88, which makes the following changes to
a number of 'os-hypervisors'. Specifically, the following fields are
dropped from both the '/os-hypervisors/detail' (detailed list) and
'/os-hypervisors/{hypervisor_id}' (show) APIs:

- current_workload
- cpu_info
- vcpus
- vcpus_used
- free_disk_gb
- local_gb
- local_gb_used
- disk_available_least
- free_ram_mb
- memory_mb
- memory_mb_used
- running_vms

In addition, the '/os-hypervisors/statistics' API, which provided a
summary of the above stats but for all hypervisors in the deployment, is
dropped entirely.

Finally, the '/os-hypervisors/{hypervisor}/uptime' API, which provided a
similar response to the '/os-hypervisors/{hypervisor}' API but with an
additional 'uptime' field, has been removed in favour of including this
field in the primary '/os-hypervisors/{hypervisor}' API.

A small tweak to 'tox.ini' that allows us to share some venvs is
included.

Part of blueprint modernize-os-hypervisors-api

Change-Id: I515e484ade6c6455f82a3067940a418a0d7d965a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-08 10:10:21 +00:00
zhangbailin b4f560d4e1 Improving the description for unshelve request body
The 'availability_zone' description in unshelve api-ref is confusing,
adding NOTE for unshelve request body:

Since microversion 2.77, allowed request body schema are {"unshelve":
null} or {"unshelve": {"availability_zone": <string>}}. A request body
of {"unshelve":{}} is not allowed.

Closes-Bug: #1908336
Change-Id: I66c209baf11c37ffebca52764263daae9e1dd50b
2021-01-05 12:21:01 +00:00
Lee Yarwood 606a5dfecc api-ref: Add notes about volume attach and detach being async
This change adds some basic notes in the api-ref for a wrinkle in the
current os-volume_attachments API in that both attach and detach actions
are async, returning to the caller *before* the underlying action is
complete. As such callers need to make seperate calls to ensure these
actions complete successfully.

There are also currently two different ways of polling for completion
when attaching and detaching.

- When attaching callers should use the volume status and list of
  attachments as reported by the volume API.

- When detaching callers should instead use the list of volume attachments
  reported by the os-volume_attachments API.

This is due to the way in which Nova currently completes the attachment
via c-api last during attachment and deletes the bdm record last during
detachment.

It would be useful to one day centralise on just using the
os-volume_attachments API to poll both actions but to do that we would
need to start tracking our own state within the BDMs.

Change-Id: Id367ee53ef1458b6a90fc107ab14f5b3cbba7a86
2020-12-21 16:22:57 +00:00
Rafael Weingärtner 01f0424930 Enhance simple usage API documentation
Nova's `os-simple-tenant-usage` has the following statement.

```
Reports usage statistics of compute and storage resources periodically
for an individual tenant or all tenants. The usage statistics will
include all instances’ CPU, memory and local disk during a specific
period.

```

To some people, when reading that, they might get the understanding that
the `os-simple-tenant-usage` will report the actual use of resources.
Therefore, if a VM is stopped and then started back again, it (the
`os-simple-tenant-usage`) would only report the time the VM has been up
and running. However, that is not what happens. The
`os-simple-tenant-usage` reports the time that a virtual machine (VM)
exists in the cloud environment. Therefore, actions such as pause,
suspend, and stop do not affect the usage accounting.

This might be a problem for people using this API for billing, or for
people that use other systems (e.g. CloudKitty) for billing.
End-users might try to cross-check the data from the billing from
CloudKitty for instance, with the usage report found in Horizon that
uses this API, and the numbers will not add up, as people might only
consider the time a VM has been up and running to charge users in
CloudKitty.

An extension was proposed in [1], to allow operators to customize
the usage accounting. However, during a meeting with the community [2],
the extension was rejected for two reasons:

* Nova tries to avoid using config driven APIs. Meaning, APIs that change
  the response according to server-side configurations;
* The community has decided to get rid of usage and billing accounting
  in Nova.

Having said that, we would like to propose a documentation amendment.
The idea is to explicitly say for users/operators that the simple usage
API only considers the time that the VM existed in the cloud for the
accounting, and not the actual time it has been up and running.
This will save some misunderstanding and misuse of the API data.

References
===========
[1] https://review.opendev.org/c/openstack/nova/+/711113
[2] http://eavesdrop.openstack.org/meetings/nova/2020/nova.2020-12-03-16.00.log.txt

Closes-Bug: #1907133
Change-Id: Ic55669f5210b57f151f693393f205655765a8dc9
2020-12-07 17:38:37 -03:00
Stephen Finucane 68bc87876f virt: Remove 'reset_network' API
This one is tied into an admin action in the server actions API, which
means we must remove that API action also. Otherwise, this isn't too
crazy.

Change-Id: I58343b94b67915062d044fa0f53aeab01b77738f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-11-23 15:55:50 +00:00
Stephen Finucane e13e8c8cd4 api-ref: Move 'os-agents' API to obsolete section
Follow up for change I9512f605dd2b3b0e88c951ed086250d57056303d.

Change-Id: Ia627bab8ed911baf329e0bda385beb2ffcbbe7d6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-11-17 11:25:07 +00:00