VirtualMachineScaleSetsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:virtual_machine_scale_sets> attribute.
- Inheritance
-
builtins.objectVirtualMachineScaleSetsOperations
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/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_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 true 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_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, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.VirtualMachineScaleSet]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_delete
Deletes a VM scale set.
begin_delete(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
The name of the VM scale set. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
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, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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/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: _models.VirtualMachineScaleSetVMInstanceIDs | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_update
Update a VM scale set.
begin_update(resource_group_name: str, vm_scale_set_name: str, parameters: _models.VirtualMachineScaleSetUpdate, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.VirtualMachineScaleSet]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller 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.
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) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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 LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
convert_to_single_placement_group
Converts SinglePlacementGroup property to true for a existing virtual machine scale set.
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
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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.
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
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
The name of the VM scale set. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
platform_update_domain
|
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.
get(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> VirtualMachineScaleSet
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
The name of the VM scale set. Required. |
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.
get_instance_view(resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> VirtualMachineScaleSetInstanceView
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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) -> Iterable[UpgradeOperationHistoricalStatusInfo]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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) -> Iterable[VirtualMachineScaleSet]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
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) -> Iterable[VirtualMachineScaleSet]
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) -> Iterable[VirtualMachineScaleSetSku]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group. Required. |
vm_scale_set_name
Required
|
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.v2019_07_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\compute\\v2019_07_01\\models\\__init__.py'>
Azure SDK for Python