weizhouapache commented on code in PR #11455:
URL: https://github.com/apache/cloudstack/pull/11455#discussion_r2279711960


##########
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:
##########
@@ -1621,7 +1621,8 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) 
throws ResourceAllocationExc
             if (snapshotStrategy == null) {
                 _snapshotDao.remove(snapshotId);
                 logger.debug("No strategy found for creation of snapshot [{}], 
removing its record from the database.", snapshot);
-                throw new CloudRuntimeException(String.format("Can't find 
snapshot strategy to deal with snapshot:%s", snapshot.getSnapshotVO()));
+                throw new UnsupportedOperationException(String.format("Unable 
to find a snapshot strategy to create snapshot [%s] of volume [%s]. Please 
check the logs.",

Review Comment:
   I think more details but does not reveal the critical information would be 
better
   
   for example, when the management server log says
   `2025-08-15 05:58:04,557 WARN  [o.a.c.s.s.DefaultSnapshotStrategy] 
(Work-Job-Executor-6:[ctx-bcc76f85, job-179/job-180, ctx-5bbd5fed]) 
(logid:2d361233) VM [b50bdd89-1b6b-4ef3-bf85-c97d8cfa01a2] already has KVM 
File-Based storage VM snapshots. These VM snapshots and volume snapshots are 
not supported together for KVM. As restoring volume snapshots will erase the VM 
snapshots and cause data loss.`
   
   end users could get an error when create a volume snapshot, like
   `Volume snapshot is unsupported as this VM has a disk-only VM snapshots`
   
   btw: would it be possible to check the condition in a ealier stage ?



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to