Count Snapshots towards volume/gigabyte quotas.

Cinder has quotas and limits for volume-count and Gigabytes used,
however we were only counting volumes against these quotas.

This change introduces a snapshot-count limit and also counts
snapshots against this Gigabytes quota allowed for a Tenant.

Fixed bug: 1137927

Change-Id: Ib9b00b84b05597de9b5725a7f5898fe10a20b9d9
This commit is contained in:
John Griffith
2013-03-11 09:21:56 -06:00
parent b8885203c1
commit 4b52b1481e
6 changed files with 88 additions and 10 deletions

View File

@@ -450,17 +450,22 @@ class QuotaError(CinderException):
class VolumeSizeExceedsAvailableQuota(QuotaError):
message = _("Requested volume exceeds allowed volume size quota")
message = _("Requested volume or snapshot exceeds "
"allowed Gigabytes quota")
class VolumeSizeExceedsQuota(QuotaError):
message = _("Maximum volume size exceeded")
message = _("Maximum volume/snapshot size exceeded")
class VolumeLimitExceeded(QuotaError):
message = _("Maximum number of volumes allowed (%(allowed)d) exceeded")
class SnapshotLimitExceeded(QuotaError):
message = _("Maximum number of snapshots allowed (%(allowed)d) exceeded")
class DuplicateSfVolumeNames(Duplicate):
message = _("Detected more than one volume with name %(vol_name)s")