VirtualMachineScaleSetsOperations Class

VirtualMachineScaleSetsOperations operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
VirtualMachineScaleSetsOperations

Constructor

VirtualMachineScaleSetsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

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/en-us/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.

begin_create_or_update(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VirtualMachineScaleSet, **kwargs: Any) -> LROPoller[_models.VirtualMachineScaleSet]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

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

parameters
VirtualMachineScaleSet
Required

The scale set object.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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_deallocate(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_delete

Deletes a VM scale set.

begin_delete(resource_group_name: str, vm_scale_set_name: str, force_deletion: Optional[bool] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

force_deletion
bool
default value: None

Optional parameter to force delete a VM scale set. (Feature in Preview).

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_delete_instances

Deletes virtual machines in a VM scale set.

begin_delete_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceRequiredIDs, force_deletion: Optional[bool] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceRequiredIDs
Required

A list of virtual machine instance IDs from the VM scale set.

force_deletion
bool
default value: None

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

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications.

begin_perform_maintenance(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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_power_off(resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

skip_shutdown
bool
default value: False

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.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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_redeploy(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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(resource_group_name: str, vm_scale_set_name: str, vm_scale_set_reimage_input: Optional[_models.VirtualMachineScaleSetReimageParameters] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_scale_set_reimage_input
VirtualMachineScaleSetReimageParameters
default value: None

Parameters for Reimaging VM ScaleSet.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

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_reimage_all(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_restart

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

begin_restart(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_set_orchestration_service_state

Changes ServiceState property for a given service.

begin_set_orchestration_service_state(resource_group_name: str, vm_scale_set_name: str, parameters: _models.OrchestrationServiceStateInput, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

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

parameters
OrchestrationServiceStateInput
Required

The input object for SetOrchestrationServiceState API.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_start

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

begin_start(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: Optional[_models.VirtualMachineScaleSetVMInstanceIDs] = None, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceIDs
default value: None

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_update

Update a VM scale set.

begin_update(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VirtualMachineScaleSetUpdate, **kwargs: Any) -> LROPoller[_models.VirtualMachineScaleSet]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

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

parameters
VirtualMachineScaleSetUpdate
Required

The scale set object.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

begin_update_instances

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

begin_update_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: _models.VirtualMachineScaleSetVMInstanceRequiredIDs, **kwargs: Any) -> LROPoller[None]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

vm_instance_i_ds
VirtualMachineScaleSetVMInstanceRequiredIDs
Required

A list of virtual machine instance IDs from the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

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

Return type

Exceptions

convert_to_single_placement_group

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

convert_to_single_placement_group(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VMScaleSetConvertToSinglePlacementGroupInput, **kwargs: Any) -> None

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

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

parameters
VMScaleSetConvertToSinglePlacementGroupInput
Required

The input object for ConvertToSinglePlacementGroup API.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

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.

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

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

platform_update_domain
int
Required

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

cls
callable

A custom type or function that will be passed the direct response

Returns

RecoveryWalkResponse, or the result of cls(response)

Return type

Exceptions

get

Display information about a virtual machine scale set.

get(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> _models.VirtualMachineScaleSet

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

Returns

VirtualMachineScaleSet, or the result of cls(response)

Return type

Exceptions

get_instance_view

Gets the status of a VM scale set instance.

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

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

Returns

VirtualMachineScaleSetInstanceView, or the result of cls(response)

Return type

Exceptions

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) -> Iterable[_models.VirtualMachineScaleSetListOSUpgradeHistory]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list

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

list(resource_group_name: str, **kwargs: Any) -> Iterable[_models.VirtualMachineScaleSetListResult]

Parameters

resource_group_name
str
Required

The name of the resource group.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

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) -> Iterable[_models.VirtualMachineScaleSetListWithLinkResult]

Parameters

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

list_by_location

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

list_by_location(location: str, **kwargs: Any) -> Iterable[_models.VirtualMachineScaleSetListResult]

Parameters

location
str
Required

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

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

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) -> Iterable[_models.VirtualMachineScaleSetListSkusResult]

Parameters

resource_group_name
str
Required

The name of the resource group.

vm_scale_set_name
str
Required

The name of the VM scale set.

cls
callable

A custom type or function that will be passed the direct response

Returns

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

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.compute.v2020_12_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\compute\\v2020_12_01\\models\\__init__.py'>