Files
nova/doc/api_samples/os-volume_attachments/v2.101/update-volume-attachment-delete-flag-req.json
T
Johannes Kulik 2a51df2760 Attaching a volume returns HTTP 202
Instead of returning an HTTP 200 and a `volumeAttachment` object,
attaching a volume to an instance returns HTTP 202 starting from API
version 2.101.

To keep the functionality for older API versions, we move the
`_attach_volume()` method from n-api to n-conductor and either do a call
or a cast depending on whether the API needs to return a value.
n-conductor then handles reserving the block_device_mapping's device by
calling n-compute before it starts the previously-already-async volume
attachment.

We have to move `_check_attach_and_reserve_volume` into compute utils,
because it's getting called in both conductor and compute api (for the
shelved offloaded attach).

The new RPC method in the conductor needs a long timeout when used with
API versions less than the new 2.101, because it waits for the call to
`reserve_block_device_name()` in nova-compute which already needs a long
timeout.

Updating the functional tests' `post_server_volume()` and
`_attach_volume()` to not return the attachment anymore is possible, as
no test uses the returned values.

Change-Id: I4d38c2679f0e88cca30055a9c8c45ba1dd6fb5ef
Implements: blueprint async-volume-attachments
Signed-off-by: Johannes Kulik <johannes.kulik@sap.com>
2026-02-18 15:02:21 +01:00

10 lines
299 B
JSON

{
"volumeAttachment": {
"volumeId": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113",
"id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113",
"serverId": "fddf0901-8caf-42c9-b496-133c570b171b",
"device": "/dev/sdb",
"tag": "foo",
"delete_on_termination": true
}
}