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 the most popular open source cloud platform that aggregates distributed compute, network and storage resources in the data centre and enables on-demand provisioning of virtual machines through a self-service portal. OpenStack powers thousands of public and private clouds all over the world, providing rapid access for greater innovation and better economics.

Learn more about OpenStack >

What is MicroStack?

MicroStack is a micro cloud platform based on OpenStack, designed for the edge and small-scale data centre deployments, that can be installed and maintained with minimal effort. MicroStack eliminates the complexity behind OpenStack, providing an opinionated approach to OpenStack architecture design and a straightforward installation method.

Learn more about MicroStack >

What is Charmed OpenStack?

Charmed OpenStack is an enterprise cloud platform based on OpenStack, designed for large-scale data centre deployments, that provides full automation around the initial installation and day-2 operations. Charmed OpenStack abstracts the complexity behind OpenStack, using a composable approach to OpenStack architecture design with model-driven operators (charms).

Learn more about Charmed OpenStack >

In this tutorial, you will learn how to:

  • Distinguish between the various instance templates

  • Manage images

  • Manage flavors

You will only need:

One physical machine with:

MicroStack

These instructions use MicroStack - OpenStack in a snap. MicroStack is also available on other Linux distros, Windows and macOS. Refer to the MicroStack website for more information on how to install MicroStack on an OS other than Ubuntu.


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 and Ubuntu 18.04 LTS images to your workstation by clicking on the following links:

In the following steps, we’ll upload those images to Glance with minimum disk size and minimum RAM size set to 8 GB and 512 MB respectively. We’ll make the Ubuntu 20.04 LTS image available to all OpenStack users. The Ubuntu 18.04 LTS image we’ll make available to the admin project only.

Manage images through the OpenStack client

To upload the Ubuntu 20.04 LTS image to Glance, execute the following command:


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

To upload the Ubuntu 18.04 LTS image to Glance, execute the following command:


$ openstack --insecure image create --disk-format qcow2 --min-disk 8 --min-ram 512 --file ~/Downloads/bionic-server-cloudimg-amd64.img --private 18.04

To list all images, execute the following command:


$ openstack --insecure image list

Sample output:


+--------------------------------------+--------+--------+

| ID | Name | Status |

+--------------------------------------+--------+--------+

| 7ddf715d-a1a2-4d44-b9bb-6b2c128ee85a | 18.04 | active |

| 50f94870-622a-4f86-b676-77a2704cfb65 | 20.04 | active |

| 2b79c445-4593-43bd-81b8-19b41a82011e | cirros | active |

+--------------------------------------+--------+--------+

Manage images through the OpenStack dashboard

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

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

  • Image Name - Type 20.04

  • 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 Public

Then click the Create Image button:

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

  • Image Name - Type 18.04

  • File - Click Browse and find the bionic-server-cloudimg-amd64.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 all three 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 --insecure flavor create --ram 1024 --disk 10 --vcpus 1 myflavor

To list all flavors, execute the following command:


$ openstack --insecure flavor list

Sample output:


+--------------------------------------+-----------+-------+------+-----------+-------+-----------+

| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |

+--------------------------------------+-----------+-------+------+-----------+-------+-----------+

| 1 | m1.tiny | 512 | 1 | 0 | 1 | True |

| 2 | m1.small | 2048 | 20 | 0 | 1 | True |

| 28130087-5917-4268-9e6e-4dacffee0824 | myflavor | 1024 | 10 | 0 | 1 | True |

| 3 | m1.medium | 4096 | 20 | 0 | 2 | True |

| 4 | m1.large | 8192 | 20 | 0 | 4 | True |

| 5 | m1.xlarge | 16384 | 20 | 0 | 8 | 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 six flavors in the Nova’s database:

Note that the flavor ID (here 340cd92a-6d0c-4c09-be7b-ad1464175859) may be different in your environment.


4. Next steps

Congratulations! You have reached the end of this tutorial.

You can now move to the next tutorial - “6. Identities” - or explore other tutorials.

Take a survey!

Your feedback is very important for us and the entire OpenStack community. We want to understand how you use MicroStack and your pain points. Your feedback helps guide future MicroStack development.

Please fill in a short 5-question anonymous survey.

In this tutorial, you have learnt how to:

  • Distinguish between the various instance templates

  • Manage images

  • Manage flavors

Where to go from here?