Snapshots and Images¶
OpenStack considers images and (instance) snapshots as technically similar, but a snapshot is usually the term used for a backup of an instance, and an image is the term usually used for a base installation that isn't specific to one instance.
Size limitation
In OpenStack environment, images and instance snapshots uploaded to the Image service (Glance) cannot exceed 1 TB.
Snapshot creation¶
For detailed instructions, please refer to the Create snapshot section.
Snapshot management¶
Share a Snapshot within the same project¶
Before creating a snapshot, you may want to remove local settings and sensitive data (such as public ssh keys, shell history, or customization scripts) to avoid sharing them unintentionally. The following steps describe how to prepare your instance before taking a snapshot. All steps are optional.
Danger
These steps will remove ssh access and local configurations from the instance. Perform them only immediately before shutting down the instance and creating the snapshot. After these changes, you will no longer be able to log in to the instance via ssh.
-
Remove your user’s ssh key. The public key is stored in
~/.ssh/authorized_keys
. For Ubuntu instances this file is under/home/ubuntu/.ssh/authorized_keys
. Delete it if you don’t intend to access instances built from the snapshot in the future. -
Remove the root user’s ssh key. Switch to root with
sudo su -
and repeat the step above, but edit/root/.ssh/authorized_keys
instead. -
Clean up cloud-init and customization data. Delete the following folders or files (note: not all may exist):
sudo rm -r /var/lib/cloud/data/* sudo rm -r /var/lib/cloud/instances/* sudo rm /var/lib/cloud/instance sudo rm -r /var/lib/cloud/handlers/* sudo rm /etc/cloud/uzh-customization-script sudo rm /var/log/*.log
-
(Optional) Convert the snapshot to an image.
Share snapshot or image with other projects¶
To share a snapshot or image across OpenStack projects using the web interface, follow these steps:
-
Convert Snapshot to Volume.
- Navigate to Project → Compute → Images in the ScienceCloud Web Interface. Locate the snapshot you want to convert (snapshots appear in the list along with other images).
- Click on the Create Volume button.
- In the Volume Details dialog, give the volume a Name and Description and click Create Volume.
-
Follow steps on Volume transfer.
-
Convert to instance image
- From the recipience project, navigate to Project → Volumes → Volumes.
- Find the volume and click on the Upload to Image from the action list.
- Once it's saved as an image, you can launch instances from the new project.
Tip
Instead of converting to the volume to an image, you can launch directly as in instance, by clicking Launch as Instance from the action menu on the volume.
Download a snapshot / image¶
To upload or download an image in OpenStack, you need glance
. The glance
command-line tool allows you to manage images directly, but it isn't installed by default on all Linux distributions.
Explaining how to install and use glance
is beyond the scope of this short guide. However, in most cases you can accomplish the same task using the OpenStack CLI command openstack image save
.
-
List images available in your project:
Example output:openstack image list
+--------------------------------------+--------------------------------------------------+--------+ | ID | Name | Status | +--------------------------------------+--------------------------------------------------+--------+ | 443a631f-70da-491f-971a-d38c268b0d30 | ***CUDA+Singularity on Ubuntu 24.04 (2024-11-21) | active | | c3a3b8f1-3468-4a3a-a2b4-92cca114dc5b | ***Debian 11.11 (2024-12-16) | active | | 2bd6b9ed-c7d9-4788-99dc-07c8325e6dae | ***Debian 12.11 (2025-09-01) | active | | 47c4ad94-285d-4d21-8dfe-16a123925221 | ***Singularity on Ubuntu 24.04 (2024-11-21) | active | | fa8a5b93-1770-486f-90d8-f37ecc1efe03 | ***Ubuntu 20.04 (2024-11-13) | active | | bb3d6a8c-c340-46d7-a577-cbc84c7fe6c9 | ***Ubuntu 22.04 (2024-11-13) | active | | fa3798c0-94d5-419a-bae1-46bbd55255b8 | ***Ubuntu 24.04 (2024-11-13) | active | | de6c2733-8d31-4632-82a2-a0f59c88eff6 | ***Windows Server 2022 Standard (2025-05-15) | active | | 9ec5d620-1b32-45e1-beb5-8b23bd0a3e0e | cirros-0.6.1 | active | | 50f7347c-a26a-492c-b345-2b86c25c2299 | rocky-linux-9.3 | active | | 608bc039-9a91-40d2-8e3d-b6d0d1211793 | ubuntu-focal-20.04 | active | | 0e6cf373-f175-4c99-b5ad-a4be4adb2202 | ubuntu-jammy-22.04 | active | | 8ce9ab67-9e3d-44fc-acca-2e064b338240 | my-custom-image | active | +--------------------------------------+--------------------------------------------------+--------+
-
Identify the
ID
of the image you want to download and save it to a local file with:After running the command, the image will be available locally at:openstack image save --file /path/to/my-custom-image.img <image-id>
/path/to/my-custom-image.img
.
Working with images¶
Change the image used by an instance¶
To switch to a new supported image on ScienceCloud, simply select it when launching instances from the web portal, replacing the previous one.
Upload an image¶
Warning
Always use the RAW format — QCOW2 is not supported and may cause issues.
-
Convert the image to RAW format. When uploading an image, we recommend to convert it to RAW format. Because of the storage backend system we are using, this disk format is the preferred format for the following reasons:
- Instances are faster to startup.
- Creating a snapshot is faster and uses much less space.
- Creating a volume from an image is faster and uses less space.
To convert image to RAW format on Linux, run:
Since a RAW image is not compressed, uploading an image with 20GB of virtual size will actually transfer 20GB of data to ScienceCloud. As a consequence, we strongly advice you to create images with very small virtual disks. As usual, the disk will be resized automatically when an instance is started from that image.qemu-img convert -O raw <orig-image> <new-image>
- Create an image using OpenStack CLI:
openstack image create --disk-format raw --container-format bare --private --file /path/to/image.img your-new-image
Create image from a snapshot¶
In OpenStack, Snapshots and Images are technically the same object, but they serve different purposes:
- Snapshot: a backup of a specific instance (including its metadata).
- Image: a reusable base installation, not tied to one instance.
A Snapshot can be turned into an Image by removing certain metadata properties. Once this is done, OpenStack will treat it as an Image and show it in the Images list rather than only under Snapshots.
From the web interface¶
- Navigate to Project → Compute → Images in the ScienceCloud Web Interface.
- Locate the snapshot you want to convert (snapshots appear in the list along with other images).
- Select the snapshot and choose Edit Image.
- From the left menu, select Metadata.
- In the metadata editor, remove any of these properties, if present:
image_location
image_state
image_type
kernel_id
owner_id
owner_user_name
user_id
ramdisk_id
- Click Update Image. The snapshot now appears in your Images list labeled as Type: Image.
From the command line¶
If you prefer the command line and are using the OpenStack client, you can remove snapshot metadata with:
openstack image unset \
--property image_location \
--property image_state \
--property image_type \
--property kernel_id \
--property owner_id \
--property owner_user_name \
--property user_id \
--property ramdisk_id \
<SNAPSHOT_UUID_OR_NAME>