openstack volume snapshots and deleting

Sean McGinnis sean.mcginnis at gmx.com
Thu Dec 5 17:58:16 UTC 2019


On Thu, Dec 05, 2019 at 03:24:35PM +0000, Ratliff, John wrote:
> If I create a volume, snapshot it, and create a new volume from that
> snapshot, I cannot seem to delete the snapshot until the volume is deleted.
> Is this intentional, or am I doing something wrong? Is the new volume based
> on the snapshot, and that's why I can't delete it? We're using CEPH as a
> storage backend if that makes a difference.
>

That is the expected behavior as the snapshot is in-use by the volume created
from it. So it can't be deleted until there isn't anything using it.

Cloning would be the only way to get around this. There's not a quick and easy
call to do this from a snapshot base, so unfortunately to get around that and
get the final effect that it appears you are looking for, you would need to
create a snapshot, create a volume from the snapshot, then *clone* yet another
volume from that new one. Then delete the temporary volume and snapshot once
the clone is done.

As long as the backend driver is honoring the clone semantics, that should
result in a fully independent volume that has its inital data set from the
snapshot.

So the process would look something like:


openstack volume snapshot create --volume base-volume base-ss

openstack volume create --snapshot base-ss temp-volume

openstack volume create --volume temp-volume new-volume

openstack volume delete temp-volume

openstack volume snapshot delete base-ss


Otherwise, it should be fairly safe to just keep the snapshot around. A lot of
storage devices handle snapshots as internal pointers, so the only additional
space consumption comes from anything new you end up writing to the new volume.

Sean



More information about the openstack-discuss mailing list