commit 70afc0d5408aaae8beb587682fe26c124c0cacee
Author: Matt Riedemann <email address hidden>
Date: Sun Feb 5 16:32:44 2017 -0500
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.
Reviewed: https:/ /review. openstack. org/429476 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=70afc0d5408 aaae8beb587682f e26c124c0cacee
Committed: https:/
Submitter: Jenkins
Branch: master
commit 70afc0d5408aaae 8beb587682fe26c 124c0cacee
Author: Matt Riedemann <email address hidden>
Date: Sun Feb 5 16:32:44 2017 -0500
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: I1dc54a38f02bb4 8921bcbc4c2fdcc 2c946e783c1
Closes-Bug: #1657585