Repository navigation
Closed
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
volume snapshots
CLOUDSTACK VERSION
from 4.11.3.0 to main
SUMMARY
When snapshot.backup.to.secondary is set to false the snapshots are kept only on the primary storage. When you take more than one snapshot of a volume and delete this volume the snapshots are still active in the UI/DB but deleted from the storage. The problem with different primary storages is:
- for the current NFS implementation is that the snapshots are internal, and they are deleted when you delete the volume - active in the UI/DB
- for Ceph - the snapshots are deleted from the pool, but active in DB/UI
- probably with the new Linstor driver the problem will be the same
- for StorPool the snapshots are not deleted, but a random record is deleted from the
snapshot_store_reftable and the reference to the snapshot's path is lost - with this PR - #5297 - the problem will be the same as the StorPool primary storage
STEPS TO REPRODUCE
- set `snapshot.backup.to.secondary` to `false`
- take a few snapshots of a volume
- delete the volume
The snapshots are visible in the UI, active in DB table `snapshots` and one of them is deleted in `snapshot_store_ref` DB table, because of this code in VolumeServiceImpl.deleteVolumeCallback:
SnapshotDataStoreVO snapStoreVo = _snapshotStoreDao.findByVolume(vo.getId(), DataStoreRole.Primary);
if (snapStoreVo != null) {
long storagePoolId = snapStoreVo.getDataStoreId();
StoragePoolVO storagePoolVO = storagePoolDao.findById(storagePoolId);
if (storagePoolVO.isManaged()) {
DataStore primaryDataStore = dataStoreMgr.getPrimaryDataStore(storagePoolId);
Map<String, String> mapCapabilities = primaryDataStore.getDriver().getCapabilities();
String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
Boolean supportsStorageSystemSnapshots = new Boolean(value);
if (!supportsStorageSystemSnapshots) {
_snapshotStoreDao.remove(snapStoreVo.getId());
}
} else {
_snapshotStoreDao.remove(snapStoreVo.getId());
}
}
EXPECTED RESULTS
Probably for all non-managed primary storages we should not delete the snapshots. For NFS this PR - #5297 will fix the problem with the internal snapshots.
ACTUAL RESULTS
Snapshots are deleted from the storage, but active in the UI/DB as a garbage
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
slavkap commentedon Sep 13, 2021
@rhtyd, I think there is a need to discuss how to proceed with this fix. Maybe @GabrielBrascher, @wido, and @rp- have to tell what has to be done with snapshots kept only on primary storage. Is it the right option to delete the snapshots when a volume is deleted?
nvazquez commentedon Sep 14, 2021
Thanks @slavkap - looping @andrijapanicsb @sureshanaparti as well for feedback/discussion
rp- commentedon Sep 14, 2021
For me(or Linstors POV) it make no sense (and doesn't work) to have snapshots without the volume.
So deleting would be fine for me, also in Linstor you can't delete a volume as long as it has snapshots.
yadvr commentedon Sep 14, 2021
@slavkap thanks, I suggest that you start a discussion thread on dev@ ML as a lot of people don't check/read Github comments (I'm guilty of that too).
slavkap commentedon Sep 14, 2021
Thanks all! I'll open a discussion on the ML
andrijapanicsb commentedon Sep 14, 2021
I will just say, that this feature (to keep snaps on primary and NOT copy them on secondary) is developed for Ceph only, and doesn't work nor was tested to work on other storage solutions. Things needs to be properly implemented/from scratch for other storage types.
slavkap commentedon Sep 14, 2021
@andrijapanicsb, I agree with you, but this works for StorPool and will work with the PR that I've mentioned above. I think that the problem also affects the Linstor driver without the option for bypassing secondary storage and maybe Nexenta driver (but not sure how they handle the deletion of the volume after checking their code).
slavkap commentedon Sep 14, 2021
Also, I think this part of the code (which is partly wrong) is not in the right place. My opinion is that the drivers should care about what happens with snapshots, not CS.
yadvr commentedon Sep 21, 2021
Assigned to @GutoVeronezi who has submitted a PR on the same
GutoVeronezi commentedon Sep 22, 2021
@rhtyd @slavkap actually PR #5297 does not solve this issue, it refers only to issue #5124. Both regards to the same feature, however, in different contexts.
(see #5297 (comment))
nvazquez commentedon Sep 28, 2021
Moved to the 4.17 milestone since we are close to the RC cut date and the PR still needs lot of effort on testing as the changes may introduce potential regressions if not tested properly
nvazquez commentedon Feb 4, 2022
Hi @slavkap @GutoVeronezi - I see there has been recent activity on PR #5297 mentioned in this issue, does it solve this issue?
slavkap commentedon Feb 4, 2022
@nvazquez, I think PR #5297 doesn't fix the issue, but better @GutoVeronezi to answer
GutoVeronezi commentedon Feb 4, 2022
Hi, @nvazquez, PR #5297 does not solve this issue, it refers only to issue #5124. Both regards to the same feature, however, in different contexts (see #5297 (comment)).
nvazquez commentedon Mar 10, 2022
Fixed on #6057