commit c65dfeecaec23c0fa1cefd5f72c56faa7589216b
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 15 12:45:08 2017 -0500
Check quota before creating volume snapshots
When creating a snapshot of a volume-backed instance, we
create a snapshot of every volume BDM associated with the
instance. The default volume snapshot limit is 10, so if
you have a volume-backed instance with several volumes attached
and snapshot it a few times, you're likely to fail the
volume snapshot at some point with an OverLimit error from
Cinder. This can lead to orphaned volume snapshots in Cinder
that the user then has to cleanup.
This change makes the snapshot operation a bit more robust by
first checking the quota limit and current usage for the given
project before attempting to create any volume snapshots.
It's not fail-safe since we could still fail with racing snapshot
requests for the same project, but it's a simple improvement to
avoid this issue in the general case.
Change-Id: I4e7b46deb43c0c2430b480f1a498a52fc4a9daf0
Related-Bug: #1731986
(cherry picked from commit 289d2703c75123216d0a6802f2fe5f41aa84407c)
Reviewed: https:/ /review. openstack. org/546158 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=c65dfeecaec 23c0fa1cefd5f72 c56faa7589216b
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit c65dfeecaec23c0 fa1cefd5f72c56f aa7589216b
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 15 12:45:08 2017 -0500
Check quota before creating volume snapshots
When creating a snapshot of a volume-backed instance, we
create a snapshot of every volume BDM associated with the
instance. The default volume snapshot limit is 10, so if
you have a volume-backed instance with several volumes attached
and snapshot it a few times, you're likely to fail the
volume snapshot at some point with an OverLimit error from
Cinder. This can lead to orphaned volume snapshots in Cinder
that the user then has to cleanup.
This change makes the snapshot operation a bit more robust by
first checking the quota limit and current usage for the given
project before attempting to create any volume snapshots.
It's not fail-safe since we could still fail with racing snapshot
requests for the same project, but it's a simple improvement to
avoid this issue in the general case.
Change-Id: I4e7b46deb43c0c 2430b480f1a498a 52fc4a9daf0 16d0a6802f2fe5f 41aa84407c)
Related-Bug: #1731986
(cherry picked from commit 289d2703c751232