Wrong unit for memory size (MB/GB instead of MiB/GiB) #10488

Closed
opened 2025-12-29 21:32:10 +01:00 by adam · 2 comments
Owner

Originally created by @PhilKet on GitHub (Nov 18, 2024).

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.6

Python Version

3.12

Steps to Reproduce

Set memory value of Virtual Machine

Expected Behavior

Display memory size correctly (in MiB/GiB)

Observed Behavior

The memory size is displayed in GB and therefore is badly displayed, e.g.:
8192 MB is displayed as 8.19 GB
instead of:
8192 MiB displaying as 8GiB

Originally created by @PhilKet on GitHub (Nov 18, 2024). ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.6 ### Python Version 3.12 ### Steps to Reproduce Set memory value of Virtual Machine ### Expected Behavior Display memory size correctly (in MiB/GiB) ### Observed Behavior The memory size is displayed in GB and therefore is badly displayed, e.g.: 8192 MB is displayed as 8.19 GB instead of: 8192 MiB displaying as 8GiB
adam added the status: duplicate label 2025-12-29 21:32:10 +01:00
adam closed this issue 2025-12-29 21:32:10 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 18, 2024):

This has already been discussed in previous issues. Please remember to search prior issues before submitting a new one.

@jeremystretch commented on GitHub (Nov 18, 2024): This has already been discussed in previous issues. Please remember to search prior issues before submitting a new one.
Author
Owner

@PhilKet commented on GitHub (Nov 18, 2024):

@jeremystretch, I did do a search beforehand and in fact, I opened this issue because #16770 was closed without a real solution in my opinion. As I already explained in several comments in that issue, starting after v4.0 of Netbox, memory sizes get displayed in the wrong units. I think the decision to correctly use a power of 1000 with the corresponding unit MB/GB, opposed to using a power of 1024 but displaying units as MB/GB like before, was right for disk sizes. This doesn’t apply to memory sizes however! As a consequence of the physical functionality, memory only comes in powers of 1024. Still using MB/GB as base for the calculation, leaves me with completely useless GB values that I can’t work with, as described above.
In order to solve this, I could imagine something along the lines of this proposed feature, that sadly never implemented. I imagine, it wouldn’t be that difficult, to make this a configurable option (maybe globally) and set the default to the current behaviour for backwards compatibility

@PhilKet commented on GitHub (Nov 18, 2024): @jeremystretch, I did do a search beforehand and in fact, I opened this issue because #16770 was closed without a real solution in my opinion. As I already explained in several [comments](https://github.com/netbox-community/netbox/issues/16770#issuecomment-2298778526) in that issue, starting after v4.0 of Netbox, memory sizes get displayed in the wrong units. I think the decision to correctly use a power of 1000 with the corresponding unit MB/GB, opposed to using a power of 1024 but displaying units as MB/GB like before, was right for disk sizes. This doesn’t apply to memory sizes however! As a consequence of the physical functionality, memory only comes in powers of 1024. Still using MB/GB as base for the calculation, leaves me with completely useless GB values that I can’t work with, as described above. In order to solve this, I could imagine something along the lines of this proposed feature, that sadly never implemented. I imagine, it wouldn’t be that difficult, to make this a configurable option (maybe globally) and set the default to the current behaviour for backwards compatibility
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10488