Quota support for OBC provided by ODF Multicloud Object Gateway (NooBaa) - Dev Preview

Solution Verified - Updated

Environment

  • Red Hat OpenShift Data Foundation
    • 4

Issue

  • Is it possible on Red Hat OpenShift Data Foundation to set quota options for its object bucket claims (OBC).
  • It is necessary to avoid resource starvation while increasing the usage of the storage provided via Noobaa bucket.

Resolution

Note: A developer preview feature is subject to Developer preview support limitations. Developer preview features are not intended to be run in production environments. The clusters deployed with the developer preview features are considered to be development clusters and are not supported through the Red Hat Customer Portal case management system. Development Preview features are meant for customers who are willing to evaluate new products or releases of products in an early stage of product development. To know more about the support scope refer to the following This content is not included.article.

  • It is possible to set up limits for either the Bucket Class in order to target multiple OBCs or to set up limits for a specif OBC.

  • To set up limit for a Bucket Class:

    • To set the limits in a Bucket Class, add the following lines in its manifest:
    spec:
      placementPolicy:
        tiers:
          - backingStores:
              - noobaa-default-backing-store
      quota:
        maxObjects: '10000'
        maxSize: 1Gi
    
    • It is also possible to use the Noobaa cli to accomplish the same result:
    $ noobaa bucketclass create placement-bucketclass --backingstores=noobaa-default-backing-store --max-objects=10000 --max-size=1Gi <bucket class name>
    
  • To set up limits for an Object Bucket Claim:

    • To set the limits in an OBC, add the following lines in its manifest:
    spec:
      additionalConfig:
        maxObjects: '20000'
        maxSize: 1Gi
    
    • It is also possible to use the Noobaa cli to accomplish the same result:
    $ noobaa obc create --max-objects=20000  --max-size=1Gi <obc name>
    
    • To modify quota on a given OCB, just need to edit the Object Bucket Claim an change the value (ie maxSize) to the new one (higher or lower)
      This change is taken immediately and there is no need to reboot any pod.

Root Cause

Starting with Red Hat OpenShift Data Foundation 4.9, it is possible to set quota options for object bucket claims (OBC) to avoid resource starvation and increase the usage of the storage provided via bucket. This feature is currently in Developer Preview.

It is important to notice that NooBaa uses a non-strict quota, which means that the quota calculation is based on statistics aggregation. A statistics calculation cycle is executed every few minutes (2m) and therefore it will only limit the client when the number of objects or its size exceeds the quota after the next statistics calculation cycle ends.

