Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

handle scaleset resize exceptions #967

Merged
merged 2 commits into from
Jun 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/api-service/__app__/onefuzzlib/azure/vmss.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,17 @@ def resize_vmss(name: UUID, capacity: int) -> None:
resource_group = get_base_resource_group()
logging.info("updating VM count - name: %s vm_count: %d", name, capacity)
compute_client = get_compute_client()
compute_client.virtual_machine_scale_sets.begin_update(
resource_group, str(name), {"sku": {"capacity": capacity}}
)
try:
compute_client.virtual_machine_scale_sets.begin_update(
resource_group, str(name), {"sku": {"capacity": capacity}}
)
except ResourceExistsError as err:
logging.error(
"unable to resize scaleset. name:%s vm_count:%d - err:%s",
name,
capacity,
err,
)


def get_vmss_size(name: UUID) -> Optional[int]:
Expand Down