Skip to end of metadata
Go to start of metadata

When you have created a custom workflow or configuration on the API side, you can create a snapshot for your own use. In OpenStack, an instance snapshot is an image. The only difference between an image that has been uploaded directly to glance and an image you create by snapshot is that an image created by snapshot has additional properties in the glance database and defaults to being private.

You can create an snapshot from a running server instance, but if you want to preserve data, you must shut down the source VM and verify the instance status is SHUTOFF before creating the snapshot. 

To create the snapshot from the command line:

nova image-create --poll instance-name snapshot-image-name

(e.g. nova image-create --poll my-CentOS7-instance MyCustomCentos7Image-Feb-7-2017)

Snapshots won't show in Horizon (this has been submitted as a bug and may be fixed real soon now) but for now, to make it visible you'll need to export it and bring it back as a Glance image. If you just plan to use this within your project and from the command line only, the rest of the steps aren't necessary. 

glance image-download UID --file whatever_file_name_you_like.raw

(e.g. glance image-download 569677d8-c7b0-4606-86d8-7673a5ecd5cf --file c7custom-image.raw )

Then bring it into Glance - e.g.

glance image-create --name "My-Custom-Image-Name" --visibility public --disk-format raw --container-format bare --property skip_atmosphere=yes --property hw_disk_bus=scsi --property hw_scsi_model=virtio-scsi --property hw_qemu_guest_agent=yes --property os_require_quiesce=yes --file c7custom-image.raw 

There are a lot of metadata tags there but those are important to insure that your instances will create properly from the stored image. You definitely want to make sure you get them all.

Boot the new image. Test it. Make sure it works. 
Do this before deleting. Please. Once it's gone, it's really gone. Be sure. 

Delete your snapshot if you no longer need it. For example:

glance image-delete 569677d8-c7b0-4606-86d8-7673a5ecd5cf

  • No labels