Sunday 2 February 2014

DevStack Installation for beginners !

Introduction to DevStack:

DevStack :  An OpenStack program created by Rackspace Cloud Builders.

OpenStack, a cloud-computing project, aims to provide the open source cloud computing platform for public and private clouds. OpenStack project is provided under the Apache 2.0 license. Openstack.org is powered by Rackspace Cloud Computing. The  DevStack is the best way to get started with OpenStack. Because OpenStack setup and configurations are damn complicated ! 



For those wanting to set up a flexible dev/test environment that can support multiple networking modes and have multiple deployment options, DevStack is the better choice. It has a higher skill requirement, but in the process of installing and deploying with DevStack, you’ll learn how OpenStack daemons work and gain knowledge on how to customize the deployment. DevStack is better at preparing OpenStack installers for building and managing OpenStack Clouds with varying configurations.

Step 1 :Select a Linux Distribution
Only Ubuntu 12.04 (Precise), Fedora 20 and CentOS/RHEL 6.5 are recommended . OpenStack also runs on other flavors of Linux such as OpenSUSE and Debian.

Step 2 :Install Selected OS
In order to correctly install all the dependencies, we assume a specific minimal version of the supported distributions to make it as easy as possible. We recommend using a minimal install of Ubuntu or Fedora server in a VM.

apt-get update || yum update -y
apt-get install -qqy git || yum install -y git

Step 3: Download DevStack

git clone https://github.com/openstack-dev/devstack.git

Step 4: Configure  and Set up your localrc file:

While optional, we recommend a minimal configuration be set up as you may not want our default values for everything.

The localrc file is configuration file that the devstack script uses. If  this file is not available in package, then create your own localrc file. Here is the sample localrc file

ubuntu:/opt/devstack# cat localrc
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_TOKEN=password
SERVICE_PASSWORD=password
ADMIN_PASSWORD=password
FLOATING_RANGE=192.168.10.0/27
FLAT_INTERFACE=eth0
LOGFILE=/home/stack/stack.sh.log
Q_FLOATING_ALLOCATION_POOL=start=192.168.10.10,end=192.168.10.20
PUBLIC_NETWORK_GATEWAY=192.168.10.1

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
# Optional, to enable tempest configuration as part of devstack
enable_service tempest
 ---------------------------------------------------------------------------------------------
Step 5: Switch to Havana Branch:

root@ubuntu:/opt/devstack# git checkout stable/havana
Branch stable/havana set up to track remote branch stable/havana from origin.
Switched to a new branch 'stable/havana'
root@ubuntu:/opt/devstack#

------------------------------------------------------------------
Step 6:Start the install

cd devstack; ./stack.sh

.
.
.
.
.
.
Horizon is now available at http://9.124.45.203/                         
Keystone is serving at http://9.124.45.203:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo       ================>Login User
The password: password
This is your host ip: 9.124.45.203
stack.sh completed in 375 seconds.
stack@ubuntu:/opt/devstack$


It takes  30 minutes to an hour for complete installation-   depending on your network speed. Please check the logs for any failures.Make a note of URL  and user details to login to Horizon Dashboard as shown above.
-------------------------------------------------------------
Step 7: Now  you need to set the openStack variables  like OS_USERNAME, OS_PASSWORD etc

                      source .openrc
---------------------------------------------------------------
Step 8:  Check basic  nova commands  form CLI

stack@ubuntu:/opt/devstack$ nova credentials
+------------------+-----------------------------------------------+
| User Credentials | Value                                         |
+------------------+-----------------------------------------------+
| id               | de4f93a0ba7f498183a0bb76e1d7dd31              |
| name             | demo                                          |
| roles            | [{"name": "Member"}, {"name": "anotherrole"}] |
| roles_links      | []                                            |
| username         | demo                                          |
+------------------+-----------------------------------------------+
+-----------+------------------------------------------------------------------+
| Token     | Value                                                            |
+-----------+------------------------------------------------------------------+
| expires   | 2014-02-01T09:55:17Z                                             |
| id        | MIINpwYJKoZIhvcNAQcCoIINmDCCDZQCAQExCTAHBgUrDgMCGjCCC-           |
|           | 0GCSqGSIb3DQEHAaCCC+4EggvqeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZW |
|           | RfYXQiOiAiMjAxNC0wMi0wMVQwODo1NToxNy4zMjQxMzEiLCAiZXhwaXJlcyI6IC |
|           | IyMDE0LTAyLTAxVDA5OjU1OjE3WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW |
|           | 5hbnQiOiB7ImRlc2NyaXB0aW9uIjogbnVsbCwgImVuYWJsZWQiOiB0cnVlLCAiaW |
|           | QiOiAiODc0NWM0MjhkNWI3NGI3N2IxYjkwOTg3NjhjNTBiYmMiLCAibmFtZSI6IC |
|           | JkZW1vIn19LCAic2VydmljZUNhdGFsb2ciOiBbeyJlbmRwb2ludHMiOiBbeyJhZG |
|           | 1pblVSTCI6ICJodHRwOi8vOS4xMjQuNDUuMjAzOjg3NzQvdjIvODc0NWM0MjhkNW |
|           | I3NGI3N2IxYjkwOTg3NjhjNTBiYmMiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsIC |
|           | JpbnRlcm5hbFVSTCI6ICJodHRwOi8vOS4xMjQuNDUuMjAzOjg3NzQvdjIvODc0NW |
|           | .
.
.
.                     |
| issued_at | 2014-02-01T08:55:17.324131                                       |
| tenant    | {"enabled": true, "description": null, "name": "demo", "id":     |
|           | "8745c428d5b74b77b1b9098768c50bbc"}                              |
+-----------+------------------------------------------------------------------+
--------------------------------------------------------------------------------------

Step 9: List of  images available by default:





Step 10: Download new image  from  http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img



Step 11: Import  this downloaded image - precise-server-cloudimg-amd64-disk1.img



Step 12:   List of images after import

stack@ubuntu:/opt/devstack$ glance image-create --name sachin_ubuntu_image --disk-format=qcow2 --container-format=ovf --is-public=True < precise-server-cloudimg-amd64-disk1.img 
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 513cc24a4f527eb93a076f13f7f4fa96     |
| container_format | ovf                                  |
| created_at       | 2014-02-01T09:05:25                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | 4d0a65ee-338b-4e6b-98b8-ceedcb0f6402 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | sachin_ubuntu_image                  |
| owner            | 8745c428d5b74b77b1b9098768c50bbc     |
| protected        | False                                |
| size             | 255459328                            |
| status           | active                               |
| updated_at       | 2014-02-01T09:06:03                  |
+------------------+--------------------------------------+
stack@ubuntu:/opt/devstack$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID                                   | Name                            | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 174e15b1-f2e5-4979-961f-f62c592e7df8 | cirros-0.3.1-x86_64-uec         | ACTIVE |        |
| 529b5271-7014-418e-af05-d521660e7c3e | cirros-0.3.1-x86_64-uec-kernel  | ACTIVE |        |
| 2f026b26-2470-4d59-89eb-95460e88f304 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE |        |
| 4d0a65ee-338b-4e6b-98b8-ceedcb0f6402 | sachin_ubuntu_image             | ACTIVE |        |
+--------------------------------------+---------------------------------+--------+--------+
stack@ubuntu:/opt/devstack$

Step 13: Verify the Image repo @ Horizon Dashboard:




Step 14: Deploy this image  and then use OpenStack-native ReST APIs  listed in  http://api.openstack.org/api-ref.html

The technology consists of a series of interrelated projects that control pools of processing, storage, and networking resources throughout a datacenter, able to be managed or provisioned through a web-based dashboard, command-line tools, or a RESTful API.


Hope this helps!  We will  discuss more on other openStack components in later blogs .

3 comments:

  1. Open Stack Cloud Computing Online Training
    http://www.21cssindia.com/courses/open-stack-online-training-224.html
    Introduction - Virtualization Overview - Software as a service - patform as a service - Infrastructure as a Service - Openstack – History and Overview - Q&A - OpenStack Architecture DeepDive - Components Overview - Keystone architecture - Nova architecture - Glance architecture - Quantum architecture - - Deploying OpenStack – Step by Step through CLI - Getting the pre-requisites right - Setting up MySQL, RabbitMQ - Setting up Keystone - Setting up Glance - Setting up Horizon - Creating accounts and users - Deploying OpenStack – Step by Step through CLI - Understanding Cloud Images and instances - Building an image for Cloud - Registering and uploading an image - Setting up Nova - Running an image - Creating keypairs, Security Groups - Managing Instances - Deploying OpenStack – Advanced - Multi-node Environment - Differences between single and multi-node setup - DevStack – Scripted installation for OpenStack - DevStack – Script Discussion - Log Files, Troubleshooting, Common Errors - Openstack API - Introduction - Nova APIs - Consuming the APIs – demo - openstackforums, User Groups, ML, Documentation - Openstack Foundation. - Employees to learn at their own pace and maintain control of learning “where, when and how” with boundless access 24/7by 21st Century Software Solutions. contact@21cssindia.com
    http://www.21cssindia.com

    ReplyDelete
  2. Open Stack Cloud Computing Key words: Open stack training , Open stack online Training , Open stack cloud computing training , open stack cloud computing online training ,Open stack Corporate Training,Best Open stack training, Open stack cloud computing training, Expert Open stack Training , Expert Openstack Cloud Computing Training
    http://www.21cssindia.com/courses/open-stack-online-training-224.html

    ReplyDelete
  3. OpenStack Cloud Computing Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/open-stack-online-training-224.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, If you’re serious about a career in IT, 21st Century would like to provide you a guidance don’t hesitate to organize a free demo session. For any further information regarding the courses once go through our website Visit: http://www.21cssindia.com | Call Us +917386622889 - +919000444287 - contact@21cssindia.com

    ReplyDelete