Wednesday 23 November 2011

Using ec2ools(eucalyptus) with keystone in openstack

Eucalyptus ec2ools is a comment line API tools used for managing instances in Amazon Elastic Cloud.
OpenStack uses this as a comment line API tools in the same way as AEC2 to manage openstack compute (NOVA).

Once you install openstack nova with out installing keystone and dashboard  you can use ec2ools to run,reboot,terminate the  instances,uploading and remove images,allocating and un allocate  floatting public ip address,associate ip with instances,etc..(for more details refer http://wiki.magellancloud.org/index.php/List_of_Eucalyptus_Commands )


If you want to use dashboard for managing openstack cloud , you  have to use keystone for identification and authentication , there is no other option. Even it is simple to make ec2ools work with keystone  people (including me) initially have some difficulty .This post will explain how I fixed this problem.

In Cloud Controller (server) side

1.Make sure you have created the user (either by using dashboard or keystone-manage http://docs.openstack.org/diablo/openstack-identity/admin/content/creating-tenants-users-roles-tokens-and-endpoints.html )

2.Adding Credentials in keystone for using ec2ools by using
keystone-manage credentials add admin EC2 'user name' 'secretpassword'

done now go to client machine .

In Client Side(ubuntu)

1. Install ec2ools  use " sudo apt-get intal euca2ools".
2.Setting environmental variables by create a small rc file (examplerc)with


# Set the ec2 url so euca2ools works
export EC2_URL=${EC2_URL:-http://$HOST_IP:8773/services/Cloud}

# Access key is set in the initial keystone data to be the same as username
export EC2_ACCESS_KEY=${USERNAME:-username}

# Secret key is set in the initial keystone data to the admin password
export EC2_SECRET_KEY=${ADMIN_PASSWORD:-secretepassword}

3. check  echo $EC2_ACCESS_KEY and echo $EC2_SECRET_KEY give the proper values

If yes go to next step otherwise set environmental  variable directly by giving these commands

export EC2_ACCESS_KEY=xyz
export EC2_SECRET_KEY=PASSWORD

then verify again.

4.Now you are ready to work with ec2ools tools. you can check it by giving below comment


euca-describe-availability-zones verbose

you will get output like
-
AVAILABILITYZONE nova available
AVAILABILITYZONE |- cloud
AVAILABILITYZONE | |- nova-scheduler enabled :-) 2011-11-24 07:58:17
AVAILABILITYZONE | |- nova-volume enabled :-) 2011-11-24 07:58:17
AVAILABILITYZONE | |- nova-network enabled :-) 2011-11-24 07:58:17
AVAILABILITYZONE | |- nova-compute enabled :-) 2011-11-24 07:58:12

Thank you



No comments:

Post a Comment