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



Wednesday 16 November 2011

How to add vmware and VirtualBox image in openstack

VMware

Vmware will create vm with disk image *.vmdk , first locate the file (you can do this by selecting the setting of corresponding vm and select "Hard Disk(scsi) or usualy it will be in "Virtual Machine" folder created during vmware installation)
Then copy the file in to your openstack cloud system (you can use scp for this).

glance add -A <admin_password> name="<image name>" is_public=true container_format=bare disk_format=vmdk < myvm.vmdk

NOTE : change
<admin_password> = your glance admin password
<image name>         =  name of image , this name will be shown  in your dashboard after you upload
 myvm.vmdk            = your virtual machine name .vmdk(the file which you coppied)



Another method you may think of is using ova and ovf which you can create by using vmware export option . But you can not add .ova file in your openstack cloud since it is not support by glance. And you can not add *.ovf which is created by vmware because current vmwareapi driver of nova supports only thick flat vmdk disk so you can only add *.vmdk file

(I conformed by asking it in openstack group at launchpad.net  https://answers.launchpad.net/glance/+question/178944 )

VirtualBox

  In case of VirtualBox it create vm with disk image *.vdi as default. Locate it and copy to your openstack cloud system

glance add -A <admin_password> name="<image name>" is_public=true container_format=bare disk_formate=vdi < myvm.vdi

NOTE : change
<admin_password> - your glance admin password
<image name>         -  name of image , this name will be shown  your dashboard after you apploaded
myvm.vdi                 -  your virtual machine name .vmdk(the file which you coppied)



Thank you all..