The VM Cost details generated by the Cost Engine are as follows:
{
"moid": "XXXXX",
"lastUpdatedTimeInMillis": 0,
"allocationBasedCpuMTDCost": 0.11058541773473808089,
"allocationBasedMemoryMTDCost": 0.44588757229671619264,
"allocationBasedStorageMTDCost": 2.6666666666666666666,
"isReclaimableIdle": 0,
"isReclaimablePoweredOff": 0,
"isOverSized": 0,
"functionalKey": "XXXXX",
"vcUuid": "XXXXX",
"resourceType": "VM",
"datacenterMoid": "datacenter-2",
"datacenterName": "XXXXX",
"clusterMoid": "XXXXX",
"clusterName": "BJS-CLUSTER",
"resourceName": "prod43168",
"vcName": "XXXXX",
"endPointLink": "13606456393757",
"tenantId": "XXXXX",
"osType": "WINDOWS_SERVER",
"serverMoid": "XXXXX",
"serverName": "XXXXX",
"vmCreationTime": 1698969913294,
"powerState": "on",
"memCapacityGbs": 16.0,
"storageCapacityGbs": 400.0,
"utilizedStorageGbs": 0.0,
"utilizedCpuGhz": 0.0,
"utilizedMemGbs": 0.0,
"provisionedVcpuCnt": 4,
"cpuBaseRate": 0.010661096110475289,
"memoryBaseRate": 0.027867973268544764,
"totalCost": 3.3807999999999998053,
"vmDirectCost": 3.38079999999999980531129040173254907131195068359375,
"vmInDirectCost": 0E-18,
"vmStorageCost": 0,
"vmMemoryCost": 0E-18,
"vmCpuCost": 0E-18,
"allocationBasedTotalCost": 48.504755193773692945,
"allocationBasedCpuCost": 1.54819584828633312,
"allocationBasedMemoryCost": 6.242426012154026688,
"allocationBasedStorageCost": 37.333333333333333332,
"osLaborTotalCost": 1.4048,
"recordTimeMillis": "1698970326000"
}
To calculate the VM cost, we need to use base rates (allocationBasedCpuBaseRate and allocationBasedMemoryBaseRate) from the corresponding cluster, which, in this case, is the BJS-CLUSTER. Here are the cost details for the cluster:
{
"moid": "XXXXX",
"lastUpdatedTimeInMillis": 0,
"isReclaimableIdle": 0,
"isReclaimablePoweredOff": 0,
"isOverSized": 0,
"functionalKey": "XXXXX",
"vcUuid": "XXXXX",
"resourceType": "CLUSTER",
"datacenterMoid": "datacenter-2",
"datacenterName": "XXXXX",
"clusterMoid": "XXXXX",
"clusterName": "BJS-CLUSTER",
"symphonyResourceId": "XXXXX",
"resourceName": "BJS-CLUSTER",
"vcName": "XXXXX",
"endPointLink": "13606456393757",
"tenantId": "XXXXX",
"numVms": 218,
"totalCpuCoreCnt": 280,
"cpuCapacityGhz": 726.096,
"memCapacityGbs": 10236.696681976318,
"storageCapacityGbs": 33574.8740234375,
"utilizedCpuGhz": 0.0,
"utilizedMemGbs": 0.0,
"provisionedVcpuCnt": 794,
"provisionedMemGbs": 3634.640625,
"cpuBaseRate": 0.3198328833142587,
"memoryBaseRate": 0.8360391980563429,
"allocationBasedCpuBaseRate": 0.41469531650526780332,
"allocationBasedMemoryBaseRate": 0.41801959902817143060,
"avgVmUtilizedCpuGhz": 0.0,
"avgVmUtilizedMemGbs": 0.0,
"avgVmProvisionedMemGbs": 16.672663417431192,
"avgVmProvisionedVcpuCnt": 3.6422018348623855,
"totalCost": 4395.2545309942285029,
"totalMTDCost": 439.52545309942285029,
"avgVmCost": 3.3807999999999998053,
"recordTimeMillis": "1698970326000"
}
Based on the recordTimeMillis provided (3rd November 00:12:06 UTC) for the last two days of November, the MTD Cost calculation is as follows:
MTD Cost = (Base Rate * No of Days) / Total Days in Month
CPU Cost:
CPU Cost = CPU Count * AllocationBasedCpuBaseRate (of the corresponding cluster) = 4 * 0.414695317 = 1.658781266
allocationBasedCpuMTDCost = (1.658781266 * 2) / 30 = 0.110585418
Memory Cost:
Memory Cost = VM's Memory Capacity * Allocation Based Memory Base Rate = 16 * 0.418019599 = 6.688313584
allocationBasedMemoryMTDCost = (6.688313584 * 2) / 30 = 0.445887572
Storage Cost:
Storage Cost = Storage Allocated * Base Rate = 400 * 0.1 = 40
allocationBasedStorageMTDCost = (40 * 2) / 30 = 2.666666667
VM MTD Cost:
VM MTD Cost = allocationBasedCpuMTDCost + allocationBasedMemoryMTDCost + allocationBasedStorageMTDCost
VM MTD Cost = 0.110585418 + 0.445887572 + 2.666666667 = 3.223139657
Allocation Based Total Cost:
allocationBasedTotalCost = (VM MTD Cost * VM Days in the Month) / (No. of Days in the Month)
allocationBasedTotalCost = (3.223139657 * 30) / 2 = 48.34709485047181
For the Daily VM Cost, we divide allocationBasedTotalCost by 30.45 (average days in a month):
Daily VM Cost:
Daily VM Cost = 48.34709485047181 / 30.45 = 1.587753525