ECS bucket available capacity

ECS bucket capacityHow much space do we have until reaching a bucket’s hard quota? Lets consider 2 simple ways to check that.

ECS GUI way

  • Check the bucket blocking (hard) and notification (soft) quotas.

ECS bucket quotas

  • Check the consumed space via Metering.

ECS bucket size via Metering

  • You double check a consumed via Cyberduck or S3 Browser.

ECS bucket size

ECS REST API way

  • Authenticate first
  • Auth token is stored into a cookie file
#curl -kv https://10.0.0.1:4443/login?using-cookies=true -u "root:password" -c cookiefile
*   Trying 10.0.0.1...
* TCP_NODELAY set
* Connected to 10.0.0.1 (10.0.0.1) port 4443 (#0)
* TLS 1.0 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate: localhost
* Server auth using Basic with user 'root'
> GET /login?using-cookies=true HTTP/1.1
> Host: 10.0.0.1:4443
> Authorization: Basic cm9vdDpDaGFuZ2VNZQ==
> User-Agent: curl/7.51.0
> Accept: */*

< HTTP/1.1 200 OK
< Date: Wed, 19 Apr 2017 17:04:46 GMT
< Content-Type: application/xml
< Content-Length: 93
< Connection: keep-alive
< X-SDS-AUTH-TOKEN: BAAcQTdVNERNZ…8=
* Added cookie X-SDS-AUTH-TOKEN="BAAcQTdVNERNZ…8=" for domain 10.0.0.1, path /, expire 1492650286
…
<loggedIn>root
  • Check how much space is consumed on the bucket.
  • total_size = 2GB
#curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info? | xmllint --format -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bucket_billing_info>
  <namespace>ns1</namespace>
  <name>ns1s3bucket1</name>
  <sample_time>2017-04-19T18:06:01Z</sample_time>
  <vpool_id>urn:storageos:ReplicationGroupInfo:e7e32a31-935a-44d0-905e-9410345d4913:global</vpool_id>
  <total_size>2</total_size>
  <total_size_unit>GB</total_size_unit>
  <total_objects>155</total_objects>
  <TagSet/>
</bucket_billing_info>
  • Check soft and hard quotas assigned on the bucket.
  • blockSize = 3GB
#curl -ks -b cookiefile https://10.0.0.1:4443/object/bucket/ns1s3bucket1/quota?namespace=ns1 | xmllint --format -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bucket_quota_details>
  <blockSize>3</blockSize>
  <bucketname>ns1s3bucket1</bucketname>
  <namespace>ns1</namespace>
  <notificationSize>2</notificationSize>
</bucket_quota_details>

So we consumed 2 of 3GB. Easy to write a simple script to check how much space we have till a hard quota is reached.

Note: Please be aware that quota checking is not online process. It is checked on a regular basis. So some little over-quota is possible when a load is intensive. With real bucket capacities such potential over-quota is negligible. But if we specify blocking quota as just several GBs, such over-quota can be visible. Don’t be confused by that. Quotas work as designed.

See more about ECS Metering –>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s