You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are costs calculated in VM scale sets recommendations.
Run book - Recommend-VMSSOptimizationsToBlobStorage.
Below is the query in above run book where total costs are calculated.
I see discrepancy in azure costs and query provided by below results for 30 day period.
AzureOptimizationConsumptionV1_CL
where todatetime(Date_s) between (stime..etime) and ResourceId contains 'virtualmachinescalesets'
| extend VMConsumedQuantity = iif(ResourceId contains 'virtualmachinescalesets' and MeterCategory_s == 'Virtual Machines', todouble(Quantity_s), 0.0)
| extend VMPrice = iif(ResourceId contains 'virtualmachinescalesets' and MeterCategory_s == 'Virtual Machines', todouble(EffectivePrice_s), 0.0)
| extend FinalCost = VMPrice * VMConsumedQuantity
| extend InstanceId_s = tolower(ResourceId)
| summarize Last30DaysCost = sum(FinalCost), Last30DaysQuantity = sum(VMConsumedQuantity) by InstanceId_s;
Please find attached cost analysis screenshot at RG level
Screenshot from Recommendations
The text was updated successfully, but these errors were encountered:
Hi, @sg1234566 . AOE calculates VMSS costs based on the consumed quantities (in compute hours) multiplied by the effective hourly price (inclusive of reservations or savings plans discounts). The discrepancy you are seeing might be caused by the fact you are looking at Cost Analysis actual costs (which sums as 0 every hour in which a VM was benefitting from a reservation or savings plans). If you switch to amortized costs (which takes into account the reservation/savings plans cost), you'll probably see a figure closer to what AOE is displaying.
How are costs calculated in VM scale sets recommendations.
Run book - Recommend-VMSSOptimizationsToBlobStorage.
Below is the query in above run book where total costs are calculated.
I see discrepancy in azure costs and query provided by below results for 30 day period.
AzureOptimizationConsumptionV1_CL
where todatetime(Date_s) between (stime..etime) and ResourceId contains 'virtualmachinescalesets'
| extend VMConsumedQuantity = iif(ResourceId contains 'virtualmachinescalesets' and MeterCategory_s == 'Virtual Machines', todouble(Quantity_s), 0.0)
| extend VMPrice = iif(ResourceId contains 'virtualmachinescalesets' and MeterCategory_s == 'Virtual Machines', todouble(EffectivePrice_s), 0.0)
| extend FinalCost = VMPrice * VMConsumedQuantity
| extend InstanceId_s = tolower(ResourceId)
| summarize Last30DaysCost = sum(FinalCost), Last30DaysQuantity = sum(VMConsumedQuantity) by InstanceId_s;
Please find attached cost analysis screenshot at RG level
Screenshot from Recommendations
The text was updated successfully, but these errors were encountered: