A lot of times, it is necessary to have an OpenStack deployment that can be quickly set up for testing and training. DevStack is a series of scripts that help to set up OpenStack very quickly. It is mostly used for development environments and functional testing of OpenStack's different projects. This article will detail the steps needed to deploy OpenStack on a CentOS 7 system, using DevStack.
Generate Passwords
You will need to generate four passwords that will be used byDevStack to configure OpenStack:
- OpenStack Admin
- Database
- RabbitMQ
- Services
You can generate passwords using the openssl CLI tool:
openssl rand -hex 8
Software
On your CentOS 7 system, upgrade to the latest software packages, and install git as well, which will be needed to obtain the scripts.
As root:
yum update; yum install git
Create a user "devstack" to run DevStack with:
adduser devstack
Give sudo privileges to the devstack user by running visudo as root, and entering the following line into the file:
devstack ALL=(ALL) ALL
Switch to the devstack user, and change to its home directory:
su devstack
cd
Obtain the DevStack scripts by cloning the DevStack repository from GitHub:
git clone https://git.openstack.org/openstack-dev/devstack
Configuration
Create a local.conf file inside the cloned repository's directory (should be /home/devstack/devstack), and insert the following lines, substituting the passwords that were generated beforehand:
[[local|localrc]]
ADMIN_PASSWORD=OpenstackAdminPassword
DATABASE_PASSWORD=DatabasePassword
RABBIT_PASSWORD=RabbitMQPassword
SERVICE_PASSWORD=ServicesPassword
This is the most basic configuration that can be set. The official devstack configuration reference lists several possible setups and configuration options, should there be further customization required.
Run DevStack
Now that everything is in place, we are now ready to execute DevStack:
~/devstack/stack.sh
This will start the execution of the DevStack scripts. Depending on your Internet connection speed, it could take a while, as it will install packages and pull code from The Internet. On a 16Mbps Internet Connections, it took approximately an hour for DevStack to run to completion.
After stack.sh concludes its execution, you should see the last few lines of output as something like this:
=========================
DevStack Component Timing
=========================
Total runtime 3755run_process 57
pip_install 847
restart_apache_server 18
wait_for_service 38
yum_install 717
git_timed 814
=========================This is your host IP address: 192.168.2.108
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.2.108/dashboard
Keystone is serving at http://192.168.2.108/identity/
The default users are: admin and demo
The password: secret
2016-07-11 09:25:25.644 | WARNING:
2016-07-11 09:25:25.644 | Using lib/neutron-legacy is deprecated, and it will be removed in the future
2016-07-11 09:25:25.644 | stack.sh completed in 3755 seconds.
[devstack@localhost devstack]$
This means that everything involving OpenStack installation and configuration went as expected.
You now have the following OpenStack services running on your node:
- Keystone
- Glance
- Nova
- Cinder
Screens
By running
screen -ls
You should see that DevStack created a screen session automatically. This screen contains multiple windows, wherein each OpenStack service runs. Connect to it by executing
screen -x
You may cycle to the next screen by Hitting Ctrl+a, then space.
Using screen can be particularly intimidating to use; a screen quick reference document is often needed by beginners.
You may now visit the OpenStack Dashboard by using a Web Browser to navigate to the URL that was presented by DevStack, in our case:
Horizon is now available at http://192.168.2.108/dashboard
Conclusion
Creating a test OpenStack deployment on CentOS 7 is pretty easy with DevStack. Once again, it should be noted that this is for testing purposes only, and is in no way recommended for production environments. Should further services or configuration customization be required, the devStack configuration reference should be consulted.
The post Script to Create OpenStack Node with DevStack on CentOS 7 appeared first on LinOxide.