nova/releasenotes/notes/bug-1657585-99b7eddc40c71e5a.yaml
Matt Riedemann 70afc0d540 Handle conflicts for os-assisted-volume-snapshots
Since a guest-assisted disk snapshot is performed on the compute
that the instance is running on, there are only certain states
that the instance can be in to perform this operation. For example,
if the instance is shelved_offloaded then the instance does not
have a host and we can't cast to a compute to perform the snapshot.

Given how unrestrictive this API was before, the only restriction
we place on the state is that the instance does not have a task_state
set. We allow any vm_state for performing the operation as long as
there is a host and no task_state.

As noted in the code, we'd normally return a 409 in this case but
according to our microversion docs [1] that would be a new error
code and require a version bump, so this change just uses 400 and
leaves a TODO to make this 409 in a later mass return code update
microversion.

[1] https://docs.openstack.org/developer/nova/api_microversion_dev.html#f1

Change-Id: I1dc54a38f02bb48921bcbc4c2fdcc2c946e783c1
Closes-Bug: #1657585
2017-03-02 15:10:26 -05:00

8 lines
261 B
YAML

---
fixes:
- |
The ``POST`` and ``DELETE`` operations on the
``os-assisted-volume-snapshots`` API will now fail with a 400 error if the
related instance is undergoing a task state transition or does not have a
host, i.e. is shelved offloaded.