I am trying to create a VM with a playbook like this:
tasks:
...
- name: Create VM
azure_rm_virtualmachine:
resource_group: AnsibleResourcEGroup
name: AnsibleVM
vm_size: Standard_D4s_v3
...
When I run the playbook, this "Create VM" task fails:
fatal: [localhost]: FAILED! => {
"changed": false,
"msg": "Error creating or updating virtual machine AnsibleVM - Azure Error: SkuNotAvailable\nMessage: The requested size for resource '/subscriptions/some-subscription-id/resourceGroups/some-resource-group-name/providers/Microsoft.Compute/virtualMachines/AnsibleVM' is currently not available in location 'region-name' zones '' for subscription 'some-subscription-id'. Please try another size or deploy to a different location or zones. See https://aka.ms/azureskunotavailable for details."
}
However, when I use az
cli to enquery for the available vm size, the size Standard_D4s_v3
seems available:
$ az vm list-skus --location region-id --size Standard_D --output table
ResourceType Locations Name Zones Capabilities Restrictions
--------------- ----------- ------------------ ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------
...
virtualMachines region-id Standard_D2s_v3 1,2,3 ['MaxResourceVolumeMB=16384', 'OSVhdSizeMB=1047552', 'vCPUs=2', 'HyperVGenerations=V1,V2', 'MemoryGB=8', 'MaxDataDiskCount=4', 'LowPriorityCapable=True', 'PremiumIO=True', 'vCPUsAvailable=2', 'ACUs=160', 'vCPUsPerCore=2', 'CombinedTempDiskAndCachedIOPS=4000', 'CombinedTempDiskAndCachedReadBytesPerSecond=33554432', 'CombinedTempDiskAndCachedWriteBytesPerSecond=33554432', 'CachedDiskBytes=53687091200', 'UncachedDiskIOPS=3200', 'UncachedDiskBytesPerSecond=50331648', 'EphemeralOSDiskSupported=True', 'AcceleratedNetworkingEnabled=False', 'RdmaEnabled=False', 'MaxNetworkInterfaces=2'] None
virtualMachines region-id Standard_D4s_v3 1,2,3 ['MaxResourceVolumeMB=32768', 'OSVhdSizeMB=1047552', 'vCPUs=4', 'HyperVGenerations=V1,V2', 'MemoryGB=16', 'MaxDataDiskCount=8', 'LowPriorityCapable=True', 'PremiumIO=True', 'vCPUsAvailable=4', 'ACUs=160', 'vCPUsPerCore=2', 'CombinedTempDiskAndCachedIOPS=8000', 'CombinedTempDiskAndCachedReadBytesPerSecond=67108864', 'CombinedTempDiskAndCachedWriteBytesPerSecond=67108864', 'CachedDiskBytes=107374182400', 'UncachedDiskIOPS=6400', 'UncachedDiskBytesPerSecond=100663296', 'EphemeralOSDiskSupported=True', 'AcceleratedNetworkingEnabled=True', 'RdmaEnabled=False', 'MaxNetworkInterfaces=2'] None
virtualMachines region-id Standard_D8s_v3 1,2,3 ['MaxResourceVolumeMB=65536', 'OSVhdSizeMB=1047552', 'vCPUs=8', 'HyperVGenerations=V1,V2', 'MemoryGB=32', 'MaxDataDiskCount=16', 'LowPriorityCapable=True', 'PremiumIO=True', 'vCPUsAvailable=8', 'ACUs=160', 'vCPUsPerCore=2', 'CombinedTempDiskAndCachedIOPS=16000', 'CombinedTempDiskAndCachedReadBytesPerSecond=134217728', 'CombinedTempDiskAndCachedWriteBytesPerSecond=134217728', 'CachedDiskBytes=214748364800', 'UncachedDiskIOPS=12800', 'UncachedDiskBytesPerSecond=201326592', 'EphemeralOSDiskSupported=True', 'AcceleratedNetworkingEnabled=True', 'RdmaEnabled=False', 'MaxNetworkInterfaces=4'] None
...
which does not seems right.
So which part of my understanding wrong? How should I make sure that a VM size is available in my region?