3

The only way I know of to enquire maximum update domains or fault domains allowed for creation of an avaiability set in Azure is by passing very large values and then parsing the error message. Is there a better way to query for the maximum values?

For example, executing New-AzureRmAvailabilitySet -PlatformUpdateDomainCount 100 -PlatformFaultDomainCount 100 <other parameters> will fail with an error that looks like below:

ErrorCode: InvalidParameter
ErrorMessage: The specified fault domain count 100 must fall in the range 1 to 2.
StatusCode: 400
ReasonPhrase: Bad Request
bittusarkar
  • 6,247
  • 3
  • 30
  • 50
  • This is not a broad question. I am asking about a programmatic way to fetch the maximum values of fault domains and update domains of an Azure region. – bittusarkar Apr 12 '18 at 08:42

2 Answers2

2

Maybe you can find the maximum fault domains in this article:

enter image description here enter image description here

The maximum update domains is 20 by default.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • 2
    I know about this page. But then, I have to hard-code this information in my script and keep track of this page if some value changes. I want to find the limits programatically. Is there a way to achieve that? – bittusarkar Apr 12 '18 at 08:36
0

You can use The command in this Microsoft article (https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview) "Availability sets overview" to retrieves a list of fault domains per region.

Reference from Microsoft article "Availability sets overview"

az vm list-skus --resource-type availabilitySets --query '[?name==`Aligned`].{Location:locationInfo[0].location, MaximumFaultDomainCount:capabilities[0].value}' -o Table
desertnaut
  • 57,590
  • 26
  • 140
  • 166