Skip to content

devstack install

debashish216 edited this page Mar 11, 2017 · 15 revisions

Openstack Cloud Deployment using devstack

In this example, a multi node openstack environment is demonstrated. The setup is a minimal realization having one controller node and one compute node. Both the nodes are created on top of two x86 machines with ubuntu 16.04 distribution.

Specifications
Software = devstack
Operating System = Ubuntu 16.04 
Other Ubuntu distributions also work fine.
Step-by-step Installation Procedure on Controller Node
System Requirement
4+ core CPU
100+ GB Storage
8+ GB RAM
Update and Upgrade ubuntu OS
sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot
User Account Creation
  • Create a user with sudo priviledges.
sudo adduser stack
  • Give "sudo" permission to the new user typing command sudo visudo. Add below line.
stack    ALL=(ALL:ALL) ALL
  • Navigate to the new user.
sudo su - stack
  • Export the path variable.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin
Get the software
  • Install "git" and clone the required software.
sudo apt-get update
sudo apt-get install git
git clone https://git.openstack.org/openstack-dev/devstack -b stable/newton
Environment Setup
  • Create a new file named as local.conf in your devstack folder.
sudo apt-get install vim
vim local.conf 
  • Edit the local.conf file with below content in the controller node. Make sure to update MY_IP, ADMIN_PASSWORD and PUBLIC_INTERFACE,FLOATING_RANGE,Q_FLOATING_ALLOCATION_POOL and PUBLIC_NETWORK_GATEWAY depending upon your machine configuration environment.

[[local|localrc]]
MY_IP=192.168.130.102
HOST_IP=$MY_IP
SERVICE_HOST=$MY_IP
MYSQL_HOST=$MY_IP
RABBIT_HOST=$MY_IP
GLANCE_HOSTPORT=$MY_IP:9292
ADMIN_PASSWORD=mypassword123
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="192.168.130.0/24"
IPV4_ADDRS_SAFE_TO_USE="10.0.0.0/22"
Q_FLOATING_ALLOCATION_POOL=start=192.168.130.200,end=192.168.130.254
PUBLIC_NETWORK_GATEWAY="192.168.130.1"
PUBLIC_INTERFACE=enp4s0

# Open vSwitch provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex

VNCSERVER_LISTEN=0.0.0.0

#Enable heat plugin
enable_plugin heat https://git.openstack.org/openstack/heat stable/newton
Run Instructions
sudo mkdir /opt/stack
sudo chown -R stack:stack devstack
sudo chown -R stack:stack /opt/stack/
cd devstack
./stack.sh

This installation procedure normally takes 30-45 minutes depending upon the Internet speed. In case of any errors, unstack it and rerun after fixing the issue.

./unstack.sh
./stack.sh
  • If you receive a message like below at the end of command execution, then the installation is fine and successful.
=========================
DevStack Component Timing
=========================
Total runtime         3040

run_process            76
test_with_retry         9
apt-get-update         15
pip_install           157
restart_apache_server  31
wait_for_service       50
apt-get                 6
=========================



This is your host IP address: 192.168.130.102
This is your host IPv6 address: fe80::d69b:58a8:90d5:1d96
Horizon is now available at http://192.168.130.102/dashboard
Keystone is serving at http://192.168.130.102/identity/
The default users are: admin and demo
The password: mypassword123
  • Login to openstack dashboard "Horizon" by using obtaned user credentials. In the above case, open a browser window and paste host IP address (192.168.130.102). Login by username "admin" or "demo" and password as set by you in the local.conf file.

  • Congratulations! You have successfully setup the controller node on your first ubuntu machine using devstack.

Step-by-step Installation Procedure on Compute Node
System Requirement
8+ core CPU
500+ GB Storage
8+ GB RAM
Update and Upgrade ubuntu OS
sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot
User Account Creation
  • Create a user with sudo priviledges.
sudo adduser stack
  • Give "sudo" permission to the new user typing command sudo visudo. Add below line.
stack    ALL=(ALL:ALL) ALL
  • Navigate to the new user.
sudo su - stack
  • Export the path variable.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin
Get the software
  • Install "git" and clone the required software.
