Skip to content

Commit

Permalink
Make use_availability_sets override availiability_set_* options
Browse files Browse the repository at this point in the history
This will enable Ultradisk to run with a small change to the runbook.
  • Loading branch information
kamalca committed Sep 22, 2023
1 parent c28b81e commit 2b8abdc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lisa/sut_orchestrator/azure/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ class AzurePlatformSchema:
marketplace_image_information_location: Optional[Union[str, List[str]]] = field(
default=None
)
use_availability_sets: Optional[bool] = field(default=None)
availability_set_tags: Optional[Dict[str, str]] = field(default=None)
availability_set_properties: Optional[Dict[str, Any]] = field(default=None)
vm_tags: Optional[Dict[str, Any]] = field(default=None)
Expand Down Expand Up @@ -1208,11 +1209,15 @@ def _create_deployment_parameters(
self.subscription_id, arm_parameters.location, "t"
)

if (
self._azure_runbook.availability_set_properties
or self._azure_runbook.availability_set_tags
):
arm_parameters.use_availability_sets = True
if self._azure_runbook.use_availability_sets is None:
arm_parameters.use_availability_sets = bool(
self._azure_runbook.availability_set_properties
or self._azure_runbook.availability_set_tags
)
else:
arm_parameters.use_availability_sets = (
self._azure_runbook.use_availability_sets
)

# In Azure, each VM should have only one nic in one subnet. So calculate
# the max nic count, and set to subnet count.
Expand Down

0 comments on commit 2b8abdc

Please sign in to comment.