-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
I'm running the command az vm list-skus --size Standard_D2_v4 --location germanywestcentral --verbose inside an Azure container instance with 1GB memory. The process is being killed with exit code 137. Looking through the azure-cli code, the client.resource_skus.list() isn't providing a filter to the REST API method.
I ended up successfully using az rest --method GET --url "https://management.azure.com/subscriptions/$(az account show | jq -r .id)/providers/Microsoft.Compute/skus?api-version=2019-04-01&\$filter=location eq 'germanywestcentral'" | jq -r '.value[] | select(.name == "Standard_D2_v4")' as a work around since the location filtering is being done on the API server before everything is being returned to my azure-cli client.
Ref:
- https://learn.microsoft.com/en-us/python/api/azure-mgmt-compute/azure.mgmt.compute.v2019_04_01.operations.resourceskusoperations?view=azure-python
- https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list?view=rest-compute-2019-04-01&tabs=HTTP
- https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py#L123-L133
Related command
az vm list-skus --size Standard_D2_v4 --location germanywestcentral --verbose
Errors
Killed
Exit code 137
Issue script & Debug output
user@SandboxHost-638676532362232980:~$ az vm list-skus --all --size Standard_D2_v4 --location germanywestcentral --verbose
Killed
user@SandboxHost-638676532362232980:~$ echo $?
137
Expected behavior
I expect to get a json list of vm sku information matching my location and vm size.
results like this.
% az rest --method GET --url "https://management.azure.com/subscriptions/$(az account show | jq -r .id)/providers/Microsoft.Compute/skus?api-version=2019-04-01&\$filter=location eq 'germanywestcentral'" | jq -r '.value[] | select(.name == "Standard_D2_v4")'
{
"capabilities": [
{
"name": "MaxResourceVolumeMB",
"value": "0"
},
{
"name": "OSVhdSizeMB",
"value": "1047552"
},
{
"name": "vCPUs",
"value": "2"
},
{
"name": "MemoryPreservingMaintenanceSupported",
"value": "True"
},
{
"name": "HyperVGenerations",
"value": "V1,V2"
},
{
"name": "MemoryGB",
"value": "8"
},
{
"name": "MaxDataDiskCount",
"value": "4"
},
{
"name": "CpuArchitectureType",
"value": "x64"
},
{
"name": "LowPriorityCapable",
"value": "True"
},
{
"name": "PremiumIO",
"value": "False"
},
{
"name": "VMDeploymentTypes",
"value": "IaaS"
},
{
"name": "vCPUsAvailable",
"value": "2"
},
{
"name": "ACUs",
"value": "195"
},
{
"name": "vCPUsPerCore",
"value": "2"
},
{
"name": "CombinedTempDiskAndCachedIOPS",
"value": "19000"
},
{
"name": "CombinedTempDiskAndCachedReadBytesPerSecond",
"value": "120586240"
},
{
"name": "CombinedTempDiskAndCachedWriteBytesPerSecond",
"value": "120586240"
},
{
"name": "CachedDiskBytes",
"value": "53687091200"
},
{
"name": "UncachedDiskIOPS",
"value": "3200"
},
{
"name": "UncachedDiskBytesPerSecond",
"value": "48000000"
},
{
"name": "EphemeralOSDiskSupported",
"value": "False"
},
{
"name": "EncryptionAtHostSupported",
"value": "False"
},
{
"name": "CapacityReservationSupported",
"value": "True"
},
{
"name": "AcceleratedNetworkingEnabled",
"value": "True"
},
{
"name": "RdmaEnabled",
"value": "False"
},
{
"name": "MaxNetworkInterfaces",
"value": "2"
}
],
"family": "standardDv4Family",
"locationInfo": [
{
"location": "GermanyWestCentral",
"zoneDetails": [],
"zones": [
"2",
"1",
"3"
]
}
],
"locations": [
"GermanyWestCentral"
],
"name": "Standard_D2_v4",
"resourceType": "virtualMachines",
"restrictions": [],
"size": "D2_v4",
"tier": "Standard"
}
Environment Summary
azure-cli 2.67.0
core 2.67.0
telemetry 1.1.0
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location '/usr/bin/python3'
Extensions directory '/home/tsh-helper-user/.azure/cliextensions'
Python (Linux) 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Running ubuntu:22.04 image with Azure Container Instance resource specs
% jq '.containers[].resources' <<<$aci
{
"limits": {
"cpu": 1.0,
"gpu": null,
"memoryInGb": 1.0
},
"requests": {
"cpu": 1.0,
"gpu": null,
"memoryInGb": 1.0
}
}