Learn OpenStack - Glance (Image Service) & Nova (Compute Service)
Episode 4 of 21

Learn OpenStack - Glance (Image Service) & Nova (Compute Service)

This episode combines Glance and Nova: uploading Ubuntu and Cirros cloud images in QCOW2 format, understanding flavors as hardware templates, creating your first instance via the CLI, then mastering lifecycle operations start, stop, reboot, resize, rebuild, shelve, migrate, and snapshot.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

Up to episode 3, you hadn't created anything "alive." Episode 4 changes that: you'll upload images, create flavors, and then give birth to your first instance — a real VM running on top of KVM. The two services at work here are Glance, the image provider, and Nova, the compute manager.

Episode 4 is split into two big parts: image management in Glance, and the instance lifecycle in Nova — from creation to advanced operations like resize, shelve, and snapshot.

Glance: OS Image Management

Cloud Images Ready to Use

Glance stores cloud images — OS images already configured for the cloud, including cloud-init support. The three most popular ones:

  • Ubuntu Cloud Image: a common choice for production.
  • CentOS / Rocky GenericCloud: for the RHEL ecosystem.
  • Cirros Test Image: an extremely small image for quick testing.
Download the Ubuntu cloud image
curl -LO https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img

Image Formats and Upload

Glance supports several disk formats. The most recommended one is QCOW2 because it supports copy-on-write and compression — saving space. RAW is faster to access but wastes space. VMDK is used for migrations from VMware.

Upload an image to Glance
openstack image create \
  --disk-format qcow2 \
  --container-format bare \
  --file jammy-server-cloudimg-amd64.img \
  ubuntu-jammy

The openstack image create command above uploads the image in QCOW2 format with the bare container format. For a quick verification, you can also upload Cirros:

Upload a small test image
curl -LO https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img
openstack image create --disk-format qcow2 --container-format bare \
  --file cirros-0.6.2-x86_64-disk.img cirros

Image Metadata and Properties

Images can carry properties that affect VM behavior. Common examples:

PropertyFunction
hw_firmware_typeForces UEFI or BIOS firmware
hw_scsi_modelEnables the SCSI disk model (e.g. virtio-scsi)
min_disk / min_ramMinimum resource limits
Set image properties
openstack image set --property hw_scsi_model=virtio-scsi ubuntu-jammy

Creating Your First Instance with Nova

Understanding Flavors

A flavor is the VM hardware template: a combination of vCPU, RAM, and root disk. DevStack ships with m1.small, m1.medium, and m1.large.

View the list of flavors
openstack flavor list

openstack flavor list shows the name, RAM, vCPU, and disk of each flavor. If you need a custom flavor:

Create a custom flavor
openstack flavor create --vcpus 2 --ram 4096 --disk 40 m2.medium

Checking Available Networks

An instance needs a network. DevStack already has a private (tenant) and a public (provider) network. Check them first:

View networks
openstack network list

Creating Your First Instance

Now it's time to give birth to an instance:

Create your first instance
openstack server create \
  --image cirros \
  --flavor m1.small \
  --network private \
  --key-name mykey \
  cirros-pertama

openstack server create requires an image, a flavor, and a network. The --key-name mykey argument injects an SSH keypair so you can log in without a password — details in episode 5.

Check instance status
openstack server show cirros-pertama

Wait until the status is ACTIVE and the power_state column reads Running. Congratulations, you have your first VM from the cloud!

Instance Lifecycle Operations

Start, Stop, and Reboot

Nova manages the entire lifecycle of an instance:

Basic lifecycle operations
openstack server stop cirros-pertama
openstack server start cirros-pertama
openstack server reboot cirros-pertama
openstack server delete cirros-pertama

openstack server stop shuts down the instance OS gracefully, while reboot can take a --hard flag to force a reset without an OS shutdown.

Resize and Rebuild

Resize changes an instance's flavor — adding or reducing resources — outside of business hours without creating a new instance:

Resize an instance
openstack server resize cirros-pertama --flavor m1.medium
openstack server resize confirm cirros-pertama

openstack server resize --flavor m1.medium allocates new resources and then needs confirmation. Rebuild restores an instance to its original image — useful when the OS is corrupted — while preserving the instance's identity.

Shelve, Migrate, and Snapshot

Shelve saves an instance's state to disk and releases its resources — saving capacity without deleting the instance:

Shelve and unshelve
openstack server shelve cirros-pertama
openstack server unshelve cirros-pertama

Migrate moves an instance to another host — for maintenance or load balancing. Snapshot creates an image from a running instance, letting you copy the VM to another flavor or project:

Create an instance snapshot
openstack server image create --name snapshot-ubuntu ubuntu-jammy-vm

Summary

Episode 4 is the moment core skills are born: uploading and managing images in Glance, understanding flavors, creating your first instance with openstack server create, and mastering the entire lifecycle from stop, reboot, resize, rebuild, shelve, and migrate to snapshot.

Key takeaways:

  • Glance stores cloud images; QCOW2 is the recommended format.
  • A flavor is the vCPU, RAM, and disk template for an instance.
  • openstack server create needs an image, a flavor, and a network.
  • Lifecycle: stop, start, reboot, delete, resize, rebuild, shelve, migrate.
  • A snapshot turns an instance into a reusable image.
  • Always check the status until ACTIVE before operating on an instance.

In episode 5, we'll cover cloud-init, keypairs, and the metadata service — automating instance configuration at boot, creating SSH keypairs for secure access, sending custom user-data scripts, and understanding the metadata service and config drive. This is the key to managing instances without manual logins.

Learn OpenStack - Glance (Image Service) & Nova (Compute Service) | Learn OpenStack