Skip to main content
IMHCloud Logo
Back to support home

Creating Instance Snapshots in OpenStack: Backup and Recovery

Learn how to create, manage, and restore instance snapshots in OpenStack for effective backup and disaster recovery.

Introduction

Instance snapshots are a critical tool for protecting your OpenStack infrastructure. A snapshot captures the complete state of a running instance—including the operating system, installed applications, configuration files, and data—and stores it as a reusable image. This guide walks you through creating, managing, and restoring instance snapshots to safeguard your cloud environments.

Snapshots are particularly valuable when you need to test updates, perform maintenance, or recover from unexpected failures without manually rebuilding your instances.

Prerequisites

  • Access to an OpenStack cloud (InMotion Cloud, private cloud, or other provider)
  • At least one running or stopped instance
  • Sufficient storage capacity for snapshot images in the Glance image service
  • For CLI access: OpenStack command-line tools installed and configured

Snapshots vs. Volumes: When to Use Each

Understanding the difference between snapshots and volume backups helps you choose the right backup strategy.

Instance Snapshots:

  • Capture the entire instance state (OS, applications, configurations, data)
  • Create a bootable image stored in the Glance service
  • Independent of the source instance—can be used to launch new instances
  • Ideal for creating instance templates, testing updates, or quick disaster recovery
  • No dependency on the original instance after creation

Volume Snapshots and Backups:

  • Create point-in-time copies of individual volumes
  • Stored in the Block Storage (Cinder) service
  • May have parent-child dependencies—the original volume must exist to restore
  • Better for data-only backups and granular recovery
  • Useful when you need to preserve specific data without the entire instance

Choose instance snapshots when: Testing major updates, creating reusable instance templates, or recovering an entire system.

Choose volume backups when: Protecting specific data volumes, performing incremental backups, or managing multi-volume instances with selective recovery needs.

Creating Snapshots Using Horizon

Horizon provides a user-friendly interface for creating instance snapshots without command-line access.

Creating a Snapshot

  1. Log in to the Horizon dashboard.
  2. Navigate to Project > Compute > Instances.
  3. Locate the instance you want to snapshot and click on its name to view details.
  4. In the instance detail view, click the Create Snapshot button (typically in the top-right area).
  5. Enter a descriptive name for the snapshot (example: web-server-backup-2026-02-11).
  6. Optionally, add a description to document the snapshot's purpose (example: Pre-maintenance backup before OS update).
  7. Click Create Snapshot.

The snapshot creation begins immediately. For instances with large disks, the process may take several minutes. Once complete, the snapshot appears in the Project > Compute > Images section.

Monitoring Snapshot Progress

  1. Navigate to Project > Compute > Images.
  2. Look for your newly created snapshot in the image list.
  3. Check the Status column—it will display:
  • Queued: Initial state, waiting to process
  • Saving: Image is being created
  • Active: Snapshot is complete and ready to use

Creating Snapshots Using CLI

The OpenStack command-line interface offers powerful automation for snapshot creation, especially for scripting and bulk operations.

Basic Snapshot Creation

Create a snapshot of a running instance:

1openstack image create \
2 --instance <instance-id-or-name> \
3 <snapshot-name>

Example:

1openstack image create \
2 --instance my-web-server \
3 web-server-backup-2026-02-11

Snapshot Creation with Additional Options

For more control, include optional parameters:

1openstack image create \
2 --instance <instance-id-or-name> \
3 --private \
4 --wait \
5 <snapshot-name>

Parameters:

  • --private: Makes the snapshot visible only to your project (recommended for sensitive systems)
  • --wait: Waits for the snapshot to complete before returning control (useful for scripts)

Verify Snapshot Creation

List all available images, including your snapshots:

1openstack image list

View detailed information about a specific snapshot:

1openstack image show <snapshot-id-or-name>

Snapshot Best Practices

Following these practices ensures reliable snapshots and faster recovery times.

Instance State During Snapshot Creation

Running instances: OpenStack captures snapshots of running instances without stopping them. However, ensure that:

  • Applications are in a consistent state
  • Databases are not mid-transaction
  • File systems are not actively writing to disk

Stopped instances: Always create snapshots from stopped instances when possible. This guarantees a clean, consistent state and avoids potential data inconsistencies.

Pre-Snapshot Preparation

Before creating a snapshot:

  1. Stop the instance (recommended): Use Horizon or CLI to gracefully shut down the instance first.
1 openstack server stop <instance-name-or-id>
  1. Flush application caches: If you must snapshot a running instance, ensure applications have written all data to disk. Stop databases or services gracefully.
  2. Verify disk space: Confirm the instance has sufficient free disk space to prevent file system issues.
  3. Document the snapshot: Use clear naming conventions and descriptions to identify the snapshot's purpose and creation date.

Naming Conventions

Use consistent, descriptive names:

  • Format: <instance-role>-<purpose>-<date>
  • Example: database-pre-backup-2026-02-11
  • Example: api-server-stable-v1-2025-12-15

Avoid generic names like snapshot1 or backup_old that make it difficult to identify the snapshot's contents and age.

Retention and Cleanup

Implement a retention policy:

  • Keep snapshots for at least 7-30 days (depending on your recovery requirements)
  • Delete obsolete snapshots monthly to reduce storage costs
  • Document critical snapshots that must be retained indefinitely

