Skip to content

Commit

Permalink
add is_ultradisk
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Dec 26, 2023
1 parent e79aa47 commit e886d97
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lisa/sut_orchestrator/azure/arm_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
"metadata": {
"description": "data disk array."
}
},
"is_ultradisk": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "whether to use ultra disk"
}
}
},
"variables": {
Expand Down Expand Up @@ -129,10 +136,10 @@
"count": "[variables('node_count')]"
},
"properties": {
"publicIPAllocationMethod": "Static"
"publicIPAllocationMethod": "[if(parameters('is_ultradisk'), 'Static', 'Dynamic')]"
},
"sku": {
"name": "Standard"
"name": "[if(parameters('is_ultradisk'), 'Standard', 'Basic')]"
},
"zones": "[if(variables('use_availability_zones'), variables('availability_zones'), json('null'))]"
},
Expand Down
1 change: 1 addition & 0 deletions lisa/sut_orchestrator/azure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ class AzureArmParameter:
virtual_network_resource_group: str = ""
virtual_network_name: str = AZURE_VIRTUAL_NETWORK_NAME
subnet_prefix: str = AZURE_SUBNET_PREFIX
is_ultradisk: bool = False

def __post_init__(self, *args: Any, **kwargs: Any) -> None:
add_secret(self.admin_username, PATTERN_HEADTAIL)
Expand Down
8 changes: 8 additions & 0 deletions lisa/sut_orchestrator/azure/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,14 @@ def _create_deployment_parameters(
node_arm_parameters = self._create_node_arm_parameters(node.capability, log)
nodes_parameters.append(node_arm_parameters)

arm_parameters.is_ultradisk = any(
[
x
for x in nodes_parameters
if x.data_disk_type
== features.get_azure_disk_type(schema.DiskType.UltraSSDLRS)
]
)
# Set data disk array
arm_parameters.data_disks = self._generate_data_disks(
node, node_arm_parameters
Expand Down

0 comments on commit e886d97

Please sign in to comment.