Saving Your Work!
One of Chameleon’s features is the Glance image repository. If you’ve ever launched an instance, you have already used Glance without realizing it. Your project has access to all of Chameleon’s public Simple Appliances, which are machine images. In addition, each project keeps its own private set of images. This is handy when you want to build your own image. In this blog post, we are going to cover how to take an image snapshot using the cc-snapshot utility.
Something to note - the image snapshot feature is appropriate for saving system images when you have done certain tasks like compiling libraries or installing software. Due to the limit of system image sizes, it is less appropriate for storing user data such as your giant neural network weight file. For storing user data, you have the Swift object store functionality which we will cover in a subsequent post.
First, you need to be logged in to your running instance. Next, we need to make sure that you have the latest version of the cc-snapshot utility. Images built from either the CC-Centos7 or CC-Ubuntu16.04 simple appliances should have this installed. You may need to update cc-snapshot if you get the following error while following the steps in this blog post:
public endpoint for image service in regionOne not found Unable to contact Glance, check username and password
To download cc-snapshot, type in the following commands:
curl -O https://raw.githubusercontent.com/ChameleonCloud/cc-snapshot/master/cc-snapshot
sudo mv cc-snapshot /usr/bin/
sudo chmod +x /usr/bin/cc-snapshot
Taking a Snapshot
Taking a snapshot of your instance is very easy. Just type:
...and enter in your username and password. By default, your instance image will be saved as the instance’s name, followed by a UUID. If you would like to name your image something specific, you can type:
sudo cc-snapshot my_image_name
If you use an image name that has already been used, cc-snapshot will simply store this as a new image with the same name and a UUID. As a result, your old image will not be lost.
Viewing Your Images
Now that we’ve taken a snapshot, let’s look at the images in your project. Log in to the CHI portal where you launched your instance. In the left navigation panel, click Project > Compute > Images to see all images that are available to your project.
This list includes all public images. You can filter for images by name or by visibility. By default, the new image that you have created will be private. Click on the text input bar that says “Click here for filters”. Select Visibility and then Shared with Project.
The image list will repopulate with only images that are shared with other users in your project, including the one you just made.
At this point, you can re-launch the image from this snapshot or edit details such as the image name. Check back in two weeks to see how you can work with images on Chameleon Cloud from your local computer using the Glance client!