Install Devstack on Linux

Introduction

DevStack lets you interact with openstack on a small scale that’s representative of a much larger deployment. Devstack helps you deploy the same openstack components found in large multi-server environments on a single server. You can quickly deploy devstack. Insted of deploying Controller and compute node separately on different VMs/system we use sing VMs/system to run openstack, and its nothing but devstack.


In this article we are installing devstack on Ubuntu 16.04.
You can install devstack on any Linux distribution(Ubuntu/CentOS/RHEL)

Install devstack:
Update local packages:

# sudo apt-get -y update

Install git

# sudo apt-get -y install git

Using git, retrieve the latest release of devStack to /opt/devsatck directory:

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

DON’T STACK AS ROOT. If you try to stack as the root user with devStack, the process will fail with an error scolding you for running the script as the root user.

Enter Into devstack directory:

# cd /opt/devstack/

Create the stack user and set ownership of all devStack files to that user:

# sudo chmod u+x tools/create-stack-user.sh
# sudo tools/create-stack-user.sh
Creating a group called stack
Creating a user called stack
Giving stack user passwordless sudo privileges

Makes stack user owner of all files in directory:

# sudo chown -R stack:stack /opt/devstack/

Your directory has now been prepared with appropriate permissions, and a new user has been created.

Switches to stack user

# sudo -i -u stack

Go into /devstack directory:

# cd /opt/devstack/

Creating local.conf in /devstack directory. You’ll build your local.conf file, which is used by devStack to configure your deployment

# vim local.conf

# Credentials
ADMIN_PASSWORD=test
MYSQL_PASSWORD=test
RABBIT_PASSWORD=test
SERVICE_PASSWORD=test
SERVICE_TOKEN=token

# Output
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=False
SCREEN_LOGDIR=/opt/stack/logs

Execute stack.sh:

# ./stack.sh

Go ahead your devstack is installed successfully. Access the Dash-board by entering the following URL into your browser:

http://<your host_ip>

Enter the following user name and password:

User name : admin/demo
Password : test


 Lets start exploring devstack!


This is how instances in devstack will look like:
I have created two instances inst1 and my_test you can see details of any instance by just clicking on instance name.


Restart devstack:

After restart of your machine we want our devstack in last session state then use following commands:
# screen -c stack-screenrc

Remember :There may chance of error like:
Cannot open your terminal '/dev/pts/7' - please check. Means you require root privileges. So run above command using root.

Uninstall devstack:

How to remove devstack from system:
Its very simple just enter following command:

# ./unstack.sh
# ./clean.sh
# sudo rm -rf /opt/stack
# sudo reboot

That's all in this article. Don't forget to share your views in comment section below.

0 comments:

Post a Comment