Making Instance Snapshots on Chameleon

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.

 

Downloading cc-snapshot

 

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:

sudo cc-snapshot

...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!


Add a comment

1 comment

Juan David Gonzalez Aug. 29, 2018, 11:45 a.m.

Hi, I'm trying to create an snapshot, but when I execute the command I get the following message:

cc@master:~$ sudo cc-snapshot hadoop_single_node Will snapshot the instance using the following name: 'hadoop_single_node' Please enter your Chameleon username: my_user Please enter your Chameleon password: tar: Removing leading /' from member names tar: /var/lib/lxcfs: file changed as we read it tar: /var/lib/lxd/unix.socket: socket ignored tar: Removing leading/' from hard link targets tar: Removing leading /' from member names tar: /var/lib/lxcfs: file changed as we read it tar: /var/lib/lxd/unix.socket: socket ignored tar: Removing leading/' from hard link targets tar: Removing leading /' from member names tar: /var/lib/lxcfs: file changed as we read it tar: /var/lib/lxd/unix.socket: socket ignored tar: Removing leading/' from hard link targets tar: Removing leading /' from member names tar: /var/lib/lxcfs: file changed as we read it tar: /var/lib/lxd/unix.socket: socket ignored tar: Removing leading/' from hard link targets tar: Removing leading /' from member names tar: /var/lib/lxcfs: file changed as we read it tar: /var/lib/lxd/unix.socket: socket ignored tar: Removing leading/' from hard link targets Reading package lists... Building dependency tree... Reading state information... libguestfs-tools is already the newest version (1:1.32.2-4ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] Hit:3 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Get:5 http://security.ubuntu.com/ubuntu xenial-security/main Sources [131 kB] Hit:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [319 kB] Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [71.6 kB] Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [549 kB] Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [218 kB] Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [840 kB] Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [368 kB] Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [681 kB] Fetched 3,393 kB in 2s (1,642 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... kpartx is already the newest version (0.5.0+git1.656f8865-5ubuntu2.5). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. /usr/bin/cc-snapshot: line 222: LABEL: unbound variable

And if I look at the images it does not appear.