In previous posts I showed how to deploy and configure object data services with EMC ViPR. This blog will show you how to leverage the Swift API published by EMC ViPR to be used by Openstack Glance.
--This Blog was Update Feb 2014 for ViPR 1.1
The Swift API published by ViPR allows applications to be configured to directly use object storage. Jason Cwik of EMC has published material on the EMC community network (link1, link2) that shows how to configure JOSS, or Apache jclouds applications that have been written against the Swift API to use ViPR. He’s also published a doc on how to configure the Swift password (link3), details on this configuration are below.
Glance is an Openstack project designed to provide image management services including discovery, registration, and delivery services for disk and server images. Glance can use local storage or be configured to use remote storage from Swift.
The rest of this blog will show you how to create the user and password for swift and configure glance to use it.
SETUP TENANT and USER
Download the swift_tools.tar.gz file from ECN https://community.emc.com/docs/DOC-27599 Extract it: tar –zx swift_tools.tar.gz Change into the swift_tools directory cd swift_tools There are 3 scripts in this directory. bourne.py = Sets the variable environment for ViPR services security = Sets the login information password.py = Set the tenant container and user/password to access it. |
|
Create the environment for ViPR vApp and Data services Export BOURNE_IPADDR=10.10.81.69 Export BOURNE_DATA_IPADDR=10.10.81.155 Logon to ViPR with the environment and correct user and password NOTE: Username and password are the credentials used to logon to the ViPR GUI ./security login root P@ssword1 |
|
Once the login is complete you will see that you are logged in as root |
|
Create the username and password to access the tenant container. In the example above the Tenant is Swift, and this maps to the Tenant namespace created in the previous blog (HERE). It also creates a user named admin, with a password of password, and adds it to the ADMIN group. ./password.py create admin password Swift –groups ADMIN |
|
You can check the creation by listing the user admin. You should see the group [ADMIN] listed ./password.py list admin |
|
You can also use curl to check your connection curl –v –H X-Auth-User:admin –H X-Auth-Key:password http://10.10.81.155:9024/auth/v1.0 You should see the following returned http://10.10.81.155:9024/v1/Swift |
CONFIGURE GLANCE
Above are screeen shots of the data stores created in ViPR for Object Data services. this is a differnt name than the last blog post. In the glance-api.conf file this datastore repersents the Swift container name. |
|
|
|
Edit your glance configuration file vim /etc/glance/glance-api.conf Change the follwong values for store type, auth address, user, password, store container and create on put to the follwling. Note thahat container = data store, user/password were created with the password.py file, and auth address is the vipr dataservice ip address. ViPR only listens for swift on port 9024(http) and 9025(https)- (although you can’t sign ssl in glance so don’t use 9025 for glance)
default_store = swift swift_store_auth_version = 1 swift_store_auth_address = http://10.10.81.160:9024/auth/v1.0 swift_store_user = admin swift_store_key = password swift_store_container = HDFSObjectDataStore swift_store_create_container_on_put = True
Save and restart the service service openstack-glance-api restart Glance is now configured to use the ViPR Swift API.
|
|
We can verify Glance is using the Swift API by uploading and downloading an image. On the Horizon dashboard, under Admin, click Images |
|
Click Create new Image. In the example above we download the Cirros image from the web using this URL: https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img |
|
We can see the image is downloaded from the web and placed on ViPR. |
|
We can also see the image from the CLI by running glance image-list |
|
Next we’ll launch the instance. On the Horizon web GUI select project and Instances |
|
Click Launch Instance. Choose Boot from image and the Image name. |
|
The Image is downloaded from the ViPR Swift API and booted on the local KVM hypervisor. |
|
We can also see the running instance from the cli by typing nova list |
|
You can also check the image location by using cloudberry explorer http://www.cloudberrylab.com/free-openstack-storage-explorer. For authentcation key we use the FQDN or IP address of the ViPR dataservice node Use port 9025 ssl for authentication and auth/v1.0 We can see the container. If we drill into it we will see the image object.
|