JoaoJandre commented on issue #8907: URL: https://github.com/apache/cloudstack/issues/8907#issuecomment-2070247722
> Impressive design @JoaoJandre . I scanned through it , so I may have missed this; is any coalescing occurring on the backed up snapshots for a VM? i.e. with snapshots 1,2,3 the user want to delete snapshot 2 in your chapter on deletion (see [deletion diagram](https://camo.githubusercontent.com/a62928a140dbc4f71dc41354c16e1157709cc315e81080767718d3fd2bed1880/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f73632d636c6f7564732f696d6167652f75706c6f61642f76313730333737323139392f73706563732f636c6f7564737461636b2f6b766d2d696e6372656d656e74616c2d736e617073686f74732f4e65775f496e6372656d656e74616c5f4261636b75705f44656c6574696f6e5f315f6f33663537682e706e67) ) the snapshot remains but becomes hidden because the DB entry is deleted. when the volume is completely deleted or the user want the create a snapshot, How will the 'hidden' increment be handled by cloudstack? @DaanHoogland, there will be no coalescing on the backend, except when the user decides to restore the snapshot (see section 2.2). Also, the DB entry will not be deleted, the entry on the `snapshots` table will be marked as destroyed, so that it is not listed, but the entry on `snapshot_store_ref` will remain, this way we will not lose the reference to where the snapshot is. In your example, if the snapshots are on primary storage, when the volume is deleted, all of snapshots will get deleted as well (this is the current behavior); if the snapshots are on secondary storage, they will remain (this is also the current behavior), and the rules described in [deletion diagram](https://camo.githubusercontent.com/a62928a140dbc4f71dc41354c16e1157709cc315e81080767718d3fd2bed1880/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f73632d636c6f7564732f696d6167652f75706c6f61642f76313730333737323139392f73706563732f636c6f7564737461636b2f6b766d2d696e6372656d656e74616c2d736e617073686f74732f4e65775f496e6372656d656e74616c5f4261636b75705f44656c6574696f6e5f315f6f33663537682e706e67) still apply. About the snapshot creation after the user deletes one of the snapshots in the middle of the chain, this will not have any relevant effect. The snapshot can still be created as usual (all the files are unchanged); the size of the snapshot chain will be calculated using the `parent_snapshot_id` column on `snapshot_store_ref` (which, as explained before, will not be affected by the snapshot deletion on this case). The snapshot chain size calculation is actually already implemented in the code for Xen (see https://github.com/apache/cloudstack/blob/8ff2c018cc5b3fc69bcd8756695d04b384e46ab8/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/DefaultSnapshotStrategy.java#L152) we can use a similar logic for the KVM implementation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
