Your submission was sent successfully! Close

You have successfully unsubscribed! Close

Manage instance templates, including images and flavors

1. Overview

Before you get started!

Welcome to OpenStack!

In this series of tutorials, we will walk you through all the necessary steps to install, configure and get started with OpenStack. Using just your workstation, you will learn how to use OpenStack for cloud infrastructure implementation purposes, from a single-node installation to large-scale clusters.

This tutorial is the fifth in the “Phase I - Single-node OpenStack on your workstation” series.

Explore other tutorials >

What is OpenStack?

OpenStack is a collection of open-source projects designed to work together to form the basis of a cloud. OpenStack can be used for both private and public cloud implementation.

What is Sunbeam?

Sunbeam is an OpenStack project created to set the foundation for zero-ops OpenStack. By using highly opinionated architecture and native Kubernetes principles, Sunbeam delivers distilled OpenStack excellence on top of K8s.

What is MicroStack?

MicroStack (based on Sunbeam) is an OpenStack flavour designed for small-scale cloud environments, edge deployments, testing and development, with full commercial support available from Canonical.

In this tutorial, you will learn how to:

  • Distinguish between the various instance templates
  • Manage images
  • Manage flavors

You will only need:

One fresh physical or virtual machine with:


2. Manage images

Images are templates for creating instances on OpenStack. They contain the guest OS and are customised by cloud-init during the provisioning process.

The repository of Ubuntu cloud images is available at https://cloud-images.ubuntu.com/.

First, let’s download Ubuntu 20.04 LTS image to your workstation by clicking on the following link:

In the following steps, we’ll upload this images to Glance with minimum disk size and minimum RAM size set to 8 GB and 512 MB respectively. We’ll make the image available to the admin project only.

Manage images through the OpenStack client

To upload the image to Glance, execute the following command:


$ openstack image create --disk-format qcow2 --min-disk 8 --min-ram 512 --file ~/Downloads/focal-server-cloudimg-amd64-disk-kvm.img --private ubuntu-focal

To list all images, execute the following command:


$ openstack image list

Sample output:


+--------------------------------------+--------------+--------+
| ID                                   | Name         | Status |
+--------------------------------------+--------------+--------+
| 4c4fbf96-c5e5-49de-be6d-31bea2ea0ac8 | ubuntu       | active |
| 855b0d6d-eea7-45a0-bc41-bdeed2d9b362 | ubuntu-focal | active |
+--------------------------------------+--------------+--------+

Manage images through the OpenStack dashboard

Navigate to Admin -> Compute -> Images and click the Create Image button on the right:

To upload the image to Glance, fill in the form as follows:

  • Image Name - Type ubuntu-focal

  • File - Click Browse and find the focal-server-cloudimg-amd64-disk-kvm.img file in your Downloads directory

  • Format - Select QCOW2 - QEMU Emulator

  • Minimum Disk (GB) - Type 8

  • Minimum RAM (MB) - Type 512

  • Visibility - Choose Private

Then click the Create Image button:

You are now able to see two images in the Glance’s database:


3. Manage flavors

Flavors are other templates for creating instances on OpenStack. They define the size of virtual resources attached to the instance by default during the provisioning process. When creating an instance on OpenStack, the user needs to specify both the image and the flavor.

During OpenStack initialisation, Nova creates five flavors by default. In the following steps, we’ll create a new flavor called myflavor with 1 GB of RAM, 10 GB of disk for rootfs and 1 vCPU.

Manage flavors through the OpenStack client

To create the flavor, execute the following command:


$ openstack flavor create --ram 1024 --disk 10 --vcpus 1 myflavor

To list all flavors, execute the following command:


$ openstack flavor list

Sample output:


+--------------------------------------+-----------+------+------+-----------+-------+-----------+
| ID                                   | Name      |  RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+-----------+------+------+-----------+-------+-----------+
| 62ed11a5-6884-431e-b878-08dc63d06d7b | m1.large  | 8192 |   90 |         0 |     4 | True      |
| 6f196c0c-187f-4228-a4dc-862c6dbd7650 | m1.medium | 4096 |   60 |         0 |     2 | True      |
| cfb4b2e6-744a-4dac-b9a5-9b67518c0d56 | myflavor  | 1024 |   10 |         0 |     1 | True      |
| d7b19405-1731-47ac-8c3a-831e7163272c | m1.small  | 2048 |   30 |         0 |     1 | True      |
| e8984cb9-4d11-461b-9fed-fd17002b7653 | m1.tiny   |  512 |    4 |         0 |     1 | True      |
+--------------------------------------+-----------+------+------+-----------+-------+-----------+

Manage flavors through the OpenStack dashboard

Navigate to Admin -> Compute -> Flavors and click the Create Flavor button on the right:

To create the flavor, fill in the form as follows:

  • Name - Type myflavor

  • VCPUS - Type 1

  • RAM (MB) - Type 1024

  • Root Disk (GB) - Type 10

Then click the Create Flavor button:

You are now able to see all five flavors in the Nova’s database:

Note that flavor IDs may be different in your environment.


4. Next steps