_snapshot_exists method in remotefs is wrong if the last snapshot was deleted by Nova
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Undecided
|
Silvan Kaiser |
Bug Description
tl;dnr:
The _snapshot_exists method should return false if all snapshots have been deleted, even if the last snapshot was deleted via the Nova API.
Detailed:
Using the RemoteFSSnapDri
1) Create a volume and attach it to a VM
2) Create a snapshot file for this volume
3) Delete the snapshot file
4) Compare the volumes expected path to the path stored in the volumes .info file, they differ (which they should not).
The reason for this is that, when deleting the last snapshot of a volume via Nova API, the resulting file is not the original volume file but the file created during snapshotting, as Nova uses a pull operation (see [2]). This behaviour differs from the deletion of a snapshot of a detached volume [3], where the volumes file name stays the original file name.
This issue arises when the _snapshot_exists method [4] compares the active image path to the volumes path (which is based on the volume.name attribute, [5]). In case the last snapshot was deleted via Nova while the volume was attached this method reports remaining snapshots while there are none, as the volume.name attribute points to the original file name while the last active file name from the info file points to the new file name which was created during snapshotting.
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
summary: |
- incorrect volume provider_location after snapshot deletion with attached - volume in remotefs driver + _snapshot_exists method in remotefs is wrong if the last snapshot was + deleted by Nova |
Fix proposed to branch: master /review. openstack. org/632982
Review: https:/