VirtualMachineScaleSetVMsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ComputeManagementClient's

<xref:virtual_machine_scale_set_vms> attribute.

Inheritance
builtins.object
VirtualMachineScaleSetVMsOperations

Constructor

VirtualMachineScaleSetVMsOperations(*args, **kwargs)

Methods

begin_deallocate

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

begin_delete

Deletes a virtual machine from a VM scale set.

begin_perform_maintenance

Performs maintenance on a virtual machine in a VM scale set.

begin_power_off

Power off (stop) a virtual machine 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 the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

begin_reimage

Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.

begin_reimage_all

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

begin_restart

Restarts a virtual machine in a VM scale set.

begin_run_command

Run command on a virtual machine in a VM scale set.

begin_start

Starts a virtual machine in a VM scale set.

begin_update

Updates a virtual machine of a VM scale set.

get

Gets a virtual machine from a VM scale set.

get_instance_view

Gets the status of a virtual machine from a VM scale set.

list

Gets a list of all virtual machines in a VM scale sets.

retrieve_boot_diagnostics_data

The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.

simulate_eviction

The operation to simulate the eviction of spot virtual machine in a VM scale set.

begin_deallocate

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

async begin_deallocate(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_delete

Deletes a virtual machine from a VM scale set.

async begin_delete(resource_group_name: str, vm_scale_set_name: str, instance_id: 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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Keyword-Only Parameters

Name Description
force_deletion

Optional parameter to force delete a virtual machine from 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_perform_maintenance

Performs maintenance on a virtual machine in a VM scale set.

async begin_perform_maintenance(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

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) a virtual machine 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, instance_id: str, *, skip_shutdown: bool = False, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

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 the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

async begin_redeploy(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

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) a specific virtual machine in a VM scale set.

async begin_reimage(resource_group_name: str, vm_scale_set_name: str, instance_id: str, vm_scale_set_vm_reimage_input: _models.VirtualMachineScaleSetVMReimageParameters | 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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

vm_scale_set_vm_reimage_input
Required

Parameters for the Reimaging Virtual machine in ScaleSet. Is either a VirtualMachineScaleSetVMReimageParameters 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

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

async begin_reimage_all(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_restart

Restarts a virtual machine in a VM scale set.

async begin_restart(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_run_command

Run command on a virtual machine in a VM scale set.

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

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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

parameters
Required

Parameters supplied to the Run command operation. Is either a RunCommandInput type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_start

Starts a virtual machine in a VM scale set.

async begin_start(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

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

Exceptions

Type Description

begin_update

Updates a virtual machine of a VM scale set.

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

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 where the extension should be create or updated. Required.

instance_id
Required
str

The instance ID of the virtual machine. Required.

parameters
Required

Parameters supplied to the Update Virtual Machine Scale Sets VM operation. Is either a VirtualMachineScaleSetVM type or a IO[bytes] type. Required.

Returns

Type Description

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

Exceptions

Type Description

get

Gets a virtual machine from a VM scale set.

async get(resource_group_name: str, vm_scale_set_name: str, instance_id: str, *, expand: str | InstanceViewTypes | None = None, **kwargs: Any) -> VirtualMachineScaleSetVM

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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Keyword-Only Parameters

Name Description
expand

The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. Known values are: "instanceView" and "userData". Default value is None.

Returns

Type Description

VirtualMachineScaleSetVM or the result of cls(response)

Exceptions

Type Description

get_instance_view

Gets the status of a virtual machine from a VM scale set.

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

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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

VirtualMachineScaleSetVMInstanceView or the result of cls(response)

Exceptions

Type Description

list

Gets a list of all virtual machines in a VM scale sets.

list(resource_group_name: str, virtual_machine_scale_set_name: str, *, filter: str | None = None, select: str | None = None, expand: str | None = None, **kwargs: Any) -> AsyncIterable[VirtualMachineScaleSetVM]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

virtual_machine_scale_set_name
Required
str

The name of the VM scale set. Required.

Keyword-Only Parameters

Name Description
filter
str

The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. Default value is None.

select
str

The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. Default value is None.

expand
str

The expand expression to apply to the operation. Allowed values are 'instanceView'. Default value is None.

Returns

Type Description

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

Exceptions

Type Description

retrieve_boot_diagnostics_data

The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.

async retrieve_boot_diagnostics_data(resource_group_name: str, vm_scale_set_name: str, instance_id: str, *, sas_uri_expiration_time_in_minutes: int | None = None, **kwargs: Any) -> RetrieveBootDiagnosticsDataResult

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.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Keyword-Only Parameters

Name Description
sas_uri_expiration_time_in_minutes
int

Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. <br>:code:>><<<br>NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. Default value is None.

Returns

Type Description

RetrieveBootDiagnosticsDataResult or the result of cls(response)

Exceptions

Type Description

simulate_eviction

The operation to simulate the eviction of spot virtual machine in a VM scale set.

async simulate_eviction(resource_group_name: str, vm_scale_set_name: str, instance_id: str, **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 VM scale set. Required.

instance_id
Required
str

The instance ID of the virtual machine. Required.

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

Attributes

models

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