-
Epic
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
RHEL Metering: Handle Azure ScaleSets for Metering
-
1
-
False
-
None
-
False
Azure scalesets have a different resource id than anticipated and the VM name to query for the ID is located in the additional info field rather than at the end of the resource id. We should update processing to account for scalesets and query azure correctly based on VM ID. We currently track last processed time based on resource id, for scalesets we likely need to do a combination of resource id and VM name depending on if the resource id is static for all VMs in a scaleset.
Scaleset example:
"resourceid": "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachineScaleSets/<scaleset-id>", ... "additionalinfo": "{\"UsageType\": ..., \"VMName\": \"<scaleset-id>_0\", \"VMProperties\": null, \"VCPUs\": 4, \"ConsumedQuantity\": 1.0, ...}",
compared to a normal VM example:
"resourceid": "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/virtualMachines/<vm-name>", ... "additionalinfo": "{\"UsageType\": ..., \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 4, \"ConsumedQuantity\": 1.0, ...}",
Need to consider VM's that come up and down with scalesets throughout the day and what the VM names and ID's look like as they scale up and down more than once and if names/IDs can overlap.
https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview