Availability Sets - Create Or Update
Create or update an availability set.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}?api-version=2024-11-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
availability
|
path | True |
string |
The name of the availability set. |
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
location | True |
string |
The geo-location where the resource lives |
properties.platformFaultDomainCount |
integer (int32) |
Fault Domain count. |
|
properties.platformUpdateDomainCount |
integer (int32) |
Update Domain count. |
|
properties.proximityPlacementGroup |
Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. |
||
properties.scheduledEventsPolicy |
Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. |
||
properties.virtualMachines |
A list of references to all virtual machines in the availability set. |
||
sku |
Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. |
||
tags |
object |
Resource tags. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Resource 'AvailabilitySet' update operation succeeded |
|
Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Create an availability set with Scheduled Event Policy. |
Create an availability set. |
Create an availability set with Scheduled Event Policy.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet?api-version=2024-11-01
{
"location": "westus",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 20
}
}
Sample response
{
"sku": {
"name": "Classic"
},
"name": "myAvailabilitySet",
"properties": {
"scheduledEventsPolicy": {
"scheduledEventsAdditionalPublishingTargets": {
"eventGridAndResourceGraph": {
"enable": true
}
},
"userInitiatedRedeploy": {
"automaticallyApprove": true
},
"userInitiatedReboot": {
"automaticallyApprove": true
}
},
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 20
},
"location": "westus",
"type": "Microsoft.Compute/availabilitySets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"
}
Create an availability set.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet?api-version=2024-11-01
{
"location": "westus",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 20
}
}
Sample response
{
"sku": {
"name": "Classic"
},
"name": "myAvailabilitySet",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 20,
"virtualMachineScaleSetMigrationInfo": {
"defaultVirtualMachineScaleSetInfo": {
"defaultVirtualMachineScaleSet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
},
"constrainedMaximumCapacity": false
},
"migrateToVirtualMachineScaleSet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
}
},
"location": "westus",
"type": "Microsoft.Compute/availabilitySets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"
}
Definitions
Name | Description |
---|---|
Api |
Api error. |
Api |
Api error base. |
Availability |
Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Availability sets overview. For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure. Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set. |
Cloud |
An error response from the Compute service. |
created |
The type of identity that created the resource. |
Default |
Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. |
Event |
Specifies eventGridAndResourceGraph related Scheduled Event related configurations. |
Inner |
Inner error details. |
Instance |
Instance view status. |
Scheduled |
|
Scheduled |
Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations. |
Sku |
Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. |
Status |
The level code. |
Sub |
|
system |
Metadata pertaining to creation and last modification of the resource. |
User |
Specifies Reboot related Scheduled Event related configurations. |
User |
Specifies Redeploy related Scheduled Event related configurations. |
Virtual |
Describes the Availability Set properties related to migration to Flexible Virtual Machine Scale Set. |
ApiError
Api error.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
The Api error details |
|
innererror |
The Api inner error |
|
message |
string |
The error message. |
target |
string |
The target of the particular error. |
ApiErrorBase
Api error base.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
message |
string |
The error message. |
target |
string |
The target of the particular error. |
AvailabilitySet
Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Availability sets overview. For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure. Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
location |
string |
The geo-location where the resource lives |
name |
string |
The name of the resource |
properties.platformFaultDomainCount |
integer (int32) |
Fault Domain count. |
properties.platformUpdateDomainCount |
integer (int32) |
Update Domain count. |
properties.proximityPlacementGroup |
Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. |
|
properties.scheduledEventsPolicy |
Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. |
|
properties.statuses |
The resource status information. |
|
properties.virtualMachineScaleSetMigrationInfo |
Describes the migration properties on the Availability Set. |
|
properties.virtualMachines |
A list of references to all virtual machines in the availability set. |
|
sku |
Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. |
|
systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
tags |
object |
Resource tags. |
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
CloudError
An error response from the Compute service.
Name | Type | Description |
---|---|---|
error |
Api error. |
createdByType
The type of identity that created the resource.
Value | Description |
---|---|
User | |
Application | |
ManagedIdentity | |
Key |
DefaultVirtualMachineScaleSetInfo
Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API.
Name | Type | Description |
---|---|---|
constrainedMaximumCapacity |
boolean |
Indicates if the the maximum capacity of the default migrated Virtual Machine Scale Set after its migration will be constrained to a limited number of VMs. |
defaultVirtualMachineScaleSet |
The default Virtual Machine ScaleSet Uri that the Availability Set will be moved to upon triggering a seamless migration via the ConvertToVirtualMachineScaleSet API. |
EventGridAndResourceGraph
Specifies eventGridAndResourceGraph related Scheduled Event related configurations.
Name | Type | Description |
---|---|---|
enable |
boolean |
Specifies if event grid and resource graph is enabled for Scheduled event related configurations. |
InnerError
Inner error details.
Name | Type | Description |
---|---|---|
errordetail |
string |
The internal error message or exception dump. |
exceptiontype |
string |
The exception type. |
InstanceViewStatus
Instance view status.
Name | Type | Description |
---|---|---|
code |
string |
The status code. |
displayStatus |
string |
The short localizable label for the status. |
level |
The level code. |
|
message |
string |
The detailed status message, including for alerts and error messages. |
time |
string (date-time) |
The time of the status. |
ScheduledEventsAdditionalPublishingTargets
Name | Type | Description |
---|---|---|
eventGridAndResourceGraph |
The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. |
ScheduledEventsPolicy
Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations.
Name | Type | Description |
---|---|---|
scheduledEventsAdditionalPublishingTargets |
The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. |
|
userInitiatedReboot |
The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. |
|
userInitiatedRedeploy |
The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. |
Sku
Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
Name | Type | Description |
---|---|---|
capacity |
integer (int64) |
Specifies the number of virtual machines in the scale set. |
name |
string |
The sku name. |
tier |
string |
Specifies the tier of virtual machines in a scale set. |
StatusLevelTypes
The level code.
Value | Description |
---|---|
Info | |
Warning | |
Error |
SubResource
Name | Type | Description |
---|---|---|
id |
string |
Resource Id |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
UserInitiatedReboot
Specifies Reboot related Scheduled Event related configurations.
Name | Type | Description |
---|---|---|
automaticallyApprove |
boolean |
Specifies Reboot Scheduled Event related configurations. |
UserInitiatedRedeploy
Specifies Redeploy related Scheduled Event related configurations.
Name | Type | Description |
---|---|---|
automaticallyApprove |
boolean |
Specifies Redeploy Scheduled Event related configurations. |
VirtualMachineScaleSetMigrationInfo
Describes the Availability Set properties related to migration to Flexible Virtual Machine Scale Set.
Name | Type | Description |
---|---|---|
defaultVirtualMachineScaleSetInfo |
Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. |
|
migrateToVirtualMachineScaleSet |
Specifies the Virtual Machine Scale Set that the Availability Set is migrated to. |