Setting Storage Pool Quotas
Pool quota is a logical data size limit applied at the Ceph storage pool level.
It controls how much logical data can be written by the pool, the actual physical space will be quota * pool replication.
TOC
Prerequisites
- A Ceph cluster is installed
- Ceph pools are created
Set pool quota for File Storage Pool
Execute commands on the control node of the cluster.
SIZE="<size>"
POOL_NAME="<fs-pool-name>"
kubectl patch cephfilesystem $POOL_NAME -n rook-ceph --type=json \
-p "[{\"op\":\"add\",\"path\":\"/spec/dataPools/0/quotas/maxSize\",\"value\":\"$SIZE\"}]"
Parameters
| Parameters | Description |
|---|
| size | quota in bytes as a string with quantity suffixes (e.g. "10Gi") |
| fs-pool-name | The name of the File Storage Pool. |
Set pool quota for Block Storage Pool
Execute commands on the control node of the cluster.
SIZE="<size>"
POOL_NAME="<block-pool-name>"
kubectl patch cephblockpool $POOL_NAME -n rook-ceph --type=json \
-p "[{\"op\":\"add\",\"path\":\"/spec/quotas/maxSize\",\"value\":\"$SIZE\"}]"
Parameters
| Parameters | Description |
|---|
| size | quota in bytes as a string with quantity suffixes (e.g. "10Gi") |
| block-pool-name | The name of the Block Storage Pool. |
Set pool quota for Object Storage Pool
Execute commands on the control node of the cluster.
SIZE="<size>"
POOL_NAME="<object-pool-name>"
kubectl patch cephobjectstore $POOL_NAME -n rook-ceph --type=json \
-p "[{\"op\":\"add\",\"path\":\"/spec/dataPool/quotas/maxSize\",\"value\":\"$SIZE\"}]"
Parameters
| Parameters | Description |
|---|
| size | quota in bytes as a string with quantity suffixes (e.g. "10Gi") |
| object-pool-name | The name of the Object Storage Pool. |
Validate pool quota via Ceph Terminal
ceph osd pool ls detail | grep max_bytes
pool 3 'cephfs-data0' replicated size 3 min_size 2 crush_rule 4 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 100 lfor 0/0/56 flags hashpspool max_bytes 107374182400 stripe_width 0 application cephfs read_balance_score 1.31
pool 4 'rbd' replicated size 3 min_size 2 crush_rule 5 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 117 lfor 0/0/111 flags hashpspool,selfmanaged_snaps max_bytes 107374182400 stripe_width 0 application rbd read_balance_score 1.31
pool 12 'object.rgw.buckets.data' replicated size 3 min_size 2 crush_rule 13 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 304 lfor 0/0/168 flags hashpspool max_bytes 107374182400 stripe_width 0 compression_mode none application rgw read_balance_score 1.59