Deploy OpenStack
Deploy OpenStack
OpenStack
Docs » Manuals » OpenStack User’s Manual » How to Get Started with
OpenStack
Log in to Horizon
This section demonstrates how to log in to Horizon.
Step 1 — Navigate to Horizon
Pull up the domain name provided for Horizon from your administrator in
a browser to load the Horizon login page.
Horizon Login Page:
Step 2 — Log in to Horizon
From here, enter in the provided credentials to log in.
Initial Horizon Dashboard:
Next Steps
The next guide in this series explains how to create a private network, a
basic building block of an OpenStack cloud.
Networking in
OpenStack
Docs » Manuals » OpenStack User’s Manual » Networking in OpenStack
Table of Contents
1. Create a Network and Router
2. Floating IPs
Create a network
Step 1 — Getting started
In Horizon, notice the sections on the left called Project and Identity.
Components of an OpenStack cloud, like a private network, are created
through the Project tab.
Fill out any other needed details and navigate to the Subnet tab.
Step 3 — Create subnet
Floating IPs
Floating IPs in OpenStack are publicy routable IP addresses that can be
attached and detached to instances. For example if there’s an instance
associated with a private network but needs to be accessed from the
Internet, a floating IP can be associated with the instance, allowing
communication from the Internet.
Allocate and Assign Floating IPs
To use Floating IPs they will first need to be allocated from the provider
network’s pool of IPs.
Allocate floating IP
To allocate floating IPs in Horizon, navigate to the Network tab on the
left, and find Floating IPs.
The IP will be obtained from the External provider network. This is the
only network floating IPs can be assigned from.
Once the IP is added, it will appear in the floating IP list.
Next Steps
The next guide goes over images in OpenStack, which are bootable
operating systems.
Images in OpenStack are what powers instances. In this guide, you will
learn how to view images, upload your own, and make snapshots of
images.
An image is a file that contains a bootable operating system. Many
different cloud image sources are available for download from major
operating system providers like CentOS, Ubuntu, and Debian to name a
few. You can also make your own images from scratch or create them
from volumes or running instances. Snapshots of instances can be
created which can serve both as a backup and also a template for other
instances.
Upload images
To upload an image into OpenStack, the image needs to first exist on
your machine, and then you can use Horizon to upload it.
This section will walk you through uploading the CirrOS image.
Optionally, you can specify requirements, like minimum disk space and
RAM, for the image under the Image Requirements heading.
Click the ? icon for assistance with specifics.
Next Steps
With this guide complete, move on to the next guide, which
explains how to create an Instance in Horizon.
How to Create an
Instance
Docs » Manuals » OpenStack User’s Manual » How to Create an Instance
In the following form, input the key pair name and the type of key it will
be. Once done, you will be prompted to download the private key which
needs to be stored in a safe place. Only you should have access to your
private SSH key pair! The public key portion of the key pair now exists in
Horizon.
Upload an SSH key pair
Should you already have an SSH key pair you want to use, you can
instead upload your public key. This can be done in the same Key
Pairs section.
Locate the Import Key Pair button near the top right of the screen. Fill
out the name of the key pair, specify the type of key it is, and finally
choose the public key from your computer or paste the public key in.
When the rule is created, two egress rules allowing all outbound traffic
are added to it by OpenStack. You can see these as follows:
With the new rule added you will see it listed like so:
Add a Volume
Additional disk space can be added to instances through volumes. A
volume in OpenStack is like a removable USB drive that can be attached
to instances as seen fit. Cinder is the OpenStack block storage service
that allows volumes to be created. A volume can also be used to boot an
instance.
This section explains how to create a volume in Horizon by creating a
5GB example volume. This is an optional step should your instance not
require additional storage through a volume.
Specify a name and size for the volume. The remaining options are not
required to create the volume.
After creating the volume you will be taken back to the volume listing
page. The Status column will read “Available” if the volume is ready to be
used.
Create an Instance
An instance is another name for a virtual machine in OpenStack.
Instances are created by the Nova service and contribute to the
processing power of the cloud.
With the previous steps followed, you have everything needed to make
an instance.
This section will explain how to create a volume-backed instance.
Choose from the list the security group to apply to this instance. This
example applies the ssh security group, allowing SSH access.
Choose from the key pair listing the SSH key to add. You can also create
a key pair or upload a public key using this form.
This floating IP can now be used to access the instance over the
Internet. The default username of the instance is typically the same as
the name of the operating system.
In this example the CentOS 8 Stream image was used so the default user
is centos. The Ubuntu’s image default user is ubuntu. Debian’s
is debian.
Next Steps
Navigate to the next guide in this series to learn how to back up and
restore instance data.
Instance Backups
How to Create an Instance Backup
This section demonstrates how to create an instance backup using
Horizon by creating a snapshot.
Volume Backups
How to Create a Volume Backup
In addition to creating instance snapshots, you can also create backups
of volumes in Horizon. This is important when a persistent volume is
used and you want to create backup copies of it.
Fill out the following form with at least the name of the backup and any
other fields needed.
Step 2 — Confirm volume backup creation
To confirm the backup created successfully, navigate to Project ->
Volumes -> Backups, then locate the backup in the list, and take note of
the Status column. You should see Available indicating the backup is
complete and ready to use.
How to Recover a Volume Backup
This section will explain the steps needed to recover a volume backup
using Horizon.
OpenStack offers a way to administer your cloud over the command line
using OpenStackClient.
The purpose of this guide is to introduce you to managing your cloud
using the command line. You will learn how to install OpenStackClient,
authenticate, and run introductory commands. Everything that can be
done using Horizon, can also be accomplished using OpenStackClient.
Installing OpenStackClient
OpenStackClient is available as a Python pip package.
For more information about this package, see OpenStackClient’s pip
project page.
Note! — There exist two OpenStackClient
packages: openstackclient and python-openstackclient. This guide
recommends using openstackclient as it comes with many more
OpenStack service command line clients. You can use either package,
but if you want to interact with a specific service’s command line client,
you may have to install that separately.
• OpenStack RC
• clouds.yaml
These are located under the Project tab, then API Access.
From here, click the Download OpenStack RC File drop-down, and then
download both files.
The clouds.yaml file needs to exist in ~/.config/openstack for
OpenStackClient to function. When downloaded, ensure it can be
located as ~/.config/openstack/clouds.yaml.
Multiple clouds: If you are working with multiple clouds, add the cloud
entry to the existing clouds.yaml and the cloud can be specified
using OS_CLOUD=$cloud_name or --os-cloud=$cloud_name,
where $cloud_name is the name of the cloud you’re working with.
Example clouds.yaml with two cloud entries, cloud-1 and cloud-2:
clouds:
cloud-1:
auth:
auth_url: http://50.50.50.1:5000
username: "admin"
project_id: b93259ca0a5b4541b30e4e16ae1d699d
project_name: "Apples"
user_domain_name: "Default"
region_name: "iad3"
interface: "public"
identity_api_version: 3
cloud-2:
auth:
auth_url: http://50.50.50.2:5000
username: "admin"
project_id: 6d0ef671c4b2413d920b61e3777fe2ab
project_name: "Oranges"
user_domain_name: "Default"
region_name: "iad3"
interface: "public"
identity_api_version: 3
This action sets needed environment variables and will also ask you to
authenticate as your OpenStack user:
(openstackclient):~$ source ~/Downloads/user-openrc.sh
Please enter your OpenStack Password for project User Cloud Test as user
user1:
Enter in the password for your user, and you are now set to use
OpenStackClient.
Note! — Entering only openstack and running that will take you into the
OpenStackClient shell allowing commands to be run without needing to
prefix them with openstack:
(openstackclient) user@host:~$ openstack
(openstack) network list
+--------------------------------------+----------+-------------------------------
-------+
| ID | Name | Subnets
|
+--------------------------------------+----------+-------------------------------
-------+
| 5cc755c9-41fc-44c2-87e7-642dfdfb0208 | External | a52754dd-13d9-4a36-bab6-10058f
4887f5 |
+--------------------------------------+----------+-------------------------------
-------+
(openstack) exit
(openstackclient) user@host:~$
Next Steps
Navigate to the next guide in this series to learn how to create networks
in OpenStack.
Create a Network
Docs » Manuals » OpenStack User’s Manual » Create a Network
Table of Contents
1. Create a Network and Router
2. Floating IPs
To get more information about each, use the show subcommand and
specify the UUID for the network and subnet:
$ openstack network show 0a193fa1-2019-4fbc-a862-6f6ced157c1e
$ openstack subnet show df4d6183-9c3b-4bb9-a686-cf1fc7d60f7f
Create a Router
With a network created, the next step is to create a router which will
bridge the connection from the External or provider network to the
private network.
Attach subnet:
Add subnet subnet-1 to the router called router-1:
$ openstack router add subnet router-1 subnet-1
Show the details for the router called router-1, including the interfaces
that were previously attached:
$ openstack router show router-1 --fit-width
+-------------------------+-------------------------------------------------------
----------------------------------------------+
| Field | Value
|
+-------------------------+-------------------------------------------------------
----------------------------------------------+
| admin_state_up | UP
|
| availability_zone_hints |
|
| availability_zones | nova
|
| created_at | 2021-05-19T20:35:14Z
|
| description |
|
| external_gateway_info | {"network_id": "5cc755c9-41fc-44c2-87e7-642dfdfb0208",
"external_fixed_ips": [{"subnet_id": |
| | "a52754dd-13d9-4a36-bab6-10058f4887f5", "ip_address":
"173.231.217.74"}], "enable_snat": true} |
| flavor_id | None
|
| id | d5b0eb30-8b2a-4f2e-a9df-4ad7ee792cec
|
| interfaces_info | [{"port_id": "fa1f794f-5101-4df4-b83a-3c260d0a65fa", "
ip_address": "10.0.0.1", "subnet_id": |
| | "df4d6183-9c3b-4bb9-a686-cf1fc7d60f7f"}]
|
| name | router-1
|
Floating IPs
Floating IPs in OpenStack are publicly routable IP addresses that can be
attached and detached to instances. For example if there’s an instance
associated with a private network but needs to be accessed from the
Internet, a floating IP can be associated with the instance, allowing
communication from the Internet.
Next Steps
The next guide goes over images in OpenStack, which are bootable
operating systems.
Manage OpenStack
Images
Docs » Manuals » OpenStack User’s Manual » Manage OpenStack Images
Images in OpenStack are what powers instances. In this guide, you will
learn how to view images, upload your own, and make snapshots of
images.
An image is a file that contains a bootable operating system. Many
different cloud image sources are available for download from major
operating system providers like CentOS, Ubuntu, and Debian to name a
few. You can also make your own images from scratch or create them
from volumes or running instances. Snapshots of instances can be
created which can serve both as a backup and also a template for other
instances.
List and Upload Images
List images
To begin, you will learn how to list images using OpenStackClient.
Create an Instance
Docs » Manuals » OpenStack User’s Manual » Create an Instance
Table of Contents
1. Before Creating an Instance
2. SSH Key Pairs
3. Security Groups
4. Add a Volume
5. How to Create an Instance
Before Creating an Instance
Before creating an instance, several pieces need to be in place.
Generally speaking, these items should exist before creating an
instance:
This generates a key pair and returns the private key. The private key
should be kept somewhere safe and be inaccessible to others.
Show details
Show the details of the group:
$ openstack security group show cdf392cd-0f8a-409c-837b-b8409981da93
+-----------------+---------------------------------------------------------------
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
---------------------+
| Field | Value
|
+-----------------+---------------------------------------------------------------
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
---------------------+
| created_at | 2021-05-19T21:38:19Z
|
| description | ssh
|
| id | cdf392cd-0f8a-409c-837b-b8409981da93
|
| name | ssh
|
| project_id | fece7ddb8663497bb99ee0988719143c
|
| revision_number |
4
|
| rules | created_at='2021-05-19T21:38:19Z', direction='egress', etherty
pe='IPv4', id='4a0d26d8-7e9d-4eac-9e19-94cb66cda54f', updated_at='2021-05-19T21:38
:19Z'
|
| | created_at='2021-05-19T21:38:19Z', direction='egress', etherty
pe='IPv6', id='80fcfd69-bc4e-44ad-bbdc-c5049b1a7472', updated_at='2021-05-19T21:38
:19Z'
|
| | created_at='2021-05-19T21:47:46Z', direction='ingress', ethert
ype='IPv4', id='ba39298c-7713-4975-a882-2335bdded8c1', port_range_max='22', port_r
ange_min='22', protocol='tcp', remote_ip_prefix='192.168.1.20/32', updated_at='202
1-05-19T21:47:46Z' |
| stateful | Tru
e
|
| tags | [
]
|
| updated_at | 2021-05-19T21:47:46
Z
|
+-----------------+---------------------------------------------------------------
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
---------------------+
In the above output, the rule allowing SSH traffic from 192.168.1.20 is
visible.
Add a Volume
Additional disk space can be added to instances through volumes. A
volume in OpenStack is like a removable USB drive that can be attached
to instances as seen fit. Cinder is the OpenStack block storage service
that allows volumes to be created. A volume can also be used to boot an
instance.
This section explains how to create a volume using OpenStackClient by
creating a 5GB example volume. This is an optional step should your
instance not require additional storage through a volume.
VOLUME_NAME is the name of the volume and SIZE is the numeric size
in gigabytes.
For this example, the CentOS 8 Stream image will be used which is
associated with UUID d5a101ff-0870-435f-bf76-c3309e542a53. This
UUID is later used to build this instance.
Choose the appropriate flavor the instance will require. This example
will use the c1.micro flavor.
The ssh security group will be associated with this instance via
UUID 44668612-1a18-4289-b5fb-f24de8e20c09.
+-------+-------------------------------------------------+------+
| Name | Fingerprint | Type |
+-------+-------------------------------------------------+------+
| key-1 | a7:ab:bd:9c:78:85:e1:a1:c4:07:0f:6d:e9:36:0b:68 | ssh |
| ssh-1 | 53:0e:0f:19:9f:21:5f:7e:36:96:28:31:25:1b:52:af | ssh |
+-------+-------------------------------------------------+------+
This instance will use the SSH key pair called key-1.
The following explains what each variable in the above command is for:
The status column indicates the instance status. Seeing ACTIVE in the
status column indicates the instance successfully spawned.
See the Nova compute API documentation for a list of instance status
meanings and additional commands that can be used to troubleshoot
any issues.
Look for the fault row for the reason as to why the instance failed to
create.
For assistance with instance errors, consider consulting with your
OpenStack administrator.
Next Steps
The next guide in this series is regarding backing up and restoring your
instance data.
Managing Backups in
OpenStack
Docs » Manuals » OpenStack User’s Manual » Managing Backups in
OpenStack
Instance Backups
How to Create an Instance Backup
This section demonstrates how to create an instance backup using
OpenStackClient.
To begin, ensure you have prepared your OpenStackClient environment
before issuing commands.
Depending on how the instance was spawned will determine how to
create a backup. If the instance is volume-backed, you will have to back
up the volume. If the instance is image-backed, you can back up the
instance itself, which creates an image backup. Each method is
described below.
Volume-backed Instance
To create a backup of a volume-backed instance using
OpenStackClient, you will need to create a backup of the volume, by first
obtaining the volume’s UUID, then use openstack volume backup
create VOLUME_UUID.
In addition, if the volume is in use by an instance, the --force flag is
required to create the volume backup.
Take note of the id of the backup as this will be used next to determine
the backup status.
Image-backed Instance
To create a backup of an image-backed instance, use openstack server
backup create INSTANCE_UUID.
Note the id column from the output. This is the UUID of the backup and
will be used to verify backup completion.
Look for the status column to indicate the status of the backup. If the
backup is complete, the status will show as active.
Volume-backed Instance
This section demonstrates how to recover an instance using a volume
backup.
To restore an instance from a volume backup, the volume backup needs
to first be restored into a new volume, then an instance can be booted
using that new volume.
This example will recover the volume backup under UUID f8440441-
92b8-4522-9dfe-18868e089d6e.
Restore the volume backup into the new volume using openstack
volume backup restore BACKUP_UUID VOLUME_UUID,
replacing BACKUP_UUID and VOLUME_UUID with the UUIDs of the
backup and the new volume:
$ openstack volume backup restore f8440441-92b8-4522-9dfe-18868e089d6e 1810a215-67
e4-48b5-ba51-feef9d263660
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| backup_id | f8440441-92b8-4522-9dfe-18868e089d6e |
| volume_id | 1810a215-67e4-48b5-ba51-feef9d263660 |
| volume_name | wordpress-1-backup-1 |
+-------------+--------------------------------------+
If the backup is ready to use, the Status column will show as available.
The first item in the above list is the instance previously created.
The Status column shows ACTIVE indicating the instance is ready to use.
Volume Backups
How to Create a Volume Backup
In addition to creating instance snapshots, you can also create backups
of volumes using OpenStackClient. This is important when a persistent
volume is used and you want to create backup copies of it.
The Status column indicates if the volume backup is ready to use or not
and should report available when the backup is ready.
How to Recover a Volume Backup
This section explains the steps needed to recover a volume backup
using OpenStackClient. The flow for recovering a volume backup is to
find the volume backup UUID, create an empty volume, then recover the
backup into the new volume.
The first item in the above list is the restored backup, wordpress-
media-1-backup-2. Note the Status column
reports available indicating the backup restoration succeeded.