How to install OpenStack on your local machine using Devstack
The purpose of this guide is to allow you to install and deploy OpenStack on your own laptops or cloud VMs and follow the webinar exercises at home. The guide is both hardware and OS agnostic and can be used with AMD or Intel and Windows, Mac, or Linux. Furthermore the installation below is completely isolated and self contained using Virtual Machines. The guide is provided as is and Mirantis inc. is not responsible for any issues that may occur as a result of following this guide.
Step 1.
Create a Linux VM locally on your computer (for example, using VirtualBox) or remotely in the cloud (for example on AWS).
The VM needs to satisfy the following conditions:
- VM needs at least 4 GB of memory and access to the Internet, and it needs to be accessible (at least) on tcp ports 22 (or console) and 80 from your laptop.
- Devstack attempts to support Ubuntu 16.04/17.04, Fedora 24/25, CentOS/RHEL 7, as well as Debian and OpenSUSE.
- If you do not have a preference, Ubuntu 16.04 is the most tested, and will probably go the smoothest.
DevStack will make substantial changes to your system during installation. Only run DevStack on servers or virtual machines that are dedicated to this purpose.
Step 2.
Log into the VM using ssh or the console.
Step 3.
You'll need to run Devstack as a non-root user with sudo enabled. You can quickly create a separate user called stack to run DevStack with:
sudo useradd -s /bin/bash -d /opt/stack -m stackStep 4.
Because this user, stack, will be making many changes to your system, it should have sudo privileges:
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
You should see output of:stack ALL=(ALL) NOPASSWD: ALL
Step 5.Now you need to switch over to use the user stack:
sudo su - stack
Step 6.Download DevStack:
git clone https://github.com/openstack-dev/devstack.git -b stable/pike devstack/
You should see:Cloning into 'devstack'...
NotesThe above command downloads OpenStack release Pike. You can also check the list of available releases. To download releases in EOL status (End Of Life) replace -b stable/pike
with, for example,
-b liberty-eol
(for Liberty).Step 7.
Change to the devstack directory:
cd devstack/
Step 8:Determine your IP address:
sudo ifconfig
You will see a response something like this:enp0s3 Link encap:Ethernet HWaddr 08:00:27:ea:97:9f inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::d715:6025:f469:6f7c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1364291 errors:0 dropped:0 overruns:0 frame:0 TX packets:406550 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1415725472 (1.4 GB) TX bytes:27942474 (27.9 MB)You're looking for the addr: value in an interface other than lo. For example, in this case, it's 10.0.2.15. Make note of that for the next step. If you run your VM on the cloud, make sure to use the public IP of your VM in the link.
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:229208 errors:0 dropped:0 overruns:0 frame:0 TX packets:229208 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:89805124 (89.8 MB) TX bytes:89805124 (89.8 MB)
Step 9.
Create the local.conf file with 4 passwords and your host IP, which you determined in the last step:
cat > local.conf <<EOF [[local|localrc]] ADMIN_PASSWORD=secret DATABASE_PASSWORD=\$ADMIN_PASSWORD RABBIT_PASSWORD=\$ADMIN_PASSWORD SERVICE_PASSWORD=\$ADMIN_PASSWORD HOST_IP=10.0.2.15 RECLONE=yes EOFThis is the minimum required config to get started with DevStack.
Step 10.
Now install and run OpenStack:
./stack.sh
At the end of the process you should see output something like this:This is your host IP address: 10.0.2.15 This is your host IPv6 address: ::1 Horizon is now available at http://10.0.2.15/dashboard Keystone is serving at http://10.0.2.15/identity/ The default users are: admin and demo The password: secret DevStack Version: pike OS Version: Ubuntu 16.04 xenial stack.sh completed in 1221 seconds.This will take a 15 - 20 minutes, largely depending on the speed of your internet connection. Many git trees and packages will be installed during this process.
Step 11.
Access your OpenStack by copy-pasting the link from the above output into your web browser:
http://<HOST_IP>/dashboard
Use the default users demo or admin and configured password from step 8 (secret).
You should see the following log-in window in your browser:
From here, you can do whatever you need to, either from the Horizon interface, or by downloading credentials to use the command line.
You can find out how to do some of the more common tasks by viewing the original webinar, or check out our OpenStack Training resources.