Snapshots and Images¶
🔧 Under Development
This page is under active development. Content is being updated as we prepare the new version of ScienceCloud for production. Some sections may be incomplete or subject to change.
OpenStack considers images and 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.
Snapshot creation¶
For detailed instructions, please refer to the Create snapshot section.
Create a consistent snapshot¶
For detailed instructions, please refer to the Training Handout section Images / Create a new image from a running instance.
Snapshot size issues¶
Users may experience issues with snapshot sizes during creation. The following articles in ScienceCloud (Legacy) documentation offer troubleshooting support:
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¶
For detailed instructions, please refer to the article Is it possible to download an image/snapshot from ScienceCloud in order to use it on a different cloud or on my local machine?.
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.
Convert an image to RAW¶
For detailed instructions, please refer to the article How do I convert an image to RAW before uploading it to ScienceCloud?.
Upload an image¶
More information can be found in the following articles in ScienceCloud (Legacy) documentation:
- In the user guide section Images / Upload an image
- In the article How do I upload an image to ScienceCloud?
- In the FAQ on troubleshooting an issue related to uploading of an image Why can't I upload an image from the Web Interface using remote location as the Image Source?
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 Metadata.
- 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>