Closed knikolla closed 5 months ago
Just to make sure I understand: effectively with this change we're no longer billing based on flavors; we're billing on the cpu/memory/etc requests made by each specific instance (which may or may not correspond to an existing flavor).
Assuming I'm correct, that seems reasonable.
Correct. Flavors were an unreliable source of that information as they got deleted often leaving no traces behind as to what they might originally have been - this was especially tricky because GPU SUs were detected based on flavor name. The instance information is a much more reliable source of that same information.
The information related to which GPU is in use by an instance is available in the
pci_requests
column of theinstance_extra
table.For example:
pci_info[0]["alias_name"]
frominstance_extra.pci_requests
contains the GPU name if the instance has one.pci_info[0]["count"]
contains the GPU count.If no PCI information the instance is assumed as CPU SU.
All flavors are 20GB, so that is hardcoded for the moment, and root disk storage is not to be taken into account for calculations of invoicing.
It is therefore unnecessary to fetch any flavor information and invoicing can be performed directly on the instance information.
I have compared the values of January's billing values before and after the change and they are the same.
With all the information now being fetched from the instance, we don't need to persist flavor information anymore between runs nor fetch flavor information from the nova_api database.