diff --git a/manila/share/api.py b/manila/share/api.py index 362ae5eb3c..8a7a11ad9c 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -1006,10 +1006,11 @@ class API(base.Base): msg = ("Quota exceeded for %(s_pid)s, tried to create " "%(s_size)sG snapshot (%(d_consumed)dG of " "%(d_quota)dG already consumed).") - LOG.warning(msg, {'s_pid': context.project_id, - 's_size': size, - 'd_consumed': _consumed('gigabytes'), - 'd_quota': quotas['snapshot_gigabytes']}) + LOG.warning(msg, { + 's_pid': context.project_id, + 's_size': size, + 'd_consumed': _consumed('snapshot_gigabytes'), + 'd_quota': quotas['snapshot_gigabytes']}) raise exception.SnapshotSizeExceedsAvailableQuota() elif 'snapshots' in overs: msg = ("Quota exceeded for %(s_pid)s, tried to create " diff --git a/manila/tests/share/test_api.py b/manila/tests/share/test_api.py index 4b0f1257d7..459d201117 100644 --- a/manila/tests/share/test_api.py +++ b/manila/tests/share/test_api.py @@ -1098,7 +1098,7 @@ class ShareAPITestCase(test.TestCase): share = fakes.fake_share( id=uuidutils.generate_uuid(), size=1, project_id='fake_project', user_id='fake_user', has_replicas=False, status='available') - usages = {'gigabytes': {'reserved': 10, 'in_use': 0}} + usages = {'snapshot_gigabytes': {'reserved': 10, 'in_use': 0}} quotas = {'snapshot_gigabytes': 10} side_effect = exception.OverQuota( overs='snapshot_gigabytes', usages=usages, quotas=quotas) diff --git a/releasenotes/notes/bug-1859775-snapshot-over-quota-exception-bb6691612af03ddf.yaml b/releasenotes/notes/bug-1859775-snapshot-over-quota-exception-bb6691612af03ddf.yaml new file mode 100644 index 0000000000..dea2f596f8 --- /dev/null +++ b/releasenotes/notes/bug-1859775-snapshot-over-quota-exception-bb6691612af03ddf.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed Quota exceeded exception for snapshot creation. Consumed gigabytes + now reports the snapshot gigabytes instead of share gigabytes usage.