netbox
netbox copied to clipboard
15873 - Make Cluster resource counters more readable
Fixes: #15873
One method was created to normalize the VM's disk and memory sizes according to their units. That method is applied when the "Allocated Resources" is generated.
I was analyzing it, and there is no point in trying to convert and predict any incorrect input from the customer. The "memory" field in the VM is already informed that the value must be in MB, so if the client enters, for example, the value "68000" for one VM and "64" for another, the result of the sum will be "68064 ", but this is not Netbox's "fault", but rather the incorrect input.
I think we should talk about it.
I changed "humanize_megabytes" to convert non-divisible values to 1024 in this commit and reverted all previous changes.
@arthanson I'll leave to this to you for review.
@arthanson, should we also do the same for the disk?
actually never-mind about the disk, there is a 4.1 issue #14692 where we need to change the data-field anyways, so will do it there.