Get started with OpenStack

Welcome!

In this tutorial, you will deploy a Canonical OpenStack cloud and provision a VM in this cloud.

What you will build

As a result of completing the tutorial, you will have a functioning single-node Canonical OpenStack cloud. This cloud will be sufficient to complete all further tutorials in this documentation.

Note

This tutorial is intended for learning purposes. It intentionally limits OpenStack deployment to a single machine. APIs and cloud resources provisioned during the tutorial are accessible only from that machine.

To deploy a production-grade cloud, refer to detailed instructions in the How-to Guides section.

Requirements

To complete the tutorial, you need a single dedicated machine with the following configuration:

  • 4+ core amd64 processor

  • minimum of 16 GiB of RAM

  • minimum of 100 GiB SSD storage on the rootfs partition

  • a fresh installation of Ubuntu Desktop 24.04 LTS

  • unlimited access to the Internet

  • a spare unformatted disk for MicroCeph

You can also use a virtual machine instead, but you can expect some performance degradation in this case.

Deploy Canonical OpenStack

Canonical OpenStack can be deployed in four steps. This tutorial guides you through these steps and explains their purpose.

Step 1: Install the OpenStack snap

Log in to the machine used in this tutorial and run the following command to install the OpenStack snap:

sudo snap install openstack

The openstack snap includes sunbeam, a deployment and operations tool that you will use to deploy a cloud and provision resources.

Step 2: Prepare the machine

Run the following command to prepare the machine for Canonical OpenStack:

sunbeam prepare-node-script --bootstrap | bash -x && newgrp snap_daemon

Once the command completes, the machine is ready to bootstrap a cloud.

What happens during this step?

The script generated and executed in the command above performs two actions:

  1. Installs all required software dependencies (including the openssh-server).

  2. Configures passwordless access to the sudo command for the currently logged in user (i.e. NOPASSWD:ALL).

You can generate a script file and review the performed actions:

sunbeam prepare-node-script --bootstrap

Step 3: Bootstrap the cloud

Run the following command to bootstrap a Canonical OpenStack cloud on the machine:

sunbeam cluster bootstrap --accept-defaults --role control,compute,storage

Once this command completes, you will see the following message:

Node has been bootstrapped with roles: storage, control, compute
What happens during this step?

During the bootstrap process, Sunbeam orchestrates the following actions:

  1. Installs Canonical Kubernetes for the purpose of hosting cloud control functions.

  2. Installs Canonical Juju and bootstraps a Juju controller on top of Canonical Kubernetes.

  3. Installs and configures cloud control functions on top of Canonical Kubernetes.

  4. Installs the OpenStack Hypervisor snap and plugs it into cloud control services.

  5. Installs the MicroCeph snap and plugs it into cloud control services.

Important

Bootstrap process may fail if the rootfs partition does not have sufficient available storage, or if there is no free, un-partitioned disk for MicroCeph. If any issue is encountered, consult the Troubleshooting guide.

Note

Sunbeam creates a set of credentials to access the Juju controller. An authenticated session expires after 24 hours. Run the following command to re-authenticate:

sunbeam utils juju-login

Step 4: Configure the cloud

Run the following command to apply initial configuration that allows the cloud to provision resources:

sunbeam configure --accept-defaults --openrc demo-openrc

Once the command completes, you will see the following message:

Writing openrc to demo-openrc ... done
What happens during this step?

The cloud preparation command performs the following actions:

  1. Creates a demo user.

  2. Populates the cloud with common templates.

  3. Creates a sandbox project with basic configuration.

Note

You will further explore cloud configuration in the following tutorial: On-board your users.

Conclusion

You now have a single-node Canonical OpenStack cloud that is ready to provision resources. The node, deployed on your dedicated machine or VM, serves the control, compute, and storage roles.

Launch a VM

Note

Duration: 1 minute (first VM launch always takes longer)

You can now provision a virtual machine on your Canonical OpenStack cloud using Sunbeam.

Execute the following command to provision a VM named “test”:

sunbeam launch ubuntu --name test

Sample output:

Launching an OpenStack instance ...
Access instance with `ssh -i /home/ubuntu/.config/openstack/sunbeam ubuntu@10.20.20.200`

Note

You will further explore resource provisioning in the following tutorial: Get familiar with OpenStack.

Use the provided command to connect to the VM over SSH:

ssh -i /home/ubuntu/.config/openstack/sunbeam ubuntu@10.20.20.200

You can use regular shell commands to execute various tasks in the VM:

$ uptime
10:54:29 up 1 min,  1 user,  load average: 0.00, 0.00, 0.00

To disconnect from the VM, type exit or press CTRL+D.

Next steps

Congratulations! You have completed this tutorial.

Explore the next steps: