mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-13 10:38:08 +00:00
handle scaleset resize exceptions (#967)
This commit is contained in:
@ -81,9 +81,17 @@ def resize_vmss(name: UUID, capacity: int) -> None:
|
|||||||
resource_group = get_base_resource_group()
|
resource_group = get_base_resource_group()
|
||||||
logging.info("updating VM count - name: %s vm_count: %d", name, capacity)
|
logging.info("updating VM count - name: %s vm_count: %d", name, capacity)
|
||||||
compute_client = get_compute_client()
|
compute_client = get_compute_client()
|
||||||
compute_client.virtual_machine_scale_sets.begin_update(
|
try:
|
||||||
resource_group, str(name), {"sku": {"capacity": capacity}}
|
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]:
|
def get_vmss_size(name: UUID) -> Optional[int]:
|
||||||
|
Reference in New Issue
Block a user