Friday, 25 October 2013

RACKSPACE CLOUD FILES FROM THE COMMAND LINE


It is also possible to control your rackspace cloud files using the openstack swift client, the first thing we need to do is install the package



[ nitin@nitin-ubuntu:~ ]# sudo spt-get install python-swiftclient keystone



Create the file rack.sh this file will be used to setup our environment anytime we want to use swift, it should look something like this 



[ nitin@nitin-ubuntu:~ ]# sudo vim /etc/profile.s/rack.sh



export OS_USERNAME=MossoCloudFS_22321312740217423749237492:myusername
export OS_PASSWORD=mypassword
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/



[ nitin@nitin-ubuntu:~ ]# keystone tenant-list





+---------------------------------------------------+---------------------------------------------------+---------+
|                         id                        |                        name                       | enabled |
+---------------------------------------------------+---------------------------------------------------+---------+
| MossoCloudFS_22321312740217423749237492    True  |
+---------------------------------------------------+---------------------------------------------------+---------+

If you worked through my last post you’ll notice some differences about this file, two differences we 
should note

OS_TENANT_NAME : for the version of swift client I am using this is absent but in future versions it may be back again, in which case os_tenant_name should be set to the tenant name and the value for OS_USERNAME should not contain the tenant name
OS_USERNAME : this contains the tenant name, in addition to the user name but it is not the same as the tenant name we used for nova. On rackspace a different tenant is used for cloud servers and cloud files. What we need to do is get the tenant name for our cloud files account. In order to get this you can run the command below (replace the username and password in the command)



[ nitin@nitin-ubuntu:~ ]#  source /etc/profile

Now your ready, lets go
List all of container 
[ nitin@nitin-ubuntu:~ ]# Swift list







No comments:

Post a Comment

Ansible Cheat sheet

Install Ansible  # yum install ansible Host file configuration  File  [ansible@kuber2 ~]$ cat /etc/ansible/hosts     [loca...