sureshanaparti commented on a change in pull request #5857:
URL: https://github.com/apache/cloudstack/pull/5857#discussion_r797337104



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -856,11 +855,13 @@ public VolumeVO doInTransaction(TransactionStatus status) 
{
         });
     }
 
+    @Override
     public boolean validateVolumeSizeRange(long size) {
+        long maxVolumeSize = VolumeOrchestrationService.MaxVolumeSize.value();
         if (size < 0 || (size > 0 && size < (1024 * 1024 * 1024))) {
             throw new InvalidParameterValueException("Please specify a size of 
at least 1 GB.");
-        } else if (size > (_maxVolumeSizeInGb * 1024 * 1024 * 1024)) {
-            throw new InvalidParameterValueException("Requested volume size is 
" + size + ", but the maximum size allowed is " + _maxVolumeSizeInGb + " GB.");
+        } else if (size > (maxVolumeSize * 1024 * 1024 * 1024)) {
+            throw new InvalidParameterValueException(String.format("Requested 
volume size is %d, but the maximum size allowed is %d GB.", size, 
maxVolumeSize));

Review comment:
       @shwstppr Can you update the log so that both the sizes are in sync with 
the units. For ex:
   
   _Requested volume size is 21474836480, but the maximum size allowed is 15 
GB._  => `Requested volume size is 20 GB, but the maximum size allowed is 15 
GB.`




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