简体   繁体   中英

Get list of Azure VM size that supports premium disk

I need to fetch a list of Azure vm sizes that supports Premium disk. I tried the 'get-azvmsize' but it does not have a property for 'Premium disk support'.

Command does not give 'premium disk support' property.

$data = get-azvmsize -ResourceGroupName Demo-eu-rsv-dev -VMName eusvm1dev

PS /home/cstx_a_manjug> $data

Name                   NumberOfCores MemoryInMB MaxDataDiskCount OSDiskSizeInMB ResourceDiskSizeInMB
----                   ------------- ---------- ---------------- -------------- --------------------
Standard_B1ls                      1        512                2        1047552                 4096
Standard_B1ms                      1       2048                2        1047552                 4096
Standard_B1s                       1       1024                2        1047552                 4096

在此处输入图像描述

Based on PSVirtualMachineSize Class , there is no such a property for 'Premium disk support'. So I'm afraid that we can't get 'Premium disk support' through this cmd.

Currently we need to use List Resource SKUs to get the VM size information.

{
    "name": "PremiumIO",
    "value": "True"
}

This property PremiumIO is 'Premium disk support'. Unfortunately only location filter is supported currently based on URI Parameters . So the response data is very large. You need to deal with it in your code to filter "resourceType" as "virtualMachines" and "PremiumIO" as "True".

There is indeed a corresponding Powershell cmd Get-AzComputeResourceSku .

Here is an example:

Get-AzComputeResourceSku  | where{$_.ResourceType.Equals('virtualMachines') -and $_.Locations.Contains('westus').Equals($true) -and $_.Capabilities.where({($_.Value -eq 'True') -and ($_.Name -eq 'PremiumIO')})}| Select-Object Name, Capabilities, ResourceType, Locations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM