It is possible to create a point-in-time "snapshot" of a block storage volume. A snapshot is not a backup, but simply a reference point to how your data looked at a given time. You can then create new volumes based on this snapshot. In this way, think of snapshots and volumes like images and virtual machines.

To work with snapshots, first create a volume:

$ cinder create --name myvol 10

Next, attach the volume to an instance and add some data to it: 

$ nova volume-attach myinstance <myvol uuid> /dev/sdc
$ ssh ubuntu@myinstance
$ sudo su
$ mkfs.ext4 /dev/sdc
$ mount /dev/sdc /mnt
$ cd /mnt
$ wget https://git.kernel.org/torvalds/t/linux-4.12-rc3.tar.gz
$ tar xzvf linux-4.12-rc3.tar.gz
$ cd
$ umount /mnt
$ exit
$ exit

To create a snapshot, you must first detach your volume:

$ nova volume-detach myinstance <myvol uuid>

Now, create the snapshot:

$ cinder snapshot-create --name myvol-snap1 myvol

You can now proceed in two different ways:

  1. Re-attach the original myvol volume and continue adding data to it. New data will not appear on the snapshot you just created.

  2. Create a new volume from the snapshot: 

    $ cinder create --name myvol2 --snapshot-id <myvol-snap1 uuid> 15


    Once you have created a new volume based on the snapshot, you can attach it to an instance. It will contain all of the data which was on the volume at the time you created the snapshot.

    Note that the size of the above volume is 15gb while the original volume was 10gb. However, note that when you attach the volume, the Operating System will only see a 10gb volume. You must extend the size of the filesystem from within the Operating System. This procedure varies for each Operating System and is out of the scope of this document.

When you want to delete a volume, you must first delete any snapshots of that volume. If you attempt to delete a volume before you delete its snapshots, you will see an error.

$ cinder delete myvol-snap1
$ cinder delete myvol


Note that myvol2 can still exist. It is entirely independent of the original myvol. You can even create snapshots of myvol2.