Crate snapshot of an instance

Taking an instance snapshot can be useful if you want to keep a certain version of an instance.
For example: to relaunch an instance from a previous version or migrate an instance to another project.

Create snapshot

Before taking a snapshot, please make sure the instance is stopped.

If instance is up, data are not guaranteed to be flushed to disk.

Taking snapshot by using

$ openstack server image create <instance> --name myInstanceSnapshot

This creates an image named myInstanceSnapshot.

$ openstack image list
+------------+---------------------------------+--------+
| ID         | Name                            | Status |
+------------+---------------------------------+--------+
| id-image-1 | cirros-0.3.5-x86_64-uec         | active |
| id-image-2 | cirros-0.3.5-x86_64-uec-kernel  | active |
| id-image-3 | cirros-0.3.5-x86_64-uec-ramdisk | active |
| id-image-4 | myInstanceSnapshot              | active |
+------------+---------------------------------+--------+

Use case

Launch instance from snapshot

You can launch a new instance using a snapshot for the image parameter.

$ openstack server create --flavor <flavor> --image <snapshot> <instance>

Migrate to another project

Migrate an instance to another OpenStack project requires three steps:

  1. download snapshot as image
  2. import the image into the new project
  3. in the new project, launch new instance from imported snapshot as an image

To learn more about snapshots, please refer to the OpenStack documentation page.
OpenStack documentation