You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/02/02 12:15:52 UTC

[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5857: server,config: respect storage.max.volume.size and make it dynamic

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



##########
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:
       We could use `ByteScaleUtils` here.




-- 
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-unsubscribe@cloudstack.apache.org

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