Comment 2 for bug 1900775

Revision history for this message
Aurelien Lourot (aurelien-lourot) wrote :

IMHO this is a bug in https://opendev.org/openstack/cinder . And I agree with the previous analysis:

1. volume/flows/manager/create_volume.py:_create_from_image_download() creates a volume, then
2. calls volume_utils.copy_image_to_volume(), which
    a. fetches the image,
    b. deletes the volume, and
    c. runs `rbd import`.

If a snapshot of the volume got created between 1 and 2b (e.g. by rbd mirror), 2b will fail. So I think we need one of these solutions:

1. Instead of creating a volume and immediately deleting it, let's not create it in the first place.
2. Is there a way to delete a volume and all its snapshot in an atomic way?
3. Can we force the deletion of a volume even if it has snapshots?