OpenMCF logoOpenMCF

Loading...

OpenStack Image

Deploys an OpenStack Glance image from a URL or as a metadata entry, with configurable container and disk formats, visibility controls, minimum hardware requirements, and optional deletion protection.

What Gets Created

When you deploy an OpenStackImage resource, OpenMCF provisions:

  • Glance Image — an openstack_images_image_v2 resource registered in the OpenStack Image (Glance) service. When imageSourceUrl is provided, Glance downloads the image data from the specified URL. The image name is derived from metadata.name. Visibility, deletion protection, and minimum hardware requirements are applied as configured.

Prerequisites

  • OpenStack credentials configured via environment variables or OpenMCF provider config
  • A publicly accessible URL for the image data if using imageSourceUrl (Glance must be able to reach it)
  • Admin role if setting visibility to public

Quick Start

Create a file image.yaml:

apiVersion: openstack.openmcf.org/v1
kind: OpenStackImage
metadata:
  name: ubuntu-2204
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OpenstackImage.ubuntu-2204
spec:
  containerFormat: bare
  diskFormat: qcow2
  imageSourceUrl: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"

Deploy:

openmcf apply -f image.yaml

This uploads an Ubuntu 22.04 cloud image to Glance with bare container format and qcow2 disk format. The image is private by default.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
containerFormatstringContainer or envelope format of the image. ForceNew: cannot be changed after creation.One of: bare, ovf, aki, ari, ami, ova, docker, compressed
diskFormatstringFormat of the disk image data. ForceNew: cannot be changed after creation.One of: raw, vhd, vhdx, vmdk, vdi, iso, ploop, qcow2, aki, ari, ami

Optional Fields

FieldTypeDefaultDescription
imageSourceUrlstring—HTTP or HTTPS URL from which Glance downloads the image data. ForceNew: cannot be changed after creation. If omitted, the image is created as a metadata entry only and the data must be uploaded separately (e.g., via the glance CLI).
minDiskGbint0Minimum disk size in GB required to boot this image. Zero means no minimum.
minRamMbint0Minimum RAM in MB required to boot this image. Zero means no minimum.
protectedboolfalsePrevents the image from being deleted. Set to true for production images that should not be accidentally removed.
hiddenboolfalseHides the image from default listing queries. Hidden images are still accessible by UUID.
tagsstring[][]Tags for filtering images in Glance. Example: ["ubuntu", "22.04", "cloud-init"].
visibilitystringprivateControls who can see and use this image. private: only the owner project. shared: owner can share with specific projects. community: visible to all but not in default listings. public: visible and usable by all (requires admin).
regionstringprovider defaultOverrides the region from the provider config for this image.

Examples

Cloud Image from URL

Upload an Ubuntu 22.04 cloud image from the official Canonical repository:

apiVersion: openstack.openmcf.org/v1
kind: OpenStackImage
metadata:
  name: ubuntu-2204
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OpenstackImage.ubuntu-2204
spec:
  containerFormat: bare
  diskFormat: qcow2
  imageSourceUrl: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
  tags:
    - ubuntu
    - "22.04"
    - cloud-init

Protected Golden Image with Hardware Requirements

A production golden image with deletion protection, minimum hardware requirements, and shared visibility so it can be distributed to specific projects:

apiVersion: openstack.openmcf.org/v1
kind: OpenStackImage
metadata:
  name: golden-rhel9
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.OpenstackImage.golden-rhel9
spec:
  containerFormat: bare
  diskFormat: qcow2
  imageSourceUrl: "https://images.internal.example.com/rhel9-golden-20250101.qcow2"
  minDiskGb: 20
  minRamMb: 2048
  protected: true
  visibility: shared
  tags:
    - rhel
    - "9"
    - golden
    - hardened

ISO Image for Installation Media

Register an ISO image for use as installation media, hidden from default listings:

apiVersion: openstack.openmcf.org/v1
kind: OpenStackImage
metadata:
  name: debian-12-netinst
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OpenstackImage.debian-12-netinst
spec:
  containerFormat: bare
  diskFormat: iso
  imageSourceUrl: "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.9.0-amd64-netinst.iso"
  hidden: true
  tags:
    - debian
    - "12"
    - installer

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
image_idstringUUID of the created Glance image. Used as a foreign key by OpenStackInstance and OpenStackVolume.
namestringName of the image, derived from metadata.name.
checksumstringMD5 checksum of the image data, computed by Glance after upload.
size_bytesint64Size of the image data in bytes, computed by Glance after upload.
statusstringCurrent lifecycle state of the image (e.g., active, queued, saving).
filestringURL path to the image data in the Glance store (e.g., /v2/images/<uuid>/file).
regionstringOpenStack region where the image was created.

Related Components

  • OpenStackInstance — boots compute instances from this image via imageName or imageId
  • OpenStackVolume — creates bootable Cinder volumes from this image

Next article

OpenStack Instance

OpenStack Instance Deploys an OpenStack Compute instance with configurable flavor, image or boot-from-volume source, network attachments via network UUID or pre-provisioned port, and optional placement controls via server groups and availability zones. What Gets Created When you deploy an OpenStackInstance resource, OpenMCF provisions: Compute Instance — an openstackcomputeinstancev2 resource with the specified flavor and image (or block device boot source), placed in the configured networks...
Read next article
Presets
1 ready-to-deploy configurationView presets →