Launching Instances from Snapshots

Snapshots are fully reusable images. You can launch new instances from snapshots in seconds.

Using Horizon

  1. Navigate to Project > Compute > Images.
  2. Find your snapshot in the image list.
  3. Click the dropdown menu next to the snapshot name.
  4. Select Launch Instance.
  5. Follow the standard instance creation wizard:
  • Choose instance name and description
  • Select flavor (instance size)
  • Choose networks
  • Add security groups
  • Configure other options as needed
  1. Click Launch Instance.

The new instance starts with the exact state captured in the snapshot.

Using CLI

Create an instance from a snapshot:

1openstack server create \
2 --image <snapshot-id-or-name> \
3 --flavor <flavor-name> \
4 --network <network-name> \
5 --security-group <security-group-name> \
6 <new-instance-name>

Example:

1openstack server create \
2 --image web-server-backup-2026-02-11 \
3 --flavor m1.medium \
4 --network private-network \
5 --security-group default \
6 web-server-restored

Post-Launch Configuration

After launching an instance from a snapshot:

  1. Verify all services started correctly.
  2. Update IP addresses and DNS records if needed.
  3. Re-run any configuration management tools if the environment changed.
  4. Test application functionality before production use.

Managing and Deleting Snapshots

Effective snapshot management prevents storage bloat and unnecessary costs.

Listing Snapshots

View all snapshots in Horizon:

  1. Navigate to Project > Compute > Images.
  2. Snapshots appear alongside other images.

View via CLI:

1openstack image list --property image_type=snapshot

Or list all images (includes snapshots):

1openstack image list

Viewing Snapshot Details

In Horizon:

  1. Click the snapshot name in the image list.
  2. Review creation date, size, and status.

Via CLI:

1openstack image show <snapshot-id-or-name>

Deleting Snapshots

Important: Deleting a snapshot is permanent and cannot be undone.

In Horizon:

  1. Navigate to Project > Compute > Images.
  2. Find the snapshot to delete.
  3. Click the dropdown menu next to the snapshot.
  4. Select Delete Image.
  5. Confirm the deletion.

Via CLI:

1openstack image delete <snapshot-id-or-name>

Troubleshooting Snapshot Issues

Snapshot Creation Stuck in "Saving" State

Problem: A snapshot appears to hang indefinitely in the "Saving" state.

Causes:

  • Insufficient storage space in Glance
  • Network connectivity issues
  • Instance disk I/O problems during snapshot creation

Solutions:

  1. Check available storage: Contact your cloud administrator to verify Glance has sufficient capacity.
  2. Wait longer: Very large instances (100+ GB) may take 30+ minutes. Monitor the progress.
  3. Stop the instance and retry: Shut down the instance and attempt the snapshot again from a stopped state.
  4. Check instance logs: SSH into the instance (if accessible) and review system logs for disk errors:
1 dmesg | tail -20

Cannot Launch Instance from Snapshot

Problem: Attempting to launch an instance from a snapshot fails.

Causes:

  • Snapshot is corrupt or incomplete
  • Insufficient quota or resources
  • Network or security group configuration issues

Solutions:

  1. Verify snapshot status is "Active" in Horizon or via CLI:
1 openstack image show <snapshot-name>
  1. Check your instance quota hasn't been reached:
1 openstack quota show
  1. Try a different flavor size (larger flavors sometimes succeed when smaller ones fail).
  2. Ensure default security groups and networks are properly configured.

Snapshot Size Larger Than Expected

Problem: A snapshot file is significantly larger than the instance's disk.

Causes:

  • Instance disk contains deleted files not yet reclaimed
  • Instance has unused allocated space

Solutions:

  1. Clean up instance disk before snapshotting:
1 sudo fstrim -v /

This command reclaims unused space on ext4 and similar file systems.

  1. For instances with large allocated but unused space, consider resizing or recreating the instance with a smaller disk.

"Permission Denied" When Creating Snapshot

Problem: Snapshot creation fails with a permission error.

Causes:

  • Insufficient permissions for your user or project
  • Project policy restrictions

Solutions:

  1. Verify your user has the required role (typically "member" or "admin").
  2. Contact your cloud administrator if permissions were intentionally restricted.
  3. Check project quota is not exceeded:
1 openstack quota show

Summary

Instance snapshots are a powerful backup and recovery mechanism in OpenStack. By following the procedures and best practices in this guide, you can:

  • Create reliable snapshots of running and stopped instances
  • Quickly recover systems using snapshot-based instances
  • Manage snapshots efficiently with appropriate naming and retention policies
  • Troubleshoot common snapshot issues

For critical systems, combine instance snapshots with volume backups for comprehensive data protection.

Related Resources

Related Articles

Read article

Launching Your First Instance in OpenStack Horizon

Step-by-step guide to launching your first virtual machine instance in OpenStack Horizon, from selecting an image to connecting via SSH.

Read article

Managing Running Instances: Start, Stop, and Reboot Operations

Learn how to safely start, stop, and reboot your cloud instances using Horizon and the OpenStack CLI. Master soft and hard reboots, understand best practices, and troubleshoot common issues.