Devstack in single system


How to configure Devstack in a single system-

 DevStack is an opinionated script to quickly create an OpenStack development environment.

Installation Steps

Add your user

We need to add a user to install DevStack. (if you created a user during install you can skip this step and just give the user sudo priviledges below)
adduser stack
Since this user will be making many changes to your system, it will need to have sudo priviledges.
apt-get install sudo -y
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
From here on you should use the user you created. Logout and login as that user.

Download DevStack

We'll grab the latest version of DevStack via git
sudo apt-get install git -y
git clone git://github.com/openstack-dev/devstack.git
cd devstack

Configure localrc


Your devstack/localrc file should be like this

FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.240.14.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=root
RABBIT_PASSWORD=rabbit
SERVICE_PASSWORD=cdac
SERVICE_TOKEN=admin


Configure devstack/stackrc

Around line no 184,You have to put the image location (mainly from prebuilt OS image). You can add multiple images separated by ,

Here my line is like this

IMAGE_URLS="http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-amd64.tar.gz","http://cloud-images.ubuntu.com/releases/10.04/release/ubuntu-10.04-server-cloudimg-i386.tar.gz","http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz","http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-i386.tar.gz"

Building Cloud:-

Now run
$./stack.sh

This will build the devstack cloud.

Setting environment variables

After successfully done building,you have to configure these environment variables

export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://10.240.8.29:5000/v2.0/

Available images

See the images available in your system

nova image-list

+--------------------------------------+-------------------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-------------------------------------------+--------+--------+
| d51df08c-57e4-4dcb-9b7b-bbe2df425095 | cirros-0.3.1-x86_64-uec | ACTIVE | |
| f35cd538-4c4f-4744-ad4b-9c628af1a7b9 | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| 13c37dd1-fd88-4c93-9606-646c6a121c74 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
| 0c02b817-f15a-4763-bcfd-c4b1a296dd32 | precise-server-cloudimg-i386 | ACTIVE | |
| 478b7945-2d40-4f21-bfad-05f451d4f7f5 | precise-server-cloudimg-i386-kernel | ACTIVE | |
| 0292ca63-3ae6-46ae-bab1-5457c134b2d1 | ubuntu-10.04-server-cloudimg-i386 | ACTIVE | |
| c23433a6-c7d6-4794-8273-2e025a542d3d | ubuntu-10.04-server-cloudimg-i386-kernel | ACTIVE | |
| 3d4c05ea-8f46-4228-91a6-92a73a85b552 | ubuntu-11.10-server-cloudimg-amd64 | ACTIVE | |
| 1ac4d04b-83b7-4c94-876f-148148f23076 | ubuntu-11.10-server-cloudimg-amd64-kernel | ACTIVE | |
+--------------------------------------+-------------------------------------------+--------+--------+

Create Keypair

Create a keypair so you can ssh to the instance:
$nova keypair-add testkousik > test.pem
$chmod 600 test.pem

Run (boot) a test instance:
nova boot --image precise-server-cloudimg-i386 --flavor m1.small --key_name testkousik testubuntu

    --image: the name or ID of the image we want to launch, as shown in the output of nova image-list
    --flavor: the name or ID of the size of the instance to create (number of vcpus, available RAM, available storage). View the list of available flavors by running nova flavor-list
    -key_name: the name of the key to inject into the instance at launch.





Login to your instance


ssh -i test.pem -l ubuntu 10.240.14.2


Reference


No comments:

Post a Comment