sudo apt-get update
sudo apt-get install git
git clone https://git.openstack.org/openstack-dev/devstack -b stable/newton
Environment Setup
  • Create a new file named as local.conf in your devstack folder.
sudo apt-get install vim
vim local.conf 
  • Edit the local.conf file with below content in the compute node. Make sure to modify HOST_IP to refer to your compute node IP address and SERVICE_HOST,MYSQL_HOST,RABBIT_HOST,GLANCE_HOSTPORT,ADMIN_PASSWORD as per the controller node IP address.
[[local|localrc]]
HOST_IP=192.168.130.207
SERVICE_HOST=192.168.130.102
MYSQL_HOST=192.168.130.102
RABBIT_HOST=192.168.130.102
GLANCE_HOSTPORT=192.168.130.102:9292
ADMIN_PASSWORD=<Your-Password>
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

## Neutron options
PUBLIC_INTERFACE=eth0
ENABLED_SERVICES=n-cpu,rabbit,q-agt

Run Instructions
cd devstack
./stack.sh

This installation procedure normally takes 5-10 minutes depending upon the Internet speed. In case of any errors, unstack it and rerun after fixing the issue.

./unstack.sh
./stack.sh
  • If you receive a message like below at the end of command execution, then the installation is fine and successful.
=========================
DevStack Component Timing
=========================
Total runtime   866

run_process       9
apt-get-update   11
pip_install     204
git_timed       386
apt-get         224
=========================

This is your host IP address: 192.168.130.207
This is your host IPv6 address: fe80::9b06:9601:1b07:93eb

  • Congratulations! You have successfully setup a compute node on your second ubuntu machine using devstack. You can repeat the same procedure to add multiple compute nodes to your devstack environement.
  • In order to verify the availability of this newly created compute node at controller node, log in to the openstack dashboard using admin credentials, then navigate to the admin->hypervisors. You will be able to see a new node popping up on the dashboard screen.
Known Issues
  1. While running stack.sh, if you are getting below error, the update permission to some folders.
“”OSError: [Errno 13] Permission denied:
sudo chown -R stack:stack devstack
sudo chown stack: /home/stack/.cache
sudo chown -R stack:stack /opt/stack/
  • If you are facing issue for correct path set up, export below line to the environemnt. Alternatively, you could add this line to your environment path which persists even after reboot of the machines.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin
  • If any error like paste name deploy python error. then solution is as below :
sudo apt-get install --reinstall  python-pastedeploy
sudo apt-get install --reinstall python-paste
  • Error : IOError: [Errno 2] No such file or directory: '/opt/stack/tempest/.tox/tempest/lib/python2.7/site-packages/appdirs-1.4.2.dist-info/METADATA. This issue happens on a fresh setup. Once the issue comes, then just unstack, stack again. You will not see the issue again.
./stack.sh
  • [Devstack] Instance console keyboard error.
cd /opt/stack/noVNC
git checkout v0.6.0
  • If you get an error like, "You are already running a stack.sh session", unstack and restack again. You can try clean.sh if unstack.sh don't work as expected.
./unstack.sh or ./clean.sh
./stack.sh
  • If unstack.sh or ./clean.sh are not working properly, the kill the screen sessions and restack. It should resolve the issue.
screen -wipe
./stack.sh
  • If any error like "AssertionError: Egg-link does not match installed location of tempest", perform below step.
sudo pip install . 
sudo pip install -e .
  • If you encounter any mysql error, proceed as below.
mkdir /var/run/mysqld
chown mysql.mysql /var/run/mysqld
chmod 700 /var/run/mysqld
systemctl start mysql
  • If you get error - Got "no policy json found " while running devstack, then remove the "/opt/stack" directory and restack again.
sudo rm -rf /opt/stack
./unstack.sh
./stack.sh
  • Linux Kernel panic issue: How to fix hung_task_timeout_secs and blocked for more than 120 seconds problem. In such a case neither CLI nor the GUI will be accessible. Change vm.dirty_ratio and vm.dirty_backgroud_ratio as shown below.
    • Edit /etc/sysctl.conf file.
    • Add below two lines at the bottom.
    vm.dirty_background_ratio = 5
    vm.dirty_ratio = 10
    
    • Save and exit. Reboot the system.
    sudo reboot
    

Thank You !