if you go on https://cloud.google.com/products/calculator and under compute engine
and fill out the number of fields: instances: 1, Operating System: Free, Datacenter Location: Toronto
Now if you change the Machine Family to "Accelerator Optimised" and the Machine Series to A2:
you will get a warning saying:
This instance type is not available in this region.
However, if you use the Google Cloud Pricing API: https://cloudbilling.googleapis.com/v1/services/6F81-5844-456A/skus?key=API_KEY
There is an Object in the data that tells us A2 machines are available in Toronto, the object is:
{
"name":"services/6F81-5844-456A/skus/1CD3-9D89-855A",
"skuId":"1CD3-9D89-855A",
"description":"A2 Instance Core running in Toronto",
"category":{
"serviceDisplayName":"Compute Engine",
"resourceFamily":"Compute",
"resourceGroup":"CPU",
"usageType":"OnDemand"
},
"serviceRegions":[
"northamerica-northeast2"
],
"pricingInfo":[
{
"summary":"",
"pricingExpression":{
"usageUnit":"h",
"displayQuantity":1,
"tieredRates":[
{
"startUsageAmount":0,
"unitPrice":{
"currencyCode":"USD",
"units":"0",
"nanos":34802000
}
}
],
"usageUnitDescription":"hour",
"baseUnit":"s",
"baseUnitDescription":"second",
"baseUnitConversionFactor":3600
},
"currencyConversionRate":1,
"effectiveTime":"2022-07-18T01:31:45.922Z"
}
],
"serviceProviderName":"Google",
"geoTaxonomy":{
"type":"REGIONAL",
"regions":[
"northamerica-northeast2"
]
}
}
Can anyone explain this or refer me to the relevant email where I can ask them?
An SKU (Stock Keeping Unit) is an ID for billing. Just because there is an SKU, does not mean it is "in stock" (available).
To determine the availability of a machine type use the machine type API: https://cloud.google.com/compute/docs/reference/rest/v1/machineTypes