pavanaravapalli commented on a change in pull request #2149: CLOUDSTACK-9932
snapshot is getting deleted while volume is in creating state
URL: https://github.com/apache/cloudstack/pull/2149#discussion_r122915482
##########
File path: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
##########
@@ -530,6 +534,13 @@ public boolean deleteSnapshot(long snapshotId) {
return false;
}
+ List<VolumeDetailVO> volumeCheck;
+ volumeCheck = _volumeDetailsDaoImpl.findDetails("SNAPSHOT_ID",
String.valueOf(snapshotId), null);
+
+ if (volumeCheck.size() > 0) {
+ throw new InvalidParameterValueException("Unable to perform delete
operation, Snapshot with id: " + snapshotId + " is in use ");
+ }
+
Review comment:
When a volume created from snapshot, we are not maintaining volume in
relation to snapshot details anywhere in database. It's been recently
integrated and information stored in VOLUME_DETAILS table.
Data/Records in this table will be persist till volume creation operation
finish(success/failure). Once volume operation done this record will be
removed. I have not come across alternatives other than this approach.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services