OpenStack OperationsPartB
OpenStack OperationsPartB
ELLOUMI | GRS-I3C-3ATEL
OpenStack Operations
Table of Contents
1 Setup the Infrastructure
2 Install Openstack
4 Launch Instances
5 Attaching a Volume
6 Create a Network
7 Distributed Tracing
8 Further Reading
I.ELLOUMI | GRS-I3C-3ATEL
• Memory size: 16 GB
• OS image: Ubuntu_20G
• CPU: 1 vCPU (or more)
• Network: connection to the Internet (optional)
o Write down the public IP address, e.g.: 141.40.254.130
• Access:
2) Install Openstack
We will setup a complete non-production OpenStack environment using
DevStack (another option would be to use PackStack). DevStack is
composed by several scripts to install an all-in-one OpenStack
OpenStack Operations A.U.2019-20 2
I.ELLOUMI | GRS-I3C-3ATEL
• https://docs.openstack.org/devstack/latest/
While the instructions are available in the previous link, we will repeat
them here for
completeness reasons. We will add a non-root user, with sudo enabled,
to run the install scripts:
I.ELLOUMI | GRS-I3C-3ATEL
ADMIN_PASSWORD=my_secret_password
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
To enable tracing using OSprofiler and Redis add the following line to
local.conf:
• $ vi local.conf
enable_plugin osprofiler
https://git.openstack.org/openstack/osprofiler master
OSPROFILER_COLLECTOR=redis
To enable tracing using OSprofiler and Jaeger add the following line to
local.conf:
• $ vi local.conf
enable_plugin osprofiler
https://git.openstack.org/openstack/osprofiler
refs/changes/67/611067/4
OSPROFILER_BRANCH=refs/changes/67/611067/4
OSPROFILER_COLLECTOR=jaeger
Start the installation process. This will take 15-20 minutes depending on
your internet connection speed since many git trees and packages need
to be download during the installation.
• $ ./stack.sh
You can check the status of the OpenStack services running (e.g., glance,
cinder, neutron, nova, and keystone) using the status command: ·
I.ELLOUMI | GRS-I3C-3ATEL
following directory:
• $ ls -al /opt/stack/ You can access the Horizon dashboard and use
the web interface to manage virtual machines, networks, volumes,
and images:
· http://141.40.254.130/
· User Name: admin
· Password: admin (specified in the file local.conf)
• https://docs.openstack.org/horizon/latest/user/launch-
instances.html
I.ELLOUMI | GRS-I3C-3ATEL
4) Launch Instances
A VM is a structure which brings together resources from several
OpenStack services:
• Keypairs from Nova
https://docs.openstack.org/python-
openstackclient/pike/cli/command- objects/keypair.html
• Security groups from Nova
https://docs.openstack.org/nova/latest/admin/security-
groups.html#list- and-view-current-security-groups
• Flavors from Nova
https://docs.openstack.org/nova/pike/admin/flavors2.html
I.ELLOUMI | GRS-I3C-3ATEL
I.ELLOUMI | GRS-I3C-3ATEL
Using the flavour, image, network, security group, and keypair previously
identified, run the following command to create a VM and inspect its
private IP:
I.ELLOUMI | GRS-I3C-3ATEL
Access the instance from the Internet using a floating IP and the private
key:
• $ ping -c 4 172.24.4.8
5) Attaching a Volume
The Cinder service provides volume storage. Network
accessible volumes or virtual disks can be attached to a VM. Five steps
I.ELLOUMI | GRS-I3C-3ATEL
are involved:
· Create the volume
· Attach the volume
· Format the volume
· Mount the volume
· Mount on reboot
To create the new volume named os_vol with 1Gb, run the following
command:
• $ openstack volume create --size 1 os_vol
I.ELLOUMI | GRS-I3C-3ATEL
• $ df -h /mnt/os_vol
You can also make the mount permanent to survive reboots. Identify the
UUID of the volume and modify /etc/fstab to have it auto mounted and
execute:
• $ sudo blkid /dev/vdb
• $ sudo mount -a
For more information:
• https://docs.openstack.org/mitaka/install-guide-obs/launch-
instance- cinder.html
6) Create a Network
You can access the Network Topology of the dashboard to displays a
graphical representation of the interaction of your routers, networks,
and instances
• Horizon Dashboard \ Project \ Network \ Network Topology
I.ELLOUMI | GRS-I3C-3ATEL
I.ELLOUMI | GRS-I3C-3ATEL
I.ELLOUMI | GRS-I3C-3ATEL
7) Distributed Tracing
After competition of installation, ”osprofiler” CLI can be used to list
traces or get a single one, e.g.:
• $ osprofiler trace list --connection-string redis://localhost:6379
• $ osprofiler trace show --connection-string redis://localhost:6379 --
html <trace-id> --out trace.html
Run the commands from the previous sections by appending --os-profile
SECRET_KEY at the end of each command. For example:
I.ELLOUMI | GRS-I3C-3ATEL
8) Further Reading
• Become an expert at using the CLI
https://developer.openstack.org/api-guide/quick-start/
• Writing Your First OpenStack Application using an SDK o
https://developer.openstack.org/firstapp-libcloud/
• Try various SDKs
Python LibCloud
§ https://libcloud.apache.org
Go Gophercloud
§ https://github.com/gophercloud/gophercloud
• User stories
https://www.openstack.org/user-stories/