Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.61k stars 5.01k forks source link

Need Rest API to get the availability zones information on the basis of Object selected in a particular region #3594

Open hellosnow opened 6 years ago

hellosnow commented 6 years ago

This is a question/issue transferred from https://github.com/MicrosoftDocs/feedback/issues/544, please help whether there's an answer for that.

Is your feature request related to a problem? Please describe. It would be better if we can get the availability zones available in a particular region based on object selected. Right now it is mentioned that only below regions support the availability zones:

Central US France Central East US 2 (Preview) West Europe Southeast Asia (Preview)

If we can get the information using Rest API that weather selected region supports the availability zone or not? If it does, how many zones are there. Basically to get the supported availability zones based on region and selected resource.

For example: While creating the VM using Portal, if we select the region as Central US which supports availability zones, it does enable the Availability Zone option in Portal UI. And If user selects the Size as "Standard_DS3" which supports only Zone "3".

Similar support required from Rest API, is there a way we can get the supported list of Availability Zone(s) based on Region, Resource etc.

Describe the solution you'd like Need a Get API call to get the list of Supported Availability Zones based on Region and Resource selected.

Describe alternatives you've considered NA

Additional context NA

hellosnow commented 6 years ago

@surajmuthreja to get update here.

dsgouda commented 6 years ago

@hellosnow Is there a particular resource (Compute/Network, etc) for which you'd like to get the AvailabilityZones?

surajmuthreja commented 6 years ago

@dsgouda Ideally I am looking for all the resources which will be there as part of VM/Instance creation on Azure. E.g. We would need to provide this zone information for Public IP as well, instance size, region (wherever it is supported).

dsgouda commented 6 years ago

@hyonholee Would you be able to take a look at this or suggest someone who can?

surajmuthreja commented 5 years ago

Hi @hellosnow @dsgouda , Can we please have some update on this?

dsgouda commented 5 years ago

@surajmuthreja please contact @hyonholee directly, he handles the Compute SDKs

surajmuthreja commented 5 years ago

Thanks @dsgouda ! @hyonholee Can you please help here.

surajmuthreja commented 5 years ago

@hellosnow , @dsgouda , @hyonholee Any update on this request.

hyonholee commented 5 years ago

Currently, a user can use Get-AzComputeResourceSku to get the result. For example, the following will show zones for disks.

Get-AzComputeResourceSku | ? {$.LocationInfo[0].Zones -ne $null -and $.ResourceType -eq 'disks' }

But, the request is for more convenient API that shows zones based on input. We will discuss regarding the suggested API.

danielestevez commented 5 years ago

There is an API call to get this info https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list Returns a huge response that you can filter and look for the zones allowed per resorce or region { "resourceType": "disks", "name": "Premium_LRS", "tier": "Premium", "locations": [ "southeastasia" ], "locationInfo": [ { "location": "southeastasia", "zones": [ "3", "2", "1" ] } ], "restrictions": [] }, ...

    ` {
        "resourceType": "virtualMachines",
        "name": "Standard_F8",
        "tier": "Standard",
        "size": "F8",
        "family": "standardFFamily",
        "locations": [
            "eastus2"
        ],
        "locationInfo": [
            {
                "location": "eastus2",
                "zones": [
                    "1",
                    "2",
                    "3"
                ]
            }
        ],
        ...`
surajmuthreja commented 5 years ago

Thanks Daniel!

This is really huge response and needs filtration. But for the time being we can live with it I guess.

It will be more convenient if we can fulfill the original request also. Thanks in advance!

Thanks, Suraj Muthreja.

