rajiv-jain-netapp commented on code in PR #13053:
URL: https://github.com/apache/cloudstack/pull/13053#discussion_r3136153392


##########
server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java:
##########
@@ -390,6 +390,15 @@ public VMSnapshot allocVMSnapshot(Long vmId, String 
vsDisplayName, String vsDesc
             //Other Storage volume plugins could integrate this with their own 
functionality for group snapshots
             VMSnapshotStrategy snapshotStrategy = 
storageStrategyFactory.getVmSnapshotStrategy(userVmVo.getId(), 
rootVolumePool.getId(), snapshotMemory);
             if (snapshotStrategy == null) {
+                // Check if this is ONTAP managed storage with memory snapshot 
request - provide specific error message
+                if (snapshotMemory && rootVolumePool.isManaged() &&
+                        
"ONTAP".equals(rootVolumePool.getStorageProviderName())) {
+                    String message = String.format("Memory snapshots 
(snapshotmemory=true) are not supported for VMs on ONTAP managed storage. " +
+                            "Instance [%s] uses ONTAP storage which only 
supports disk-only (crash-consistent) snapshots. " +
+                            "Please use snapshotmemory=false for disk-only 
snapshots.", userVmVo.getUuid());
+                    logger.error(message);
+                    throw new CloudRuntimeException(message);

Review Comment:
   added a local variable and upgraded the condition with right plugin value



-- 
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]

Reply via email to