VirtualMachineScaleSetsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ComputeManagementClient's

<xref:virtual_machine_scale_sets> attribute.

Inheritance
builtins.object
VirtualMachineScaleSetsOperations

Constructor

VirtualMachineScaleSetsOperations(*args, **kwargs)

Methods

begin_create_or_update

Create or update a VM scale set.

begin_deallocate

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

begin_delete

Deletes a VM scale set.

begin_delete_instances

Deletes virtual machines in a VM scale set.

begin_perform_maintenance

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications.

begin_power_off

Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

begin_redeploy

Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on.

begin_reimage

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

begin_reimage_all

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

begin_restart

Restarts one or more virtual machines in a VM scale set.

begin_set_orchestration_service_state

Changes ServiceState property for a given service.

begin_start

Starts one or more virtual machines in a VM scale set.

begin_update

Update a VM scale set.

begin_update_instances

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

convert_to_single_placement_group

Converts SinglePlacementGroup property to false for a existing virtual machine scale set.

force_recovery_service_fabric_platform_update_domain_walk

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.

get

Display information about a virtual machine scale set.

get_instance_view

Gets the status of a VM scale set instance.

get_os_upgrade_history

Gets list of OS upgrades on a VM scale set instance.

list

Gets a list of all VM scale sets under a resource group.

list_all

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

list_by_location

Gets all the VM scale sets under the specified subscription for the specified location.

list_skus

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

begin_create_or_update

Create or update a VM scale set.

async begin_create_or_update(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VirtualMachineScaleSet, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.VirtualMachineScaleSet]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set to create or update. Required.

parameters
Required

The scale set object. Is either a VirtualMachineScaleSet type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

begin_deallocate

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

async begin_deallocate(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_delete

Deletes a VM scale set.

async begin_delete(resource_group_name: str, vm_scale_set_name: str, *, force_deletion: bool | None = None, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Keyword-Only Parameters

Name Description
force_deletion

Optional parameter to force delete a VM scale set. (Feature in Preview). Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_delete_instances

Deletes virtual machines in a VM scale set.

async begin_delete_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceRequiredIDs, *, force_deletion: bool | None = None, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceRequiredIDs type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
force_deletion

Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview). Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_perform_maintenance

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications.

async begin_perform_maintenance(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_power_off

Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

async begin_power_off(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, skip_shutdown: bool = False, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Keyword-Only Parameters

Name Description
skip_shutdown

The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified. Default value is False.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_redeploy

Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on.

async begin_redeploy(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_reimage

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

async begin_reimage(resource_group_name: str, vm_scale_set_name: str, vm_scale_set_reimage_input: _models.VirtualMachineScaleSetReimageParameters | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_scale_set_reimage_input
Required

Parameters for Reimaging VM ScaleSet. Is either a VirtualMachineScaleSetReimageParameters type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_reimage_all

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

async begin_reimage_all(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_restart

Restarts one or more virtual machines in a VM scale set.

async begin_restart(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_set_orchestration_service_state

Changes ServiceState property for a given service.

async begin_set_orchestration_service_state(resource_group_name: str, vm_scale_set_name: str, parameters: _models.OrchestrationServiceStateInput, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the virtual machine scale set to create or update. Required.

parameters
Required

The input object for SetOrchestrationServiceState API. Is either a OrchestrationServiceStateInput type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_start

Starts one or more virtual machines in a VM scale set.

async begin_start(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceIDs type or a IO[bytes] type. Default value is None.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_update

Update a VM scale set.

async begin_update(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VirtualMachineScaleSetUpdate, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.VirtualMachineScaleSet]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set to create or update. Required.

parameters
Required

The scale set object. Is either a VirtualMachineScaleSetUpdate type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

begin_update_instances

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

async begin_update_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceRequiredIDs, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

vm_instance_i_ds
Required

A list of virtual machine instance IDs from the VM scale set. Is either a VirtualMachineScaleSetVMInstanceRequiredIDs type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

convert_to_single_placement_group

Converts SinglePlacementGroup property to false for a existing virtual machine scale set.

async convert_to_single_placement_group(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VMScaleSetConvertToSinglePlacementGroupInput, *, content_type: str = 'application/json', **kwargs: Any) -> None

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the virtual machine scale set to create or update. Required.

parameters
Required

The input object for ConvertToSinglePlacementGroup API. Is either a VMScaleSetConvertToSinglePlacementGroupInput type or a IO[bytes] type. Required.

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

force_recovery_service_fabric_platform_update_domain_walk

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.

async force_recovery_service_fabric_platform_update_domain_walk(resource_group_name: str, vm_scale_set_name: str, *, platform_update_domain: int, **kwargs: Any) -> RecoveryWalkResponse

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Keyword-Only Parameters

Name Description
platform_update_domain
int

The platform update domain for which a manual recovery walk is requested. Required.

Returns

Type Description

RecoveryWalkResponse or the result of cls(response)

Exceptions

Type Description

get

Display information about a virtual machine scale set.

async get(resource_group_name: str, vm_scale_set_name: str, *, expand: str | ExpandTypesForGetVMScaleSets | None = None, **kwargs: Any) -> VirtualMachineScaleSet

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Keyword-Only Parameters

Name Description
expand

The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation. "userData" Default value is None.

Returns

Type Description

VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

get_instance_view

Gets the status of a VM scale set instance.

async get_instance_view(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> VirtualMachineScaleSetInstanceView

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Returns

Type Description

VirtualMachineScaleSetInstanceView or the result of cls(response)

Exceptions

Type Description

get_os_upgrade_history

Gets list of OS upgrades on a VM scale set instance.

get_os_upgrade_history(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> AsyncIterable[UpgradeOperationHistoricalStatusInfo]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Returns

Type Description

An iterator like instance of either UpgradeOperationHistoricalStatusInfo or the result of cls(response)

Exceptions

Type Description

list

Gets a list of all VM scale sets under a resource group.

list(resource_group_name: str, **kwargs: Any) -> AsyncIterable[VirtualMachineScaleSet]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

Returns

Type Description

An iterator like instance of either VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

list_all

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

list_all(**kwargs: Any) -> AsyncIterable[VirtualMachineScaleSet]

Returns

Type Description

An iterator like instance of either VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

list_by_location

Gets all the VM scale sets under the specified subscription for the specified location.

list_by_location(location: str, **kwargs: Any) -> AsyncIterable[VirtualMachineScaleSet]

Parameters

Name Description
location
Required
str

The location for which VM scale sets under the subscription are queried. Required.

Returns

Type Description

An iterator like instance of either VirtualMachineScaleSet or the result of cls(response)

Exceptions

Type Description

list_skus

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

list_skus(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> AsyncIterable[VirtualMachineScaleSetSku]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

vm_scale_set_name
Required
str

The name of the VM scale set. Required.

Returns

Type Description

An iterator like instance of either VirtualMachineScaleSetSku or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.compute.v2021_03_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\compute\\v2021_03_01\\models\\__init__.py'>