GabrielBrascher commented on issue #3681: Validate disk offering IOPS normal and maximum read/write values URL: https://github.com/apache/cloudstack/pull/3681#issuecomment-592164414 **### Code Update ###** After digging around the configurations` vm.disk.throttling.*`, I found out that they were not the desired ones. Therefore, it was necessary to refactor the code. First I reverted a few commits and then implemented the validation with a new set of config keys. The main goal of this PR is to check the length (seconds) of burst IOPS/Bytes. The `vm.disk.throttling.*` configs consider the rate (e.g. bytes read per second), not length (burst duration) Before this refactoring the following parameters where being considered: ``` vm.disk.throttling.iops_read_rate vm.disk.throttling.iops_write_rate vm.disk.throttling.bytes_read_rate vm.disk.throttling.bytes_write_rate ``` Current commit considers the following configurations: ``` vm.disk.bytes.maximum.read.length vm.disk.bytes.maximum.write.length vm.disk.iops.maximum.read.length vm.disk.iops.maximum.write.length ``` Additionally, I removed a few checks that did not make much sense; also, I converted a bunch of **if** statements into a small and concise method that is called 4 times, making it easier to test and extend if necessary. **### Manual tests ###** Configuration when beginning the tests vm.disk.bytes.maximum.read.length = 0 vm.disk.bytes.maximum.write.length = 0 vm.disk.iops.maximum.read.length = 0 vm.disk.iops.maximum.write.length = 0 iops_read_rate = 10000 iops_read_rate_max = 20000 iops_read_rate_max_length = 36000 iops_write_rate = 10000 iops_write_rate_max = 20000 iops_write_rate_max_length = 36000 bytes_read_rate = 10000 bytes_read_rate_max = 20000 bytes_read_rate_max_length = 36000 bytes_write_rate = 10000 bytes_write_rate_max = 20000 bytes_write_rate_max_length = 36000 - **Test 001** **Input (tests via API with createDiskOffering command):** iops_read_rate = 10000 iops_read_rate_max = 20000 iops_read_rate_max_length = 36000 iops_write_rate = 10000 iops_write_rate_max = 20000 iops_write_rate_max_length = 36000 bytes_read_rate = 10000 bytes_read_rate_max = 20000 bytes_read_rate_max_length = 36000 bytes_write_rate = 10000 bytes_write_rate_max = 20000 bytes_write_rate_max_length = 36000 **Expected result:** create disk offering **Result:** All good - **Test 002** Input (via API): Same as Test 001, except by: bytes_write_rate_max_length = -1 **Expected result:** fail during disk offering creation due to bytes_write_rate_max_length = -1 **Result: Error:** (HTTP 431, error code 4350) Bytes Write max length (-1) must be a positive value - **Test 003** Same as Test 001, except by: iops_read_rate_max = 100 **Expected result:** fail during disk offering creation due to iops_read_rate (36000) > iops_read_rate_max (100) **Result:** (HTTP 431, error code 4350) "IOPS Read rate (36000) cannot be greater than IOPS Read maximum rate (100)" - **Test 003** Same as Test 001, except by: vm.disk.bytes.maximum.read.length = 123 (dinamycally changed, does not require restart) **Expected result:** fail due to bytes_read_rate_max_length (36000) > vm.disk.bytes.maximum.read.length = 123 **Result:** (HTTP 431, error code 4350) "Bytes read max length (36000 seconds) cannot be greater than vm.disk.bytes.maximum.read.length (123 seconds)" - Test 004 Same as Test 001, except by: vm.disk.bytes.maximum.read.length = 99999999 **Expected result:** create disk offering **Result:** All good - **Test 005** Same as Test 001, except by: vm.disk.iops.maximum.read.length = 39999 **Expected result:** fail due to bytes_read_rate_max_length (36000) > vm.disk.iops.maximum.read.length = 39999 **Result:** (HTTP 431, error code 4350) "IOPS read max length (36000 seconds) cannot be greater than vm.disk.iops.maximum.read.length (35999 seconds)" Did a few more tests alternating the vm.disk.(*).length parameters
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
