Creating and Managing Images in OpenStack Horizon
Images in OpenStack provide the base operating system and software configuration for your virtual machines (instances). Whether you need to create a custom image with pre-configured software, upload an existing disk image, or manage your image library, OpenStack Glance (the image service) gives you complete control through the Horizon dashboard.
This guide walks you through creating custom images, uploading existing images, and managing your image library effectively.
Understanding OpenStack Images
An image in OpenStack is a bootable file containing an operating system and (optionally) pre-installed software. Images are stored and managed by Glance, OpenStack's image service.
Image Types:
- Public Images: Available to all projects in your OpenStack environment (managed by administrators)
- Private Images: Only accessible within your specific project
- Shared Images: Explicitly shared with specific projects
Common Image Formats:
- QCOW2 (recommended): Supports snapshots, thin provisioning, and compression
- RAW: Uncompressed disk image, larger file size but faster performance
- VHD/VHDX: Virtual Hard Disk format (Hyper-V compatible)
- VMDK: VMware disk format
- ISO: Installation disc image for manual OS installation
Accessing the Images Panel
Navigate to the Images section in Horizon:
- Log in to your OpenStack Horizon dashboard
- From the left sidebar, select Compute > Images
- You will see your available images listed with details like name, type, status, format, and size
The Images panel displays both public images (provided by your cloud administrator) and your private project images.
Creating a Custom Image from an Instance
The most common way to create a custom image is by taking a snapshot of an existing, configured instance.
When to Create Custom Images
Create a custom image when you:
- Have configured an instance with specific software packages
- Want to replicate a working environment across multiple instances
- Need to preserve a particular system configuration
- Want to create templates for rapid deployment
Step-by-Step: Create Image from Instance
Step 1: Prepare Your Instance
Before creating an image:
- Clean up temporary files and logs
- Remove SSH host keys (they should be regenerated on first boot)
- Clear command history if it contains sensitive information
- Shut down unnecessary services
- Run package updates to ensure the latest software
For Linux instances, run cleanup commands:
1sudo apt-get clean2sudo rm -rf /tmp/*3sudo history -c
Step 2: Create the Snapshot
- Navigate to Compute > Instances
- Locate your configured instance in the list
- Click the dropdown arrow next to Create Snapshot in the Actions column
- In the Create Snapshot dialog:
- Snapshot Name: Enter a descriptive name (e.g.,
ubuntu-22-webserver-configured) - Description: Add details about what software or configuration this image includes
- Click Create Snapshot
Step 3: Monitor Creation Progress
- Navigate to Compute > Images
- Your new image will appear with status "Queued" or "Saving"
- Wait for the status to change to "Active" (this may take several minutes depending on instance size)
- Once Active, your image is ready to launch new instances
Best Practices for Custom Images
Naming Conventions:
Use descriptive, structured names that include:
- Operating system and version
- Key software or purpose
- Date created (optional)
Example: ubuntu-22.04-nginx-php8.2-2026-01
Image Cleanup:
Before creating production images:
- Remove user-specific data
- Clear package manager caches
- Remove old kernels
- Zero out free space to reduce image size
Documentation:
Add detailed descriptions including:
- Installed software packages and versions
- Configuration changes from base OS
- Special requirements or dependencies
- Intended use case
Uploading External Images
You can upload pre-built images from external sources or images you have created outside OpenStack.
Supported Image Sources
- Operating system vendor images (Ubuntu Cloud Images, CentOS Cloud Images, etc.)
- Custom images created with tools like Packer or VirtualBox
- Converted images from other virtualization platforms
- Pre-configured appliances from software vendors
Step-by-Step: Upload an Image
Step 1: Prepare Your Image File
Ensure your image:
- Is in a supported format (QCOW2 recommended)
- Has cloud-init or similar initialization tools installed
- Is configured for cloud environments (DHCP networking, SSH access enabled)
- Does not contain hardware-specific configurations
Step 2: Upload Through Horizon
- Navigate to Compute > Images
- Click Create Image button in the upper right
- In the Create Image dialog, configure:
Image Details:
- Image Name: Descriptive name for the image
- Image Description: Detailed description of OS and contents
- File: Click Browse and select your local image file
- Format: Select the image format (QCOW2, RAW, VHD, VMDK, ISO)
Image Requirements:
- Architecture: Select architecture (typically x86_64)
- Minimum Disk (GB): Minimum root disk size required
- Minimum RAM (MB): Minimum memory required
Image Properties (expand Advanced section):
- Protected: Check this to prevent accidental deletion
- Visibility: Choose Project (private) or Public (if administrator)
- Click Create Image
Step 3: Monitor Upload Progress
The upload process may take several minutes depending on:
- Image file size
- Your network connection speed
- OpenStack storage backend performance
Watch the progress indicator and wait for the status to change to "Active".
Using Image URLs
For large images or images hosted externally, you can provide a URL instead of uploading directly:
- In the Create Image dialog, select Image Location tab
- Choose Image Location format (URL)
- Enter the direct URL to your image file
- Complete the other fields as described above
- Click Create Image
OpenStack will download the image from the provided URL directly to the image store.
Managing Your Image Library
Effective image management helps maintain an organized, efficient cloud environment.
Viewing Image Details
To see complete information about an image:
- Navigate to Compute > Images
- Click on the image name
- Review tabs:
- Overview: Basic details, format, size, visibility
- Metadata: Custom properties and configuration details
Editing Image Properties
To modify image metadata:
- Click on an image name
- Select Update Metadata from the Actions dropdown
- Add or modify custom properties:
os_type: Operating system type (linux, windows)os_version: Specific OS versionhw_disk_bus: Disk bus type (virtio, scsi, ide)hw_vif_model: Network interface model (virtio, e1000)
- Click Save
Custom metadata helps with image organization and can affect instance performance.
Protecting Important Images
To prevent accidental deletion:
- Click on an image name
- Select Update Metadata
- Check Protected
- Click Save
Protected images cannot be deleted until you remove the protection flag.
Sharing Images with Other Projects
Project administrators can share private images:
- Click on an image name
- Note the Image ID from the Overview tab
- Use the OpenStack CLI to share:
1openstack image add project IMAGE_ID PROJECT_ID2openstack image set --shared IMAGE_ID
The image will become available to the specified project.
Deleting Unused Images
To remove images you no longer need:
- Navigate to Compute > Images
- Find the image to delete
- Click the dropdown in the Actions column
- Select Delete Image
- Confirm the deletion
Important: You cannot delete:
- Protected images (remove protection first)
- Public images (administrators only)
- Images currently in use by active instances
Before deleting, verify no instances depend on this image for snapshots or rebuild operations.
Image Formats and Conversion
Understanding image formats helps you choose the right format for your use case.
QCOW2 (Recommended)
Advantages:
- Supports thin provisioning (only uses space for actual data)
- Enables copy-on-write snapshots
- Supports compression
- Smaller file sizes
When to Use:
- General purpose images
- Images that will be snapshotted frequently
- Limited storage environments
RAW Format
Advantages:
- Simplest format
- Best performance (no overhead)
- Direct disk access
Disadvantages:
- Larger file sizes (no compression)
- No snapshot support
- Takes full disk space immediately
When to Use:
- High-performance requirements
- Images that will not be snapshotted
- Ample storage available
Converting Between Formats
Use qemu-img to convert images:
1# Convert RAW to QCOW22qemu-img convert -f raw -O qcow2 input.img output.qcow234# Convert VMDK to QCOW25qemu-img convert -f vmdk -O qcow2 input.vmdk output.qcow267# Compress QCOW2 image8qemu-img convert -c -O qcow2 input.qcow2 compressed.qcow2
Always test converted images before uploading to production.
Image Storage and Quotas
Images consume storage resources in your OpenStack environment.
Understanding Image Storage
- Images are stored in the Glance image store (typically Ceph or Swift)
- Each image counts against your project quota
- Larger images take longer to launch instances
- Multiple copies of similar images waste storage
Checking Storage Usage
To view your current usage:
- Navigate to Compute > Images
- Review the Size column for each image
- Check your project quota at Project > Compute > Overview
Look for the Images quota section showing:
- Number of images used vs. available
- Total storage used by images
Optimizing Image Storage
Reduce Image Count:
- Delete old or unused images
- Consolidate similar images
- Use base images and configure at launch with cloud-init
Reduce Image Size:
- Remove unnecessary packages before snapshotting
- Clear caches and temporary files
- Use compression (QCOW2 format)
- Zero out free space before creating images
Use Shared Images:
- Share common images across projects instead of duplicating
- Use public images when possible
Troubleshooting Common Issues
Image Upload Fails
Symptoms: Upload stalls, times out, or reports error
Solutions:
- Check file size limits in your OpenStack configuration
- Verify network connection stability
- Use CLI upload for very large files:
openstack image create --file image.qcow2 image-name - Try uploading from a location closer to your OpenStack environment
Instance Fails to Boot from Image
Symptoms: Instance enters error state or fails to respond
Possible Causes:
- Image format mismatch: Verify the format matches the actual file type
- Missing bootloader: Ensure the image has a bootloader installed
- Incorrect disk bus: Try different
hw_disk_busmetadata values - Insufficient resources: Increase minimum disk or RAM requirements
Solutions:
- Launch with more resources than image minimum
- Check instance console logs for boot errors
- Verify image integrity with
qemu-img check - Recreate image with proper cloud-init configuration
Cannot Delete Image
Symptoms: Delete operation fails or image remains
Causes:
- Image is protected
- Image is in use by active instances
- Insufficient permissions
Solutions:
- Remove protection:
openstack image set --unprotected IMAGE_ID - Terminate instances using the image
- Contact your OpenStack administrator for public images
Image Shows "Queued" Status Indefinitely
Symptoms: Image stuck in Queued status, never becomes Active
Solutions:
- Check Glance service status with your administrator
- Verify adequate storage backend space
- Review Glance logs for errors:
/var/log/glance/ - Cancel and retry the operation
Security Considerations
Image Security Best Practices
Before Creating Images:
- Update all packages to latest security patches
- Remove default passwords
- Disable unnecessary services
- Remove private SSH keys
- Clear logs containing sensitive data
- Scan for malware or vulnerabilities
When Uploading External Images:
- Only use images from trusted sources
- Verify image checksums match published values
- Scan images for malware before uploading
- Review installed software and configurations
- Test in isolated environment first
Ongoing Management:
- Regularly update base images with security patches
- Document image contents and update frequency
- Mark old images as deprecated rather than deleting immediately
- Implement image naming that includes security patch level
Compliance and Auditing
For regulated environments:
- Tag images with compliance information (HIPAA, PCI-DSS, etc.)
- Maintain image creation audit trail
- Document installed software versions
- Implement image approval workflow before production use
- Regularly audit image library for outdated or non-compliant images
Advanced Image Operations
Creating Windows Images
Windows images require additional preparation:
- Install VirtIO drivers for paravirtualized devices
- Enable Remote Desktop
- Configure Windows Firewall for cloud environment
- Run Sysprep before creating image
- Set minimum resources appropriately (8GB RAM minimum)
Using Cloud-Init
Linux images benefit from cloud-init for automatic configuration:
Cloud-init enables:
- Automatic hostname configuration
- SSH key injection
- Network configuration via DHCP
- User account creation
- Package installation at first boot
- Running custom scripts
Most modern Linux cloud images include cloud-init pre-configured.
Multi-Architecture Images
For environments with different CPU architectures:
- Create separate images for each architecture (x86_64, arm64)
- Tag images with architecture metadata
- Use descriptive naming to identify architecture
- Test images on target hardware before production use
How to Manage Images Using OpenStack CLI
While the Horizon dashboard provides a visual interface for image management, the OpenStack command-line interface offers powerful automation capabilities and additional control. The CLI is essential for scripting, bulk operations, and integrating image management into your deployment workflows.
Installing the OpenStack CLI
Before using these commands, ensure you have the OpenStack CLI installed and configured:
1# Install OpenStack CLI client2pip install python-openstackclient34# Verify installation5openstack --version
You will need your OpenStack credentials configured. These are typically sourced from an RC file provided by your cloud administrator:
1source openstack-rc.sh
Creating an Image from an Instance
To create a snapshot of a running or stopped instance via CLI:
1# Basic syntax2openstack server image create --name IMAGE_NAME INSTANCE_NAME34# Create snapshot with description5openstack server image create \6 --name ubuntu-22-webserver-v1 \7 --description "Ubuntu 22.04 with Nginx and PHP 8.2 configured" \8 my-webserver-instance
Expected Output:
1+------------------+--------------------------------------+2| Field | Value |3+------------------+--------------------------------------+4| id | 5f2a8d9c-3e4b-4f6a-9c1d-8e7f2a3b4c5d |5| name | ubuntu-22-webserver-v1 |6| status | SAVING |7| visibility | private |8| size | None |9+------------------+--------------------------------------+
Check snapshot creation progress:
1openstack image show ubuntu-22-webserver-v1 -c status -c progress
Wait until the status changes from "queued" or "saving" to "active" before using the image.
Advanced options:
1# Create snapshot and wait for completion2openstack server image create --name my-snapshot --wait my-instance34# Create snapshot of a stopped instance (recommended for consistency)5openstack server stop my-instance6openstack server image create --name my-snapshot my-instance7openstack server start my-instance
Uploading an Image
To upload an image file from your local system or a URL:
1# Upload a local QCOW2 image2openstack image create \3 --file /path/to/image.qcow2 \4 --disk-format qcow2 \5 --container-format bare \6 --min-disk 10 \7 --min-ram 1024 \8 --property os_type=linux \9 --property os_version=22.04 \10 ubuntu-22-custom1112# Upload from a URL13openstack image create \14 --copy-from https://cloud-images.ubuntu.com/releases/22.04/ubuntu-22.04-server.img \15 --disk-format qcow2 \16 --container-format bare \17 ubuntu-22-cloud-image
Available disk formats:
qcow2- QEMU Copy-On-Write (recommended)raw- Raw disk imagevhd- Virtual Hard Diskvmdk- VMware disk formatiso- ISO 9660 format
Expected Output:
1+------------------+--------------------------------------+2| Field | Value |3+------------------+--------------------------------------+4| id | a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d |5| name | ubuntu-22-custom |6| disk_format | qcow2 |7| status | queued |8| visibility | private |9| size | 2361393152 |10+------------------+--------------------------------------+
Upload progress monitoring:
For large images, the upload may take time. Monitor with:
1watch -n 5 'openstack image show ubuntu-22-custom -c status -c size'
Listing Images
View all available images in your project:
1# List all images (public and private)2openstack image list34# Show only your private images5openstack image list --private67# Show only public images8openstack image list --public910# Filter by name pattern11openstack image list --name ubuntu1213# Show additional details in table format14openstack image list --long
Example Output:
1+--------------------------------------+------------------------+--------+2| ID | Name | Status |3+--------------------------------------+------------------------+--------+4| 5f2a8d9c-3e4b-4f6a-9c1d-8e7f2a3b4c5d | ubuntu-22-webserver-v1 | active |5| a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d | ubuntu-22-custom | active |6| c3d4e5f6-7a8b-9c0d-1e2f-3a4b5c6d7e8f | centos-9-stream | active |7+--------------------------------------+------------------------+--------+
Sort and filter results:
1# Sort by creation date (newest first)2openstack image list --sort created_at:desc34# Filter by status5openstack image list --status active67# Combine filters8openstack image list --private --status active --sort name:asc
Viewing Image Details
Get comprehensive information about a specific image:
1# Show all image properties2openstack image show IMAGE_NAME_OR_ID34# Show specific fields only5openstack image show ubuntu-22-webserver-v1 \6 -c name -c status -c size -c disk_format -c visibility78# Output in JSON format for scripting9openstack image show ubuntu-22-webserver-v1 -f json
Example Output:
1+------------------+--------------------------------------+2| Field | Value |3+------------------+--------------------------------------+4| id | 5f2a8d9c-3e4b-4f6a-9c1d-8e7f2a3b4c5d |5| name | ubuntu-22-webserver-v1 |6| status | active |7| visibility | private |8| size | 2361393152 |9| disk_format | qcow2 |10| container_format | bare |11| min_disk | 10 |12| min_ram | 1024 |13| created_at | 2026-01-29T10:30:45Z |14| updated_at | 2026-01-29T10:35:12Z |15| properties | os_type='linux', os_version='22.04' |16+------------------+--------------------------------------+
Deleting an Image
Remove images you no longer need:
1# Delete a single image2openstack image delete IMAGE_NAME_OR_ID34# Delete multiple images5openstack image delete image1 image2 image367# Delete with confirmation8openstack image delete ubuntu-old-version
Note: The command does not output anything on success. Verify deletion with:
1openstack image list | grep ubuntu-old-version
Before deleting:
- Verify no active instances depend on this image
- Remove protection if enabled (see next section)
- Consider archiving important images instead of deleting
Cannot delete if:
- Image is protected
- Image is public (requires admin privileges)
- Image is in use by active instances (though it will be queued for deletion)
Setting Image Properties
Modify image metadata to control behavior and organization:
1# Set protection to prevent accidental deletion2openstack image set --protected IMAGE_NAME34# Remove protection5openstack image set --unprotected IMAGE_NAME67# Set minimum resource requirements8openstack image set \9 --min-disk 20 \10 --min-ram 2048 \11 IMAGE_NAME1213# Add custom properties14openstack image set \15 --property os_type=linux \16 --property os_version=22.04 \17 --property hw_disk_bus=virtio \18 --property hw_vif_model=virtio \19 IMAGE_NAME2021# Change visibility (requires appropriate permissions)22openstack image set --private IMAGE_NAME23openstack image set --public IMAGE_NAME # Admin only24openstack image set --shared IMAGE_NAME2526# Update name or description27openstack image set \28 --name ubuntu-22-webserver-v2 \29 --description "Updated with security patches" \30 ubuntu-22-webserver-v1
Useful image properties for performance:
1# Set disk bus type for better performance2openstack image set --property hw_disk_bus=virtio IMAGE_NAME34# Set network interface model5openstack image set --property hw_vif_model=virtio IMAGE_NAME67# Set SCSI bus for improved disk I/O8openstack image set --property hw_scsi_model=virtio-scsi IMAGE_NAME910# Enable multiqueue for network performance11openstack image set --property hw_vif_multiqueue_enabled=true IMAGE_NAME
Common metadata properties:
| Property | Purpose | Example Values |
|----------|---------|----------------|
| os_type | Operating system type | linux, windows |
| os_distro | Linux distribution | ubuntu, centos, debian |
| os_version | OS version number | 22.04, 9, 11 |
| architecture | CPU architecture | x86_64, aarch64 |
| hw_disk_bus | Disk bus type | virtio, scsi, ide |
| hw_vif_model | Network interface | virtio, e1000 |
| hw_qemu_guest_agent | Guest agent support | yes, no |
Advanced CLI Operations
Downloading an image:
1# Download image to local file2openstack image save --file /path/to/save/image.qcow2 IMAGE_NAME34# Verify download with checksum5openstack image show IMAGE_NAME -c checksum -f value6md5sum /path/to/save/image.qcow2
Sharing images with other projects:
1# Add project as image member (requires image ID and project ID)2openstack image add project IMAGE_ID PROJECT_ID34# Set image to shared visibility first5openstack image set --shared IMAGE_ID67# List image members8openstack image member list IMAGE_ID910# Remove project access11openstack image remove project IMAGE_ID PROJECT_ID
Bulk operations with scripting:
1# Delete all images matching a pattern2openstack image list --name "test-" -f value -c ID | \3 xargs -n1 openstack image delete45# Set all private images to protected6openstack image list --private -f value -c ID | \7 xargs -n1 openstack image set --protected89# Export image list to CSV10openstack image list --long -f csv > images-export.csv
Working with image properties:
1# View all custom properties2openstack image show IMAGE_NAME -c properties34# Remove a specific property5openstack image unset --property os_version IMAGE_NAME67# Copy properties from one image to another8SOURCE_PROPS=$(openstack image show source-image -c properties -f json)9openstack image set --property "$SOURCE_PROPS" target-image
CLI Best Practices
Use image IDs for scripts:
Image IDs are permanent, while names can be changed or duplicated. In automation scripts, always reference images by ID:
1# Get image ID by name2IMAGE_ID=$(openstack image list --name ubuntu-22-webserver -f value -c ID)34# Use ID in subsequent commands5openstack server create --image $IMAGE_ID --flavor m1.medium my-instance
Add meaningful metadata:
Include descriptive properties to track image history and requirements:
1openstack image set \2 --property created_by="DevOps Team" \3 --property build_date="2026-01-29" \4 --property patch_level="2026-01" \5 --property source="packer-build-123" \6 ubuntu-22-webserver-v1
Verify before deploying:
Always check image status before launching instances:
1# Quick status check2if [ "$(openstack image show my-image -c status -f value)" = "active" ]; then3 openstack server create --image my-image --flavor m1.medium instance-14else5 echo "Error: Image not ready"6 exit 17fi
Use descriptive output formats:
The CLI supports multiple output formats for different needs:
1# Human-readable table (default)2openstack image list34# Values only (for scripting)5openstack image list -f value -c ID -c Name67# JSON (for parsing)8openstack image list -f json910# CSV (for spreadsheets)11openstack image list -f csv > images.csv1213# YAML (for configuration)14openstack image show my-image -f yaml
Summary
Effective image management in OpenStack provides:
Custom Images: Create configured templates by snapshotting instances with your desired software stack and configuration using both Horizon dashboard and CLI commands.
External Uploads: Import pre-built images from vendors or images you have created with external tools in formats like QCOW2, RAW, or VMDK through the GUI or command line.
Organization: Use descriptive naming, detailed descriptions, and metadata to maintain an organized, searchable image library across both interfaces.
Storage Optimization: Manage quotas by deleting unused images, compressing files, and sharing common images across projects using automated CLI scripts.
Security: Keep images updated with security patches, scan external images, and document contents for compliance using CLI automation.
Workflow Flexibility: Use Horizon for visual management and one-off tasks, and leverage the CLI for automation, scripting, and bulk operations in your deployment pipelines.
By mastering image creation and management in both OpenStack Horizon and the CLI, you can rapidly deploy pre-configured environments, maintain consistency across instances, automate image lifecycle management, and optimize your cloud infrastructure efficiency.
