Fix KVM incremental snapshot removal when using multiple secondary storages #11180
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When removing an incremental snapshot (For both KVM and XenServer), it is checked if the snapshot has a child or not. If it has, then the snapshot is not removed from the storage.
For KVM incremental snapshots, snapshots in the same chain may be on different secondary storages (within the same zone).
However, the child search process only considers snapshots from the same secondary storage as theirs. Therefore, if a snapshot has its parent snapshot on a different secondary storage, it will be completely removed, making the snapshot chain inconsistent.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
I created 3 snapshots that were stored in the secondary storage
sec-nfs1
. I then set the storagesec-nfs1
to read-only and created 2 more snapshots, which were stored in the secondary storagesec-nfs2
.Without the changes: when the third snapshot was removed, its state was set to
Destroyed
, and an error was thrown when trying to restore the fourth snapshot, indicating that the file for the third snapshot no longer existed.With the changes: the third snapshot's state was set to
Hidden
, and it was possible to restore the fourth snapshot.