====== 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 ====== * The best documentation is provided by [[https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/1.3/html/object_gateway_guide_for_red_hat_enterprise_linux/administration_cli#quota_management|redhat]]. * And official from [[http://docs.ceph.com/docs/jewel/radosgw/admin/#quota-management|ceph]] ====== 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 ([[https://docs.ceph.com/docs/nautilus/radosgw/admin/#update-quota-stats|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= --sync-stats ====== Quota exceeded ====== QuotaExceededtestbuckettx00000000000000000000d-005d0383e4-6b83-default6b83-default-default