Start exploring Essentials of OpenStack Administration by downloading the free sample chapter today. DOWNLOAD NOW
DevStack is a GitHub-based deployment of OpenStack, provided by OpenStack.org, that allows for easy testing of new features. This tutorial, the last in our series from The Linux Foundation’s Essentials of OpenStack Administration course, will cover how to install and configure DevStack.
While DevStack is easy to deploy, it should not be considered for production use. There may be several configuration choices for new or untested code used by developers, which would not be appropriate for production.
DevStack is meant for developers, and uses a bash shell installation script instead of a package-based installation. The stack.sh script runs as a non-root user. You can change the default values by creating a local.conf file.
Should you make a mistake or want to test a new feature, you can easily unstack, clean, and stack again quickly. This makes learning and experimenting easier than rebuilding the entire system.
Setting up the Lab
One of the difficulties of learning OpenStack is that it’s tricky to install, configure and troubleshoot. And when you mess up your instance it’s usually painful to fix or reinstall it.
That’s why Linux Foundation Training introduced on-demand labs which offer a pre-configured virtual environment. Anyone enrolled in the course can click to open the exercise and then click to open a fully functional OpenStack server environment to run the exercise. If you mess it up, simply reset it. Each session is then available for up to 24 hours. It’s that easy.
Access to the lab environment is only possible for those enrolled in the course. However, you can still try this tutorial by first setting up your own AWS instance with the following specifications:
Deploy an Ubuntu Server 14.04 LTS (HVM), SSD Volume Type – ami-d732f0b7
with a m4.large (2 vcpus, 8GiB ram) instance type, increase the root disk to 20G, and open up all the network ports.
See Amazon’s EC2 documentation for more direction on how to set up an instance.
Verify the System
Once you are able to log into the environment verify some information:
1. To view and run some commands we may need root privilege. Use sudo to become root:
ubuntu@devstack-cc:~$ sudo -i
2. Verify the Ubuntu user has full sudo access in order to install the software:
root@devstack-cc:~# grep ubuntu /etc/sudoers.d/* /etc/sudoers.d/90-cloud-init-users:# User rules for ubuntu /etc/sudoers.d/90-cloud-init-users:ubuntu ALL=(ALL) NOPASSWD:ALL
3. We are using a network attached to eth2 for our cloud connections. You will need the public IP, eth0, to access the OpenStack administrative web page after installing DevStack. From the output find the inet line and make note of the IP Address. In the following example the IP address to write down would be: 22.214.171.124 Your IP address will be different. If you restart the lab the IP address may change.
root@devstack-cc:~# ip addr show eth0 2: eth0:
mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether bc:76:4e:04:b5:9b brd ff:ff:ff:ff:ff:ff inet 126.96.36.199/24 brd 188.8.131.52 scope global eth0 valid_lft forever preferred_lft forever inet6 2001:4800:7812:514:be76:4eff:fe04:b59b/64 scope global valid_lft forever preferred_lft forever inet6 fe80::be76:4eff:fe04:b59b/64 scope link valid_lft forever preferred_lft forever root@devstack-cc:~# ip addr show eth2 4: eth2: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether bc:76:4e:06:10:32 brd ff:ff:ff:ff:ff:ff inet 192.168.97.1/24 brd 192.168.97.255 scope global eth2 valid_lft forever preferred_lft forever inet6 fe80::be76:4eff:fe06:1032/64 scope link valid_lft forever preferred_lft forever
Public IP eth0
Internal IP eth2
4. When the previous command finishes return to being the Ubuntu user:
root@devstack-cc:~# exit logout ubuntu@devstack-cc:~$
Install the git command and DevStack software
DevStack is not typically considered safe for production, but can be useful for testing and learning. It is easy to configure and reconfigure. While other distributions may be more stable they tend to be difficult to reconfigure, with a fresh installation being the easiest option. DevStack can be rebuilt in place with just a few commands.
DevStack is under active development. What you download could be different from a download made just minutes later. While most updates are benign, there is a chance that a new version could render a system difficult or impossible to use. Never deploy DevStack on an otherwise production machine.
1. Before we can download the software we will need to update the package information and install a version control system command, git.
ubuntu@devstack-cc:~$ sudo apt-get update
ubuntu@devstack-cc:~$ sudo apt-get install git After this operation, 21.6 MB of additional disk space will be used. Do you want to continue? [Y/n] y
2. Now to retrieve the DevStack software:
ubuntu@devstack-cc:~$ pwd /home/ubuntu ubuntu@devstack-cc:~$ git clone https://git.openstack.org/openstack-dev/devstack -b stable/liberty Cloning into ’devstack’...
3. The newly installed software can be found in a new sub-directory named devstack. Installation of the script is by a shell script called stack.sh. Take a look at the file:
ubuntu@devstack-cc:~$ cd devstack ubuntu@devstack-cc:~/devstack$ less stack.sh
4. There are several files and scripts to investigate. If you have issues during installation and configuration you can use theunstack.sh and clean.sh script to (usually) return the system to the starting point:
ubuntu@devstack-cc:~/devstack$ less unstack.sh ubuntu@devstack-cc:~/devstack$ less clean.sh
5. We will need to create a configuration file for the installation script. A sample has been provided to review. Use the contents of the file to answer the following question.
ubuntu@devstack-cc:~/devstack$ less samples/local.conf
6. What is the location of script output logs? _____________
7. There are several test and exercise scripts available, found in sub-directories of the same name. A good, general test is the run_ tests.sh script.
Due to the constantly changing nature of DevStack these tests are not always useful or consistent. You can expect to see errors but be able to use OpenStack without issue. For example missing software should be installed by the upcoming stack.sh script.
Keep the output of the tests and refer back to it as a place to start troubleshooting if you encounter an issue.
While there are many possible options we will do a simple OpenStack deployment. Create a ~/devstack/local.conf file. Parameters not found in this file will use default values, ask for input at the command line or generate a random value.
Create a local.conf file
1. We will create a basic configuration file. In our labs we use eth2 for inter-node traffic. Use eth2 and it’s IP address when you create the following file.
ubuntu@devstack-cc:~devstack$ vi local.conf
3. Navigate to the System -> Hypervisors page. Use the Hypervisor and Compute Host sub-tabs to answer the following questions. a. How many hypervisors are there?
b. How many VCPUs are used?
c. How many VCPUs total?
d. How many compute hosts are there?
e. What is its state?
4. Navigate to the System -> Instances page.
a. How many instances are there currently?
5. Navigate to the Identity -> Projects page.
a. How many projects exist currently?
6. Navigate through the other tabs and subtabs to become familiar with the BUI.
3. a. 1 b. 0 c. 2 d. 1 e. up
4. a. 0 5. a. 6
The Essentials of OpenStack Administration course teaches you everything you need to know to create and manage private and public clouds with OpenStack. Download a sample chapter today!
Read the other articles in the series:
- Dent Introduces Industry’s First End-to-End Networking Stack Designed for the Modern Distributed Enterprise Edge and Powered by Linux - 12月 17, 2020
- Open Mainframe Project Welcomes New Project Tessia, HCL Technologies and Red Hat to its Ecosystem - 12月 17, 2020
- New Open Source Contributor Report from Linux Foundation and Harvard Identifies Motivations and Opportunities for Improving Software Security - 12月 8, 2020