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



##########
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)) {

Review comment:
       @GutoVeronezi @DaanHoogland To use `ByteScaleUtils` new method(s) will 
need to be added. I feel we can do that in `main` in a separate PR and attempt 
to refactor similar occurrences across codebase




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