+++ date = "2015-10-06" draft = true weight = 16 title = "Lab 16 - Build your own OpenStack environment at home" +++
The objective of this lab is to teach students how to take an Ubuntu 14.04 (LTS) machine and stand-up an OpenStack environment so that you may continue your exploration of OpenStack on your own time outside of class. You might use an old laptop, AWS, Google Cloud, or even try it out on a VMWare VM on your desktop. The only prerequisite, is that you have a new install of Ubuntu 14.04 on the machine.
This lab doesn't actually install OpenStack, it installs DevStack. As the name implies, DevStack is for developers. It is designed to install on a single or dual-node system (the steps listed are for a single node system). Rather than do this lab in class, the instructor will demo it for you.
-
Issue the following commands to the Ubuntu CLI.
[ubuntu@PC01 ~]$``
sudo apt-get update`[ubuntu@PC01 ~]$``
ip a`[ubuntu@PC01 ~]$
sudo apt-get install ntp
[ubuntu@PC01 ~]$
cat /etc/ntp.conf
- You will see lots of lines, but the NTP servers being used are the following:
server 0.ubuntu.pool.ntp.org server 1.ubuntu.pool.ntp.org server 2.ubuntu.pool.ntp.org server 3.ubuntu.pool.ntp.org
[ubuntu@PC01 ~]$
sudo timedatectl set-timezone UTC
[ubuntu@PC01 ~]$
sudo /etc/init.d/ntp restart
[ubuntu@PC01 ~]$
timedatectl
[ubuntu@PC01 ~]$
sudo apt-get install git -y
[ubuntu@PC01 ~]$
pwd
[ubuntu@PC01 ~]$
git clone https://git.openstack.org/openstack-dev/devstack
[ubuntu@PC01 ~]$
ls
[ubuntu@PC01 ~]$
cd devstack
[ubuntu@PC01 ~]$
less tack.sh
[ubuntu@PC01 ~]$
less unstack.sh
[ubuntu@PC01 ~]$
less clean.sh
[ubuntu@PC01 ~]$
less samples/local.conf
[ubuntu@PC01 ~]$
./run_tests.sh
Now to configure stack.sh. DevStack includes a sample in devstack/samples/local.conf. The local.conf has the following parameters that need to be defined: FLOATING_RANGE - A range not used on the local network, i.e. 192.168.1.224/27. This configures IP addresses ending in 225-254 to be used as floating IPs. Set FIXED_RANGE and FIXED_NETWORK_SIZE to configure the internal address space used by the instances. Set FLAT_INTERFACE to the Ethernet interface that connects the host to your local network. This is the interface that should be configured with the static IP address mentioned above. Set the administrative password. This password is used for the admin and demo accounts set up as OpenStack users. Set the MySQL administrative password. The default here is a random hex string which is inconvenient if you need to look at the database directly for anything. Set the RabbitMQ password. Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.
ubuntu@PC01:~/devstack$ nano local.conf [[local|localrc]] FLOATING_RANGE=192.168.1.0/24 # Pick a range not used on the local network FIXED_RANGE=10.0.1.0/24 FIXED_NETWORK_SIZE=256 FLAT_INTERFACE=eth0 ADMIN_PASSWORD=moneypenny # This is your login password for admin MYSQL_PASSWORD=ltcmdrdata RABBIT_PASSWORD=flopsymopsy SERVICE_PASSWORD=iheartksl SERVICE_TOKEN=xyz1qwerty1abc
ubuntu@PC01:~/devstack$ script -a /stack.out
ubuntu@PC01:/devstack$ ./stack.sh
Note the current time. The installation of DevStack will take a bit; we've clocked it around 28 minutes. This is a good time to review the stack.sh documentation (http://docs.openstack.org/developer/devstack/stack.sh.html), as well as documentation on the DevStack project (http://docs.openstack.org/developer/devstack/). Be sure to keep checking the status of the installation. If something fails, it is important to catch it as quickly as possible.
ubuntu@PC01:/devstack$ exit
ubuntu@PC01:/devstack$ less /stack.out
ubuntu@PC01:/devstack$ ls -l /opt/stack/logs
ubuntu@PC01:~/devstack$ cat /devstack/openrc
ubuntu@PC01:/devstack$ source openrc admin admin
less /opt/stack/logs/stack.sh.log ## this doesn't work diff ~/stack.out /opt/stack/logs/stack.sh.log
This section will log you get you logged into Horizon, and give you some direction, but it's up to you to explore and continue your OpenStack education. The installation of DevStack is quick and painless, so don't be afraid that you might 'break' something! Refer to previous labs if you get stuck.
-
Log into Horizon (user: admin // password: moneypenny)
http://
-
Use the Horizon dashboard to answer the following questions:
-
How much memory is available?
-
How many VCPUs are available?
-
How large is the local disk?
-
How many hypervisors are available?
-
What OpenStack services are configured?
-
-
Use Horizon and the CLI to complete the following tasks (to access the CLI, use PuTTY [Windows] or Terminal [Apple])
-
Horizon tasks
-
Create the project timelords
-
Add the user thegooddoctor to the orion project
-
Add the user amypond to the orion project
-
Create a private network gallifrey
-
Create a router called timelord on the gallifrey network
-
Create a security group called http-ssh allowing HTTP and SSH access
-
Start an instance named tardis in the orion project
-
Create a 1 GB volume named vault and attach it to tardis
-
-
CLI tasks
-
SSH into the instance tardis and confirm you can see your new 1 GB volume
-
Create the project camelot
-
Add the user kingarthur to the camelot project
-
Add the user sirrobin to the camelot project
-
Start an instance in the camelot project
-
-
-
Enjoy! Don't be afraid to explore. If you come up with any 'cool' tasks, be sure to let us know!
** THANKS AGAIN FOR TRAINING WITH ALTA3 RESEARCH!!!***