[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16374679#comment-16374679
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10039:
---------------------------------------------

rafaelweingartner commented on a change in pull request #2231: 
[CLOUDSTACK-10039] Adding IOPS/GB offering
URL: https://github.com/apache/cloudstack/pull/2231#discussion_r170310467
 
 

 ##########
 File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
 ##########
 @@ -2566,6 +2567,61 @@ protected DiskOfferingVO createDiskOffering(final Long 
userId, final Long domain
             isCustomized = true;
         }
 
+        if (minIopsPerGb != null || maxIopsPerGb != null) {
+
+            if (!isCustomized) {
+               throw new InvalidParameterValueException("Cannot set Min/Max 
IOPS/GB for a fixed size disk offering");
+            }
+
+            if ((isCustomizedIops != null && isCustomizedIops) || minIops != 
null || maxIops != null) {
+                throw new InvalidParameterValueException("Cannot set Min/Max 
IOPS/GB with either " +
+                        "custom IOPS or fixed IOPS");
+            }
+
+            if (minIopsPerGb != null && maxIopsPerGb != null) {
+                if (minIopsPerGb <= 0 || maxIopsPerGb <= 0) {
+                    throw new InvalidParameterValueException("Min/Max IOPS/GB 
value must be greater than 0");
+                }
+
+                if (minIopsPerGb > maxIopsPerGb){
+                    throw new InvalidParameterValueException("Min IOPS/GB must 
be greater than max IOPS/GB");
+                }
+            }
+
+            //if either one of them is set but the other is not
+            if ((minIopsPerGb != null && maxIopsPerGb == null) || 
(minIopsPerGb == null && maxIopsPerGb != null)) {
+                throw new InvalidParameterValueException("Both min IOPS/GB and 
max IOPS/GB must be specified");
+            }
+        }
+
+        if (highestMinIops != null && highestMaxIops != null) {
 
 Review comment:
   This whole validation block can also be extracted to a method, documented 
and unit tested.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Adding IOPS/GB offering
> -----------------------
>
>                 Key: CLOUDSTACK-10039
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10039
>             Project: CloudStack
>          Issue Type: New Feature
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Storage Controller
>            Reporter: Syed Ahmed
>            Priority: Major
>             Fix For: Future
>
>
> We want to add a disk offering where we can specify the Min/Max IOPS as a 
> function of size. The idea is the larger volume you create, the greater your 
> IOPS will be (this is similar to the way GCE handles IOPS). We also have 
> added limits to the IOPS (min and max) so that once the volume goes beyond a 
> certain size, the IOPS won't change and are capped to the given values.
> The following parameters are added to the `createDiskOffering` API:
> 1. `miniopspergb' : Minimum IOPS/GB for the offering
> 2. `maxiopspergb`: Maximum IOPS/GB for the offering
> 3. `highestminiops`: The highest `miniops` value that is allowed for this 
> offering
> 3. `highestmaxiops`: The highest `maxiops` value that is allowed for this 
> offering



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to