Skip to content

Commit 161f4a1

Browse files
committed
update iops validation for ssdv2
1 parent d515304 commit 161f4a1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/azure-cli/azure/cli/command_modules/rdbms/validators.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,9 @@ def _valid_ssdv2_range(storage_gb, sku_info, tier, iops, throughput, instance):
421421
storage = storage_gib * 1.07374182
422422
# find min and max values for IOPS
423423
min_iops = sku_info[sku_tier]["supported_storageV2_iops"]
424-
if sku_info[sku_tier]["supported_storageV2_iops"] < math.floor(max(0, storage - 6) * 500 + min_iops):
425-
max_iops = sku_info[sku_tier]["supported_storageV2_iops_max"]
426-
else:
427-
max_iops = math.floor(max(0, storage - 6) * 500 + min_iops)
424+
supported_iops = sku_info[sku_tier]["supported_storageV2_iops_max"]
425+
calculated_max_iops = math.floor(max(0, storage - 6) * 500 + min_iops)
426+
max_iops = min(supported_iops, calculated_max_iops)
428427

429428
if not min_iops <= storage_iops <= max_iops:
430429
raise CLIError('The requested value for IOPS does not fall between {} and {} operations/sec.'

0 commit comments

Comments
 (0)