How to setup the Rackspace storage quota for CloudBacko users?

Frequently asked questions about Rackspace.

How to setup the Rackspace storage quota for CloudBacko users?

Postby rafael » Wed Nov 19, 2014 5:35 pm

.
.
Introduction:

This chapter will show you how to setup the container quota in the Rackspace for your CloudBacko users to backup on Rackspace storage container.

If you are new to Rackspace, you should check with their documentation on general setup available at http://support.rackspace.com/

If you have tried Rackspace before, you can follow our steps to setup the container quota for your CloudBacko users. Our steps will guide you to complete the followings:

  • collect the access token
  • use the access token to set the quota in the container of a tenant

After you have completed these steps, the container quota can be set.


Assumption:

Before setting up storage quota in the steps below, we assumed that the storage has already created on your Rackspace by CloudBacko. The name of the container is named in the following syntax "cloudbacko-<username>".


Setup:

Step 1: Login to your Rackspace Cloud Control Panel.

Collect your users' API key from the “User Management” > Username (Click on the user name that you need to get the API key.) > Login Details > API Key

005.png
005.png (73.39 KiB) Viewed 1377 times


Click on “Show” to display the masked key.

006.png
006.png (14 KiB) Viewed 1377 times



Step 2: Obtain the access token.

Connect to a Linux machine with the curl package. To obtain the access token, you need to use the curl command to post the request to the Rackspace server.

Usage: curl -v -k -s https://identity.api.rackspacecloud.com/v2.0/tokens -X "POST" -d "{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"<user name>\", \"apiKey\":\"<API Key>\"}}}" -H "Content-Type: application/json"

Note: The API key can be collected from previous step.

