Table of Contents

Quota Management

Documentation
Name: Quota Management
Description: howto manage quota system
Modification date :13/06/2019
Owner:dodger
Notify changes to:Owner
Tags:ceph, object storage
Scalate to:The_fucking_bofh

Official documentation

Variables used in this documentation

Name Description Sample
${QUOTASCOPE} Scope of the quota (bucket or user)
export QUOTASCOPE="bucket|user"
${THEUSERNAME} The username to be created
export THEUSERNAME="newuser"

WARNING: User quota :WARNING

I've found that USER quota does not works as usual, seems to have a little delay between quota_exceeded→free_space→free_quota while bucket quota is inmediate!!
So use bucket quota instead of user quota.

Also my tests indicate that USER+BUCKET quota WORKS FINE So you can combine user+bucket quota.

Admin commands for quotas

User quota

export QUOTASCOPE="user"

Bucket quota

export QUOTASCOPE="bucket"

Enable quota

MANDATORY if you want to use quotas.

sudo radosgw-admin quota enable --quota-scope=${QUOTASCOPE} --uid=${THEUSERNAME}

Disable quota

sudo radosgw-admin quota disable --quota-scope=${QUOTASCOPE} --uid=${THEUSERNAME}

Seting quota by

Size

sudo radosgw-admin quota set --quota-scope=${QUOTASCOPE} --uid=${THEUSERNAME} --max-size=500G

Size can have B/K/M/G/T suffix.

Number of objects

sudo radosgw-admin quota set --quota-scope=${QUOTASCOPE} --uid=${THEUSERNAME} --max-objets=100000

Quota usage report

sudo radosgw-admin user stats --uid=${THEUSERNAME}


Sync quotas (Copy paste from official documentation):
Quota stats get updated asynchronously. You can update quota statistics for all users and all buckets manually to retrieve the latest quota stats.

radosgw-admin user stats --uid=<uid> --sync-stats

Quota exceeded

<?xml version="1.0" encoding="UTF-8"?><Error><Code>QuotaExceeded</Code><BucketName>testbucket</BucketName><RequestId>tx00000000000000000000d-005d0383e4-6b83-default</RequestId><HostId>6b83-default-default</HostId></Error>