The cc-snapshot Utility
Overview
The cc-snapshot utility implements snapshotting a bare metal instance from command line and uploads it to Glance, so that it can be immediately used to boot a new bare metal instance. The snapshot images created with this tool are whole disk images.
For ease of use, cc-snapshot has been installed in all the appliances supported by the Chameleon project. If you would like to use it in a different setting, it can be downloaded and installed from the github repository.
To make a snapshot of a bare metal instance, run the following command from inside the instance:
sudo cc-snapshot <image_name>
Tip
You may get warnings, such as “image too large”, during snapshotting, and get prompted to confirm. If you are confident about what you are trying to do, you can skip all warnings by using the -f flag.
sudo cc-snapshot -f <image_name>
In addition, you can exclude directories by using the -e flag.
sudo cc-snapshot -e <dir1> -e <dir2> <image_name>
You can use existing OpenStack environment credentials instead of vendordata by using the -o flag.
sudo cc-snapshot -o <image_name>
You can use the faster zstd compression (default is zlib) by using the -z flag. Note that
launching images compressed with zstd won’t work on sites running OpenStack Xena or earlier.
All core sites like CHI@UC and CHI@TACC are up-to-date, but some associate sites, such as
CHI@NU, may fail to launch new instances with a zstd compressed image. If you are using an
associate site, we suggest checking that you can launch a new instance with the image from
your snapshot. You can check the compression type of an image by running
openstack image show <image_uuid> and checking the “compression_type” property. Images
set to zstd are using the new method, and images without a compression_type property
or with it set to zlib are using the old method.
sudo cc-snapshot -z <image_name>
To see all available options for cc-snapshot, run sudo cc-snapshot -h.
You will be prompted to enter your username and password.
Tip
You can skip entering username and password by setting the OS_USERNAME and OS_PASSWORD environment variables (manually or via The OpenStack RC Script), or by authenticating with ccauth and exporting its generated clouds.yaml entry via OS_CLOUD.
Note
When using the cc-snapshot, it will create an image within your project with the shared visibility. Anyone with access to your project can access this image.
Note
If you choose an Image name that already exists, the previous one will not be overwritten. A new Image with the same name but a different UUID will be generated.
Note
If you install a custom kernel, make sure the size of your running kernel (/lib/modules/<kernel_version>) is less than 4GB. To find out which kernel version you’re running, run uname -r.
Updating cc-snapshot
Error
If you receive the following error:
public endpoint for image service in regionOne not found Unable to contact Glance, check username and password
it means that you have an outdated copy of cc-snapshot and you will need to update cc-snapshot.
This usually happens when you use an older images that contains an outdated version of cc-snapshot.
You may also want to get new functionalities added to the latest version of cc-snapshot.
Run the following commands from your instance:
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