Example
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@os ~]# curl -v -k -s https://identity.api.rackspacecloud.com/v2.0/tokens -
X "POST" -d "{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"DavidCha
n\", \"apiKey\":\"778b2d84b63334e36a2d841339663446\"}}}" -H "Content-Type: appli
cation/json"
* About to connect() to identity.api.rackspacecloud.com port 443 (#0)
* Trying 72.3.138.129... connected
* Connected to identity.api.rackspacecloud.com (72.3.138.129) port 443 (#0)
:
:
:
Trimmed
:
:
:
{"access":{"token":{"id":"e85127fa63824a9f85ba437d1061b5c0","expires":"2014-11-1
8T07:26:16.071Z","tenant":{"id":"926819","name":"926819"},"RAX-AUTH:authenticate
dBy":["APIKEY"]},"serviceCatalog":[{"name":"cloudFilesCDN","endpoints":{"region"
:"HKG","tenantId":"MossoCloudFS_926819","publicURL":"https:\/\/cdn6.clouddrive.c
om\/v1\/MossoCloudFS_926819"},{"region":"SYD","tenantId":"MossoCloudFS_926819","
publicURL":"https:\/\/cdn4.clouddrive.com\/v1\/MossoCloudFS_926819"},{"region":"
DFW","tenantId":"MossoCloudFS_926819","publicURL":"https:\/\/cdn1.clouddrive.com
\/v1\/MossoCloudFS_926819"},{"region":"IAD","tenantId":"MossoCloudFS_926819","pu
blicURL":"https:\/\/cdn5.clouddrive.com\/v1\/MossoCloudFS_926819"},{"region":"OR
D","tenantId":"MossoCloudFS_926819","publicURL":"https:\/\/cdn2.clouddrive.com\/
v1\/MossoCloudFS_926819"}],"type":"rax:object-cdn"},{"name":"cloudFiles","endpoi
nts":[{"region":"HKG","tenantId":"MossoCloudFS_926819","publicURL":"https:\/\/st
orage101.hkg1.clouddrive.com\/v1\/MossoCloudFS_926819"
,"internalURL":"https:\/\/
snet-storage101.hkg1.clouddrive.com\/v1\/MossoCloudFS_926819"},
:
:
:
Trimmed
:
:
:
"user":{"id":"0c3001f01cb94856a87f8653ab875117","roles":[{"id":"10000256","descr
iption":"Object Store Admin Role for Account User","name":"object-store:admin"},
{"tenant* Connection #0 to host identity.api.rackspacecloud.com left intact * Cl
osing connection #0 Id":"926819","id":"6","description":"A Role that allows a us
er access to keystone Service methods","name":"compute:default"},{"tenantId":"Mo
ssoCloudFS_926819","id":"5","description":"A Role that allows a user access to k
eystone Service methods","name":"object-store:default"},{"id":"2","description":
"Default Role.","name":"identity:default"}],"name":"DavidChan","RAX-AUTH:default
Region":"HKG"
}}}[root@os ~]#
[root@os ~]#

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


The above highlighted value is required to collect before you can submit another curl commend to set the quota. As the returned string is long with scattered information, you can also use third party parser eg: JSON viewer to interpret the above string.

Note:
The above example is trimmed to fit into this document.
If you are using the JSON viewer, you need to copy the following string
{"access":{"token  ......Trimmed...... defaultRegion":"HKG"}}}
, and show it in the JSON viewer.


Step 3: Collect the information required before you set the quota.

To configure the quota, you need to extract the following 3 pieces of information from the string returned from the previous step.

  • Token id
  • RAX-AUTH:defaultRegion
  • endpoints public URL

and collect the container name from the Rackspace Cloud Control Panel.


3.1 token id

The token id can be collected in the token object.
e.g. e85127fa63824a9f85ba437d1051b5c0

Example
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
:
:
:
{"access":{"token":{"id":"e85127fa63824a9f85ba437d1061b5c0","expires":"2014-11-1
8T07:26:16.071Z","tenant":{"id":"926819","name":"926819"},"RAX-AUTH:authenticate
dBy":["APIKEY"]}
:
:
:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


From JSON Viewer:

J01.png
J01.png (12.36 KiB) Viewed 1377 times



3.2 RAX-AUTH:defaultRegion

The default region can be collected in the user object.
e.g. HKG

Example
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
:
:
:
"user":{"id":"0c3001f01cb94856a87f8653ab875117","roles":[{"id":"10000256","descr
iption":"Object Store Admin Role for Account User","name":"object-store:admin"},
{"tenant* Connection #0 to host identity.api.rackspacecloud.com left intact * Cl
osing connection #0 Id":"926819","id":"6","description":"A Role that allows a us
er access to keystone Service methods","name":"compute:default"},"tenantId":"Mos
soCloudFS_926819","id":"5","description":"A Role that allows a user access to ke
ystone Service methods","name":"object-store:default"},{"id":"2","description":"
Default Role.","name":"identity:default"}],"name":"DavidChan","RAX-AUTH:defaultR
egion":"HKG"
}}
:
:
:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


From JSON Viewer:

J02.png
J02.png (16.86 KiB) Viewed 1377 times



3.3 endpoints public URL

You need to find the endpoints public URL from serviceCatalog object, with the sub-object name called “cloudFiles”, search inside the endpoint with your default region (e.g. HKG), then you can find the public URL path.
e.g. https://storage101.hkg1.clouddrive.com/v1/MossoCloudFS_926819

Example
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
:
:
:
"serviceCatalog":[{"name":"cloudFilesCDN","endpoints":[{"region":"HKG","tenantId
":"MossoCloudFS_926819","publicURL":"https:\/\/cdn6.clouddrive.com\/v1\/MossoClo
udFS_926819"},{"region":"SYD","tenantId":"MossoCloudFS_926819","publicURL":"http
s:\/\/cdn4.clouddrive.com\/v1\/MossoCloudFS_926819"},{"region":"DFW","tenantId":
"MossoCloudFS_926819","publicURL":"https:\/\/cdn1.clouddrive.com\/v1\/MossoCloud
FS_926819"},{"region":"IAD","tenantId":"MossoCloudFS_926819","publicURL":"https:
\/\/cdn5.clouddrive.com\/v1\/MossoCloudFS_926819"},{"region":"ORD","tenantId":"M
ossoCloudFS_926819","publicURL":"https:\/\/cdn2.clouddrive.com\/v1\/MossoCloudFS
_926819"}],"type":"rax:object-cdn"},{"name":"cloudFiles","endpoints":[{"region":
"HKG","tenantId":"MossoCloudFS_926819","publicURL":"https:\/\/storage101.hkg1.cl
ouddrive.com\/v1\/MossoCloudFS_926819"
,"internalURL":"https:\/\/snet-storage101.
hkg1.clouddrive.com\/v1\/MossoCloudFS_926819"},
:
:
:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


From JSON Viewer:

J03.png
J03.png (24.97 KiB) Viewed 1377 times



3.4 Container name

After the backup set is created in the CloudBacko, the container name can be found in the “Files” tag in the Rackspace Cloud Control Panel
eg: cloudbacko-davidchan

012.png
012.png (47.33 KiB) Viewed 1377 times



Step 4: Set the container quota in tenant.

In this example, we will set the quota of the container to 2MB (2097152 bytes).

Usage: curl -v -k -X PUT -H "X-Container-Meta-Quota-Bytes: <quota>" -H "X-Auth-Token: <token id>" <endpoints public URL>/<container name>

Note:
The Rackspace container URL is the endpoints public URL and the container name that was created for your user, which is

https://storage101.hkg1.clouddrive.com/v1/MossoCloudFS_926819 and cloudbacko-davidchan
You need to put a slash "/" in between the 2 values.
Eg: https://storage101.hkg1.clouddrive.com/v1/MossoCloudFS_926819/cloudbacko-davidchan

Example
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@os ~]# curl -v -k -X PUT -H "X-Container-Meta-Quota-Bytes: 2097152" -H "X-
Auth-Token: e85127fa63824a9f85ba437d1061b5c0" https://storage101.hkg1.clouddrive
.com/v1/MossoCloudFS_926819/cloudbacko-davidchan
* About to connect() to storage101.hkg1.clouddrive.com port 443 (#0)
* Trying 119.9.64.232... connected
* Connected to storage101.hkg1.clouddrive.com (119.9.64.232) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: CN=storage101.hkg1.clouddrive.com,OU=Domain Validated,OU=Thawte
SSL123 certificate,OU=Go to https://www.thawte.com/repository/index.html
* start date: Aug 15 00:00:00 2013 GMT
* expire date: Aug 15 23:59:59 2015 GMT
* common name: storage101.hkg1.clouddrive.com
* issuer: CN=Thawte DV SSL CA,OU=Domain Validated SSL,O="Thawte, Inc.",C=U
S
> PUT /v1/MossoCloudFS_926819/cloudbacko-davidchan HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zl
ib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: storage101.hkg1.clouddrive.com
> Accept: */*
> X-Container-Meta-Quota-Bytes: 2097152
> X-Auth-Token: e85127fa63824a9f85ba437d1061b5c0
>
< HTTP/1.1 202 Accepted
< Content-Length: 76
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx682827faeba84b3bba3ee-005469b15ahkg1
< Date: Mon, 17 Nov 2014 08:27:06 GMT
<
* Connection #0 to host storage101.hkg1.clouddrive.com left intact
* Closing connection #0
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>[roo
t@os ~]#
[root@os ~]#

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


When you see the “Accepted” message returned, the 2MB quota is set successfully.
.
.
.
.
.
Rafael Ho
CloudBacko Forum Support
The Most Secure Cloud & Local Backup Software
User avatar
rafael
Site Admin
 
Posts: 998
Joined: Thu Jun 12, 2014 4:41 pm

Return to FAQs

Who is online

Users browsing this forum: No registered users