virtual_machine_scale_sets
Creates, updates, deletes, gets or lists a virtual_machine_scale_sets
resource.
Overview
Name | virtual_machine_scale_sets |
Type | Resource |
Id | azure.compute.virtual_machine_scale_sets |
Fields
The following fields are returned by SELECT
queries:
- get
- get_instance_view
- list_by_location
- list
- list_all
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates |
extendedLocation | object | The extended location of the Virtual Machine Scale Set. |
identity | object | The identity of the virtual machine scale set, if configured. |
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. |
sku | object | The virtual machine scale set sku. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine scale set zones. |
Name | Datatype | Description |
---|---|---|
extensions | array | The extensions information. |
orchestrationServices | array | The orchestration services information. |
statuses | array | The resource status information. |
virtualMachine | object | The instance view status summary for the virtual machine scale set. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates |
extendedLocation | object | The extended location of the Virtual Machine Scale Set. |
identity | object | The identity of the virtual machine scale set, if configured. |
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. |
sku | object | The virtual machine scale set sku. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine scale set zones. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates |
extendedLocation | object | The extended location of the Virtual Machine Scale Set. |
identity | object | The identity of the virtual machine scale set, if configured. |
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. |
sku | object | The virtual machine scale set sku. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine scale set zones. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
etag | string | Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates |
extendedLocation | object | The extended location of the Virtual Machine Scale Set. |
identity | object | The identity of the virtual machine scale set, if configured. |
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. |
sku | object | The virtual machine scale set sku. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | The virtual machine scale set zones. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , vmScaleSetName , subscriptionId | $expand | Display information about a virtual machine scale set. |
get_instance_view | select | resourceGroupName , vmScaleSetName , subscriptionId | Gets the status of a VM scale set instance. | |
list_by_location | select | location , subscriptionId | Gets all the VM scale sets under the specified subscription for the specified location. | |
list | select | resourceGroupName , subscriptionId | Gets a list of all VM scale sets under a resource group. | |
list_all | select | subscriptionId | 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. | |
create_or_update | insert | resourceGroupName , vmScaleSetName , subscriptionId | If-Match , If-None-Match | Create or update a VM scale set. |
update | update | resourceGroupName , vmScaleSetName , subscriptionId | If-Match , If-None-Match | Update a VM scale set. |
delete | delete | resourceGroupName , vmScaleSetName , subscriptionId | forceDeletion | Deletes a VM scale set. |
deallocate | exec | resourceGroupName , vmScaleSetName , subscriptionId | hibernate | 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. |
delete_instances | exec | resourceGroupName , vmScaleSetName , subscriptionId , instanceIds | forceDeletion | Deletes virtual machines in a VM scale set. |
power_off | exec | resourceGroupName , vmScaleSetName , subscriptionId | skipShutdown | 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. |
restart | exec | resourceGroupName , vmScaleSetName , subscriptionId | Restarts one or more virtual machines in a VM scale set. | |
start | exec | resourceGroupName , vmScaleSetName , subscriptionId | Starts one or more virtual machines in a VM scale set. | |
reapply | exec | resourceGroupName , vmScaleSetName , subscriptionId | Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances | |
redeploy | exec | resourceGroupName , vmScaleSetName , subscriptionId | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. | |
perform_maintenance | exec | resourceGroupName , vmScaleSetName , subscriptionId | 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 | |
reimage | exec | resourceGroupName , vmScaleSetName , subscriptionId | 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. | |
reimage_all | exec | resourceGroupName , vmScaleSetName , subscriptionId | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. | |
approve_rolling_upgrade | exec | resourceGroupName , vmScaleSetName , subscriptionId | Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. | |
force_recovery_service_fabric_platform_update_domain_walk | exec | resourceGroupName , vmScaleSetName , subscriptionId , platformUpdateDomain | zone , placementGroupId | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. |
convert_to_single_placement_group | exec | resourceGroupName , vmScaleSetName , subscriptionId | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. | |
set_orchestration_service_state | exec | resourceGroupName , vmScaleSetName , subscriptionId , serviceName , action | Changes ServiceState property for a given service |
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 |
---|---|---|
location | string | The location for which VM scale sets under the subscription are queried. |
platformUpdateDomain | integer | The platform update domain for which a manual recovery walk is requested |
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. |
vmScaleSetName | string | The name of the virtual machine scale set to create or update. |
$expand | string | 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 |
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 virtual machines from the VM scale set. (Feature in Preview) |
hibernate | boolean | Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible OrchestrationMode only) |
placementGroupId | string | The placement group id for which the manual recovery walk is requested. |
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 |
zone | string | The zone in which the manual recovery walk is requested for cross zone virtual machine scale set |
SELECT
examples
- get
- get_instance_view
- list_by_location
- list
- list_all
Display information about a virtual machine scale set.
SELECT
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_sets
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND vmScaleSetName = '{{ vmScaleSetName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $expand = '{{ $expand }}'
;
Gets the status of a VM scale set instance.
SELECT
extensions,
orchestrationServices,
statuses,
virtualMachine
FROM azure.compute.virtual_machine_scale_sets
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND vmScaleSetName = '{{ vmScaleSetName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Gets all the VM scale sets under the specified subscription for the specified location.
SELECT
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_sets
WHERE location = '{{ location }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Gets a list of all VM scale sets under a resource group.
SELECT
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_sets
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
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.
SELECT
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones
FROM azure.compute.virtual_machine_scale_sets
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
Create or update a VM scale set.
INSERT INTO azure.compute.virtual_machine_scale_sets (
data__sku,
data__plan,
data__properties,
data__identity,
data__zones,
data__extendedLocation,
data__location,
data__tags,
resourceGroupName,
vmScaleSetName,
subscriptionId,
If-Match,
If-None-Match
)
SELECT
'{{ sku }}',
'{{ plan }}',
'{{ properties }}',
'{{ identity }}',
'{{ zones }}',
'{{ extendedLocation }}',
'{{ location }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ vmScaleSetName }}',
'{{ subscriptionId }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones
;
# Description fields are for documentation purposes
- name: virtual_machine_scale_sets
props:
- name: resourceGroupName
value: string
description: Required parameter for the virtual_machine_scale_sets resource.
- name: vmScaleSetName
value: string
description: Required parameter for the virtual_machine_scale_sets resource.
- name: subscriptionId
value: string
description: Required parameter for the virtual_machine_scale_sets resource.
- name: sku
value: object
description: |
The virtual machine scale set sku.
- name: plan
value: object
description: |
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**.
- name: properties
value: object
description: |
Describes the properties of a Virtual Machine Scale Set.
- name: identity
value: object
description: |
The identity of the virtual machine scale set, if configured.
- name: zones
value: array
description: |
The virtual machine scale set zones.
- name: extendedLocation
value: object
description: |
The extended location of the Virtual Machine Scale Set.
- name: location
value: string
description: |
Resource location
- name: tags
value: object
description: |
Resource tags
- name: If-Match
value: string
description: 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.
- name: If-None-Match
value: string
description: 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.
UPDATE
examples
- update
Update a VM scale set.
UPDATE azure.compute.virtual_machine_scale_sets
SET
data__sku = '{{ sku }}',
data__plan = '{{ plan }}',
data__properties = '{{ properties }}',
data__identity = '{{ identity }}',
data__zones = '{{ zones }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND vmScaleSetName = '{{ vmScaleSetName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match}}'
AND If-None-Match = '{{ If-None-Match}}'
RETURNING
id,
name,
etag,
extendedLocation,
identity,
location,
plan,
properties,
sku,
tags,
type,
zones;
DELETE
examples
- delete
Deletes a VM scale set.
DELETE FROM azure.compute.virtual_machine_scale_sets
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND vmScaleSetName = '{{ vmScaleSetName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND forceDeletion = '{{ forceDeletion }}'
;
Lifecycle Methods
- deallocate
- delete_instances
- power_off
- restart
- start
- reapply
- redeploy
- perform_maintenance
- reimage
- reimage_all
- approve_rolling_upgrade
- force_recovery_service_fabric_platform_update_domain_walk
- convert_to_single_placement_group
- set_orchestration_service_state
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.
EXEC azure.compute.virtual_machine_scale_sets.deallocate
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@hibernate={{ hibernate }}
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Deletes virtual machines in a VM scale set.
EXEC azure.compute.virtual_machine_scale_sets.delete_instances
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@forceDeletion={{ forceDeletion }}
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
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.
EXEC azure.compute.virtual_machine_scale_sets.power_off
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@skipShutdown={{ skipShutdown }}
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Restarts one or more virtual machines in a VM scale set.
EXEC azure.compute.virtual_machine_scale_sets.restart
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Starts one or more virtual machines in a VM scale set.
EXEC azure.compute.virtual_machine_scale_sets.start
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances
EXEC azure.compute.virtual_machine_scale_sets.reapply
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on.
EXEC azure.compute.virtual_machine_scale_sets.redeploy
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
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
EXEC azure.compute.virtual_machine_scale_sets.perform_maintenance
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
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.
EXEC azure.compute.virtual_machine_scale_sets.reimage
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}",
"forceUpdateOSDiskForEphemeral": {{ forceUpdateOSDiskForEphemeral }}
}'
;
Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
EXEC azure.compute.virtual_machine_scale_sets.reimage_all
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set.
EXEC azure.compute.virtual_machine_scale_sets.approve_rolling_upgrade
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"instanceIds": "{{ instanceIds }}"
}'
;
Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.
EXEC azure.compute.virtual_machine_scale_sets.force_recovery_service_fabric_platform_update_domain_walk
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@platformUpdateDomain='{{ platformUpdateDomain }}' --required,
@zone='{{ zone }}',
@placementGroupId='{{ placementGroupId }}'
;
Converts SinglePlacementGroup property to false for a existing virtual machine scale set.
EXEC azure.compute.virtual_machine_scale_sets.convert_to_single_placement_group
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"activePlacementGroupId": "{{ activePlacementGroupId }}"
}'
;
Changes ServiceState property for a given service
EXEC azure.compute.virtual_machine_scale_sets.set_orchestration_service_state
@resourceGroupName='{{ resourceGroupName }}' --required,
@vmScaleSetName='{{ vmScaleSetName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"serviceName": "{{ serviceName }}",
"action": "{{ action }}"
}'
;