Diagnostic Steps

  • You can confirm existing quota value with command

    % noobaa bucket status test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76
    
    Bucket status:
      Bucket                 : test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76
      OBC Namespace          : default
      OBC BucketClass        : noobaa-default-bucket-class
      Type                   : REGULAR
      Mode                   : OPTIMAL
      Force Md5 Etag         : false
      ResiliencyStatus       : OPTIMAL
      QuotaStatus            : OPTIMAL
      Num Objects            : 0
      Data Size              : 0.000 B
      Data Size Reduced      : 11.026 MB
      Data Space Avail       : 1.000 GB <<------
      Num Objects Avail      : 9007199254740991
    
  • A new file uploaded will reduce the "Data Space Avail " , example after copy a file of 372M to the bucket:

    % noobaa bucket status test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76
    
    Bucket status:
      Bucket                 : test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76
      OBC Namespace          : default
      OBC BucketClass        : noobaa-default-bucket-class
      Type                   : REGULAR
      Mode                   : OPTIMAL
      Force Md5 Etag         : false
      ResiliencyStatus       : OPTIMAL
      QuotaStatus            : OPTIMAL
      Num Objects            : 1
      Data Size              : 372.174 MB
      Data Size Reduced      : 372.180 MB
      Data Space Avail       : 651.826 MB <<------
      Num Objects Avail      : 9007199254740991
    
  • When the bucket has reached its quota it will report something like this:

    Bucket status:
      Bucket                 : test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76
      OBC Namespace          : default
      OBC BucketClass        : noobaa-default-bucket-class
      Type                   : REGULAR
      Mode                   : EXCEEDING_QUOTA
      Force Md5 Etag         : false
      ResiliencyStatus       : OPTIMAL
      QuotaStatus            : EXCEEDING_QUOTA
      Num Objects            : 2
      Data Size              : 1.139 GB
      Data Size Reduced      : 1.128 GB
      Data Space Avail       : -142.049 MB
      Num Objects Avail      : 9007199254740991
    
  • New files upload or copied to that bucket will fail like this:

    % s3 cp vi_cheat_sheet.pdf s3://test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76/
    
    upload failed: vi_cheat_sheet.pdf to s3://test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76/vi_cheat_sheet.pdf An error occurred (ObjectQuotaExceeded) when calling the PutObject operation: Object quota exceeded for the bucket.
    

    ... and the expected error logs can be found on noobaa-endpoint pod logs

      # oc logs noobaa-endpoint-6d5c5c5f69-zfnjl
    
      Aug-29 8:24:07.630 [Endpoint/13]    [L0] core.endpoint.s3.ops.s3_put_object:: PUT OBJECT test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 vi_cheat_sheet.pdf  
      
      Aug-29 8:24:07.631 [Endpoint/13]    [L0] core.sdk.object_io:: upload_object: start upload { bucket: 'test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76', key: 'vi_cheat_sheet.pdf', content_type: 'application/pdf', content_encoding: undefined, size: 62661, md5_b64: 'rEJMqyn8lK11HTtjbkLcdA==', sha256_b64: undefined, xattr: {}, tagging: undefined, encryption: undefined, lock_settings: undefined, storage_class: 'STANDARD' }
      
      Aug-29 8:24:07.634 [Endpoint/13] [ERROR] core.server.object_services.object_server:: Bucket test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 exceeded its configured size quota of 1073741824, 
      
      Aug-29 8:24:07.636 [Endpoint/13] [ERROR] CONSOLE:: RPC._on_request: ERROR srv object_api.create_object_upload reqid 42632@fcall://fcall(7phifb7h) connid fcall://fcall(7phifb7h) Error: Bucket test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 exceeded its configured size quota of 1073741824,     at check_quota (/root/node_modules/noobaa-core/src/server/object_services/object_server.js:1714:15)
      
      Aug-29 8:24:07.637 [Endpoint/13] [ERROR] core.rpc.rpc:: RPC._request: response ERROR srv object_api.create_object_upload reqid 42632@fcall://fcall(7phifb7h) connid fcall://fcall(7phifb7h) params { bucket: SENSITIVE-a374ae8503bf1591, key: 'vi_cheat_sheet.pdf', content_type: 'application/pdf', content_encoding: undefined, size: 62661, md5_b64: 'rEJMqyn8lK11HTtjbkLcdA==', sha256_b64: undefined, xattr: {}, tagging: undefined, encryption: undefined, lock_settings: undefined, storage_class: 'STANDARD' } took [3.5+2.2=5.6] [RpcError: Bucket test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 exceeded its configured size quota of 1073741824,   rpc_code: 'OBJECT_QUOTA_EXCEEDED'
      
      Aug-29 8:24:07.637 [Endpoint/13]  [WARN] core.sdk.object_io:: upload_object: failed upload { bucket: 'test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76', key: 'vi_cheat_sheet.pdf', md_conditions: undefined } [RpcError: Bucket test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 exceeded its configured size quota of 1073741824,   rpc_code: 'OBJECT_QUOTA_EXCEEDED'
      
      Aug-29 8:24:07.638 [Endpoint/13] [ERROR] core.endpoint.s3.s3_rest:: S3 ERROR <?xml version="1.0" encoding="UTF-8"?><Error><Code>ObjectQuotaExceeded</Code><Message>Object quota exceeded for the bucket.</Message><Resource>/test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76/vi_cheat_sheet.pdf</Resource><RequestId>mewkglvl-229rz5-93w</RequestId></Error> PUT /test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76/vi_cheat_sheet.pdf {"accept-encoding":"identity","content-type":"application/pdf","user-agent":"aws-cli/2.13.22 Python/3.11.5 Darwin/24.6.0 exe/x86_64 prompt/off command/s3.cp","content-md5":"rEJMqyn8lK11HTtjbkLcdA==","expect":"100-continue","x-amz-date":"20250829T082407Z","x-amz-content-sha256":"UNSIGNED-PAYLOAD","authorization":"AWS4-HMAC-SHA256 Credential=5NuUJ2ZFuKExDppUa3ci/20250829/us-east-1/s3/aws4_request, SignedHeaders=content-md5;content-type;host;x-amz-content-sha256;x-amz-date, Signature=46cbaca1c40479fd0486b69f461fca72d2ff33f0569143f70c83a84b16ca7a64","content-length":"62661","host":"s3-openshift-storage.apps.odf-416-new.prod.psi.pnq2.redhat.com","x-forwarded-host":"s3-openshift-storage.apps.odf-416-new.prod.psi.pnq2.redhat.com","x-forwarded-port":"443","x-forwarded-proto":"https","forwarded":"for=10.44.32.114;host=s3-openshift-storage.apps.odf-416-new.prod.psi.pnq2.redhat.com;proto=https","x-forwarded-for":"10.44.32.114"} [RpcError: Bucket test-quota-99466203-a2d7-4380-a1c8-ed854ecfff76 exceeded its configured size quota of 1073741824,   rpc_code: 'OBJECT_QUOTA_EXCEEDED'
    
SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.