Thursday, 24 October 2013

RACKSPACE CLOUD SERVERS FROM THE COMMAND LINE



With rackspaces providing its compute service based on OpenStack, its possible to control your servers using the openstack nova client and its fairly simple to do.
You start by installing the openstack-novaclient (these examples are done on fedora 17). For now python-setuptools is needed here as a dependency.
step 1 :- 
[ nitin@nitin-ubuntu:~ ]#   sudo yum install python-setuptools python-novaclient

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


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

export OS_USERNAME=username
export OS_PASSWORD=passwd
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_REGION_NAME=DFW
export OS_TENANT_NAME=1234567
export NOVA_SERVICE_NAME=cloudServersOpenStack


OS_USERNAME : This is your login name for your rackspace Open Cloud accountOS_PASSWORD : Your password….OS_AUTH_URL : this is the url to the rackspaces identity managment server, if you have a rackspace.co.uk account then this should be set to https://lon.identity.api.rackspacecloud.com/v2.0/ , leave it as above if your rackspace account is.com
OS_REGION_NAME : the code for the data center in which you want to control servers (DFW is Dallas, ORD Chicago, LON London), Use DFW or ORD if rackspace.com or LON if rackspace.co.ukOS_TENANT_NAME : the id for your account, you can get this in the top right hand corner of the control panel when you log in
[ nitin@nitin-ubuntu:~ ]#  source /etc/profile

Now your ready, lets go
List all of your running servers
[ nitin@nitin-ubuntu:~ ]#  nova 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...