virtual_machine_scale_set_vms
Creates, updates, deletes, gets or lists a virtual_machine_scale_set_vms
resource.
Overview
Name | virtual_machine_scale_set_vms |
Type | Resource |
Id | azure.compute.virtual_machine_scale_set_vms |
Fields
The following fields are returned by SELECT
queries:
- get
- get_instance_view
- list
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header to ensure optimistic updates. |
identity | object | The identity of the virtual machine, if configured. |
instanceId | string | The virtual machine instance ID. |
location | string | Resource location |
plan | object | Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save. |
properties | object | Describes the properties of a virtual machine scale set virtual machine. |
resources | array | The virtual machine child extension resources. |
sku | object | The virtual machine SKU. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine zones. |
Name | Datatype | Description |
---|---|---|
assignedHost | string | Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. |
bootDiagnostics | object | Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor. |
computerName | string | Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. Max-length (Windows): 15 characters Max-length (Linux): 64 characters. For naming conventions and restrictions see Azure infrastructure services implementation guidelines. |
disks | array | The disks information. |
extensions | array | The extensions information. |
hyperVGeneration | string | The hypervisor generation of the Virtual Machine [V1, V2] |
maintenanceRedeployStatus | object | The Maintenance Operation status on the virtual machine. |
osName | string | The Operating System running on the hybrid machine. |
osVersion | string | The version of Operating System running on the hybrid machine. |
placementGroupId | string | The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. |
platformFaultDomain | integer (int32) | The Fault Domain count. |
platformUpdateDomain | integer (int32) | The Update Domain count. |
rdpThumbPrint | string | The Remote desktop certificate thumbprint. |
statuses | array | The resource status information. |
vmAgent | object | The VM Agent running on the virtual machine. |
vmHealth | object | The health status for the VM. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header to ensure optimistic updates. |
identity | object | The identity of the virtual machine, if configured. |
instanceId | string | The virtual machine instance ID. |
location | string | Resource location |
plan | object | Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save. |
properties | object | Describes the properties of a virtual machine scale set virtual machine. |
resources | array | The virtual machine child extension resources. |
sku | object | The virtual machine SKU. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine zones. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | $expand | Gets a virtual machine from a VM scale set. |
get_instance_view | select | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Gets the status of a virtual machine from a VM scale set. | |
list | select | resourceGroupName , virtualMachineScaleSetName , subscriptionId | $filter , $select , $expand | Gets a list of all virtual machines in a VM scale sets. |
update | replace | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | If-Match , If-None-Match | Updates a virtual machine of a VM scale set. |
delete | delete | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | forceDeletion | Deletes a virtual machine from a VM scale set. |
run_command | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId , commandId | Run command on a virtual machine in a VM scale set. | |
reimage | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. | |
reimage_all | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | 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. | |
approve_rolling_upgrade | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. | |
deallocate | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | 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. | |
power_off | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | skipShutdown | 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. |
restart | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Restarts a virtual machine in a VM scale set. | |
start | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Starts a virtual machine in a VM scale set. | |
redeploy | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. | |
retrieve_boot_diagnostics_data | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | sasUriExpirationTimeInMinutes | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. |
perform_maintenance | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Performs maintenance on a virtual machine in a VM scale set. | |
simulate_eviction | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | The operation to simulate the eviction of spot virtual machine in a VM scale set. | |
attach_detach_data_disks | exec | resourceGroupName , vmScaleSetName , instanceId , subscriptionId | Attach and detach data disks to/from a virtual machine in a VM scale set. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
instanceId | string | The instance ID of the virtual machine. |
resourceGroupName | string | The name of the resource group. |
subscriptionId | string | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
virtualMachineScaleSetName | string | The name of the VM scale set. |
vmScaleSetName | string | The name of the VM scale set. |
$expand | string | The expand expression to apply to the operation. Allowed values are 'instanceView'. |
$filter | string | 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'. |
$select | string | The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. |
If-Match | string | The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. |
If-None-Match | string | Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. |
forceDeletion | boolean | Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) |
sasUriExpirationTimeInMinutes | integer (int32) | Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. |
skipShutdown | boolean | 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 |
SELECT
examples
- get
- get_instance_view
- list
Gets a virtual machine from a VM scale set.
SELECT
id,
name,
etag,
identity,
instanceId,
location,
plan,
properties,
resources,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_set_vms
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND vmScaleSetName = '{{ vmScaleSetName }}' -- required
AND instanceId = '{{ instanceId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $expand = '{{ $expand }}'
;
Gets the status of a virtual machine from a VM scale set.
SELECT
assignedHost,
bootDiagnostics,
computerName,
disks,
extensions,
hyperVGeneration,
maintenanceRedeployStatus,
osName,
osVersion,
placementGroupId,
platformFaultDomain,
platformUpdateDomain,
rdpThumbPrint,
statuses,
vmAgent,
vmHealth
FROM azure.compute.virtual_machine_scale_set_vms
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND vmScaleSetName = '{{ vmScaleSetName }}' -- required
AND instanceId = '{{ instanceId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Gets a list of all virtual machines in a VM scale sets.
SELECT
id,
name,
etag,
identity,
instanceId,
location,
plan,
properties,
resources,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_set_vms
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND virtualMachineScaleSetName = '{{ virtualMachineScaleSetName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $filter = '{{ $filter }}'
AND $select = '{{ $select }}'
AND $expand = '{{ $expand }}'
;
REPLACE
examples
- update
Updates a virtual machine of a VM scale set.
REPLACE azure.compute.virtual_machine_scale_set_vms
SET
data__properties = '{{ properties }}',
data__plan = '{{ plan }}',
data__identity = '{{ identity }}',
data__location = '{{ location }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND vmScaleSetName = '{{ vmScaleSetName }}' --required
AND instanceId = '{{ instanceId }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match}}'
AND If-None-Match = '{{ If-None-Match}}'
RETURNING
id,
name,
etag,
identity,
instanceId,
location,
plan,
properties,
resources,
sku,
tags,
type,
zones;
DELETE
examples
- delete
Deletes a virtual machine from a VM scale set.
DELETE FROM azure.compute.virtual_machine_scale_set_vms
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND vmScaleSetName = '{{ vmScaleSetName }}' --required
AND instanceId = '{{ instanceId }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND forceDeletion = '{{ forceDeletion }}'
;
Lifecycle Methods
- run_command
- reimage
- reimage_all
- approve_rolling_upgrade
- deallocate
- power_off
- restart
- start
- redeploy
- retrieve_boot_diagnostics_data
- perform_maintenance
- simulate_eviction
- attach_detach_data_disks
Run command on a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.run_command
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"commandId": "{{ commandId }}",
"script": "{{ script }}",
"parameters": "{{ parameters }}"
}'
;
Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.reimage
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"forceUpdateOSDiskForEphemeral": {{ forceUpdateOSDiskForEphemeral }},
"tempDisk": {{ tempDisk }},
"exactVersion": "{{ exactVersion }}",
"osProfile": "{{ osProfile }}"
}'
;
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.
EXEC azure.compute.virtual_machine_scale_set_vms.reimage_all
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance.
EXEC azure.compute.virtual_machine_scale_set_vms.approve_rolling_upgrade
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
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.
EXEC azure.compute.virtual_machine_scale_set_vms.deallocate
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
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.
EXEC azure.compute.virtual_machine_scale_set_vms.power_off
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@skipShutdown={{ skipShutdown }}
;
Restarts a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.restart
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Starts a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.start
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.
EXEC azure.compute.virtual_machine_scale_set_vms.redeploy
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.retrieve_boot_diagnostics_data
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@sasUriExpirationTimeInMinutes='{{ sasUriExpirationTimeInMinutes }}'
;
Performs maintenance on a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.perform_maintenance
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
The operation to simulate the eviction of spot virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.simulate_eviction
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Attach and detach data disks to/from a virtual machine in a VM scale set.
EXEC azure.compute.virtual_machine_scale_set_vms.attach_detach_data_disks
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@instanceId='{{ instanceId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"dataDisksToAttach": "{{ dataDisksToAttach }}",
"dataDisksToDetach": "{{ dataDisksToDetach }}"
}'
;