From: Daniel Estévez notifications@github.com Sent: Friday, December 21, 2018 3:33 AM To: Azure/azure-rest-api-specs azure-rest-api-specs@noreply.github.com Cc: Suraj Muthreja surajm@versa-networks.com; Mention mention@noreply.github.com Subject: Re: [Azure/azure-rest-api-specs] Need Rest API to get the availability zones information on the basis of Object selected in a particular region (#3594)

There is an API call to get this info https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list Returns a huge response that you can filter and look for the zones allowed per resorce or region { "resourceType": "disks", "name": "Premium_LRS", "tier": "Premium", "locations": [ "southeastasia" ], "locationInfo": [ { "location": "southeastasia", "zones": [ "3", "2", "1" ] } ], "restrictions": [] }, ...

` {

    "resourceType": "virtualMachines",

    "name": "Standard_F8",

    "tier": "Standard",

    "size": "F8",

    "family": "standardFFamily",

    "locations": [

        "eastus2"

    ],

    "locationInfo": [

        {

            "location": "eastus2",

            "zones": [

                "1",

                "2",

                "3"

            ]

        }

    ],

    ...`

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-rest-api-specs/issues/3594#issuecomment-449149685, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AlvCg6q45gnXd6CVXcApVo3LZ3YLat3sks5u7AkVgaJpZM4Vxh5G.

Drewm3 commented 4 years ago

Cleaning up old issues from 2016 - 2018. Please reopen this issue if it is still a concern.

surajmuthreja commented 4 years ago

@Drewm3 -- This issue is still not fixed. Can you please reopen this and assigned to relevant team. I could not reopen this issue.

Drewm3 commented 4 years ago

@surajmuthreja , the SKUs API for VMs provides the zones where each VM size is available for any specific subscription. It seems like this was the original request which is resolved. Could you describe why you feel this is not resolved at this point?

surajmuthreja commented 4 years ago

@Drewm3 We are looking for APIs through which we should be able to get supported zones once user selects any Object. Apart from VM size, there are other resources also where zone dependency is there. e.g. Public IP,

Drewm3 commented 4 years ago

@surajmuthreja, as far as I know there is no API that will indicate if an arbitrary resource type and SKU is available in a specific zone. The reason for this is that most resources either support zones in a region or not. For example with managed disks or standard public IP addresses, they are supported in all zones if the region supports zones. This works for those resources because they are basically software constructs.

VM sizes are different because they are tied to physical hardware, and that physical hardware may not be available in all zones. So with VM sizes we need to have the specific API support to expose which zones support which sizes.

Please let me know if this answers your question, and if it does then I will close this issue.

gek0 commented 4 years ago

hitting the same brick wall as @surajmuthreja We are trying to deploy virtual machines (and every other related resource - disks, IPs) in an automated fashion and highly-available with the usage of Availability Zone. I'm aware of Availability Sets but in this case, it's not enough - we are planning to use AS only if a region does not support AZ design.

So back to the problem -

It would be great if there would be a simple API call that would take the following parameters (location, virtual machine tier) and return all available zones as an array

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.

Drewm3 commented 4 years ago

I have answered this question from the compute/VM case. We provide an API to determine exactly which VM SKUs are available in AZs in each region.

@armleads-azure, could you comment on the possibility of a generic API, possibly as part of list locations, which can indicate if the location supports AZs or not?

richrundmsft commented 3 years ago

I realize this thread has been open for a while, but I want to share how we handle this in the Azure portal for Networking resources (e.g. Public IP Addresses).

The portal makes a call to the Providers API.

GET /subscriptions/<subId>/providers/Microsoft.Network?api-version=2020-06-01

In the response body you can find zoneMappings which have the display name for the region and the valid availability zones. A sample (trimmed) response is below so you can see an example:


{
  "id": "/subscriptions/<subId>/providers/Microsoft.Network",
  "namespace": "Microsoft.Network",
  "authorizations": [
...  ],
  "resourceTypes": [
    {
...
      "resourceType": "natGateways",
      "locations": [
        "West US",
...      ],
      "apiVersions": [
        "2020-11-01",
...      ],
      "zoneMappings": [
        {
          "location": "East US 2",
          "zones": [
            "3",
            "2",
            "1"
          ]
        },
        {
          "location": "Central US",
          "zones": [
            "3",
            "2",
            "1"
          ]
        },
...      ],
      "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove"
    },
    {
GePerez commented 2 years ago

It's been 3 years since this feedback was provided. Is there still no API that one can call to programmatically determine for a given "Resource type and region" if Zone redundancy is supported?

plzm commented 2 years ago

It's been 3 years since this feedback was provided. Is there still no API that one can call to programmatically determine for a given "Resource type and region" if Zone redundancy is supported?

Agree. My use case is also very simple: "List Azure regions which support Availability Zones"

How does this docs page get its list? https://docs.microsoft.com/azure/availability-zones/az-overview#azure-regions-with-availability-zones

ksridhar57 commented 2 years ago

Hi,

I happen to have the same requirement where I would want to list the locations and corresponding availability zones for the VMs. I use the REST endpoint (https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list )as suggested by Daniel in one of the comments. However, I would like to seek your advice in interpreting the output which looks like this -

{'resourceType': 'virtualMachines', 'name': 'Standard_PB6s', 'tier': 'Standard', 'size': 'PB6s', 'family': 'standardPBSFamily', 'locations': ['westeurope'], 'locationInfo': [{'location': 'westeurope', 'zones': ['2'], 'zoneDetails': []}], 'capabilities': [{'name': 'MaxResourceVolumeMB', 'value': '344064'}, {'name': 'OSVhdSizeMB', 'value': '1047552'}, {'name': 'vCPUs', 'value': '6'}, {'name': 'MemoryPreservingMaintenanceSupported', 'value': 'False'}, {'name': 'HyperVGenerations', 'value': 'V1,V2'}, {'name': 'MemoryGB', 'value': '112'}, {'name': 'MaxDataDiskCount', 'value': '12'}, {'name': 'CpuArchitectureType', 'value': 'x64'}, {'name': 'LowPriorityCapable', 'value': 'False'}, {'name': 'PremiumIO', 'value': 'True'}, {'name': 'VMDeploymentTypes', 'value': 'IaaS'}, {'name': 'EphemeralOSDiskSupported', 'value': 'False'}, {'name': 'EncryptionAtHostSupported', 'value': 'False'}, {'name': 'CapacityReservationSupported', 'value': 'False'}, {'name': 'AcceleratedNetworkingEnabled', 'value': 'True'}, {'name': 'RdmaEnabled', 'value': 'False'}, {'name': 'MaxNetworkInterfaces', 'value': '1'}], 'restrictions': [{'type': 'Location', 'values': ['westeurope'], 'restrictionInfo': {'locations': ['westeurope']}, 'reasonCode': 'NotAvailableForSubscription'}, {'type': 'Zone', 'values': ['westeurope'], 'restrictionInfo': {'locations': ['westeurope'], 'zones': ['1', '2', '3']}, 'reasonCode': 'NotAvailableForSubscription'}]},

As I understand it, the information provided in this line 'locationInfo': [{'location': 'westeurope', 'zones': ['2'], 'zoneDetails': []}], indicates that the VM type resources of StandardPBSFamily can only be deployed in a single zone (2). Is this interpretation right?

What does the last line 'restrictionInfo': {'locations': ['westeurope'], 'zones': ['1', '2', '3']}, 'reasonCode': 'NotAvailableForSubscription'}] indicate?