Support binary units (GiB/TiB) for virtual disk size display #11584

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

Originally created by @Robertas1975 on GitHub (Sep 8, 2025).

NetBox version

v4.3.7

Feature type

New functionality

Proposed functionality

NetBox should support displaying virtual disk sizes using binary units (GiB, TiB) in addition to the current decimal units (GB, TB).

Currently, disk sizes stored as MB are rendered as decimal GB values (1 GB = 1000 MB), which causes visual mismatch with most hypervisor platforms (like vCenter, Proxmox, KVM, etc.) that use binary multiples.

Requested improvements:

  • Provide a toggle or configuration option in the UI to display storage sizes using IEC units (e.g., GiB instead of GB).
  • Optionally allow API clients to indicate preferred units when posting or retrieving virtual disk size.
  • Ensure consistent user experience between what is seen in hypervisor tools (e.g., vSphere: 32 GiB) and what is displayed in NetBox (currently: 34.36 GB). It would be more convenient to see the same figures

Default behavior (SI/decimal units) can remain unchanged, but users working with infrastructure tools would benefit from alignment with binary-based units.

Use case

In vSphere (and most hypervisor platforms), virtual disk sizes are reported using binary units — e.g., GiB, MiB, KiB — where 1 GiB = 1,073,741,824 bytes. This is the technically correct digital standard, aligned with how operating systems and file systems allocate and report disk usage.

However, NetBox currently displays disk sizes in SI (decimal) units, where 1 GB = 1,000,000,000 bytes — the so-called marketing approach, commonly used by hard drive vendors to make sizes appear larger.

This difference results in misleading display values when syncing disk sizes from hypervisors. For example:

  • vSphere reports a virtual disk as 33,554,432 KiB = 32 GiB
  • Our automation converts this to 34,360 MB (decimal) before pushing to NetBox
  • NetBox displays this as 34.36 GB, which looks larger than expected

While technically accurate from a decimal perspective, this display misaligns with the numbers shown in hypervisor UIs, Linux command-line tools, and what engineers consider "real" capacity. This leads to:

  • Confusion for administrators comparing systems
  • False alarms during audits (“Why is the disk larger than expected?”)
  • Difficulty when syncing data between NetBox and infrastructure platforms

💡 NetBox positions itself as a system of record for infrastructure. As such, it should follow serious, engineering-oriented standards — not marketing math.

We propose adding an option to:

  • Display storage sizes in binary (IEC) units: KiB, MiB, GiB
  • Let users choose between decimal and binary representations, either globally or per user

This would bring NetBox in line with actual hardware/software reporting conventions and reduce misinterpretation by technical users.

Related discussion:

Database changes

No response

External dependencies

No response

Originally created by @Robertas1975 on GitHub (Sep 8, 2025). ### NetBox version v4.3.7 ### Feature type New functionality ### Proposed functionality NetBox should support displaying virtual disk sizes using **binary units (GiB, TiB)** in addition to the current **decimal units (GB, TB)**. Currently, disk sizes stored as MB are rendered as decimal GB values (1 GB = 1000 MB), which causes visual mismatch with most hypervisor platforms (like vCenter, Proxmox, KVM, etc.) that use **binary multiples**. Requested improvements: - Provide a toggle or configuration option in the UI to display storage sizes using **IEC units** (e.g., GiB instead of GB). - Optionally allow API clients to indicate preferred units when posting or retrieving virtual disk size. - Ensure consistent user experience between what is seen in hypervisor tools (e.g., vSphere: 32 GiB) and what is displayed in NetBox (currently: 34.36 GB). It would be more convenient to see the same figures Default behavior (SI/decimal units) can remain unchanged, but users working with infrastructure tools would benefit from alignment with binary-based units. ### Use case In vSphere (and most hypervisor platforms), virtual disk sizes are reported using **binary units** — e.g., GiB, MiB, KiB — where 1 GiB = 1,073,741,824 bytes. This is the **technically correct digital standard**, aligned with how operating systems and file systems allocate and report disk usage. However, NetBox currently displays disk sizes in **SI (decimal) units**, where 1 GB = 1,000,000,000 bytes — the so-called **marketing approach**, commonly used by hard drive vendors to make sizes appear larger. This difference results in misleading display values when syncing disk sizes from hypervisors. For example: - vSphere reports a virtual disk as **33,554,432 KiB** = **32 GiB** - Our automation converts this to **34,360 MB** (decimal) before pushing to NetBox - NetBox displays this as **34.36 GB**, which looks *larger than expected* While technically accurate from a **decimal perspective**, this display misaligns with the numbers shown in **hypervisor UIs**, **Linux command-line tools**, and what engineers consider "real" capacity. This leads to: - Confusion for administrators comparing systems - False alarms during audits (“Why is the disk larger than expected?”) - Difficulty when syncing data between NetBox and infrastructure platforms --- 💡 **NetBox positions itself as a system of record for infrastructure. As such, it should follow serious, engineering-oriented standards — not marketing math.** We propose adding an option to: - Display storage sizes in **binary (IEC) units**: KiB, MiB, GiB - Let users choose between **decimal** and **binary** representations, either globally or per user This would bring NetBox in line with actual hardware/software reporting conventions and reduce misinterpretation by technical users. Related discussion: - https://github.com/netbox-community/netbox/issues/8897 - https://en.wikipedia.org/wiki/Binary_prefix (why GB ≠ GiB) ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 21:47:11 +01:00
adam closed this issue 2025-12-29 21:47:11 +01:00
Author
Owner

@19rwk82 commented on GitHub (Sep 11, 2025):

You could set the parameter DISK_BASE_UNIT in the configuration.py to 1024. For your calculation example: 33,554,432 KiB / 1024 = 32,768 MiB -> this will display NetBox as 32GB in the UI. The API returns "size": 32768.

@19rwk82 commented on GitHub (Sep 11, 2025): You could set the parameter [DISK_BASE_UNIT](https://netboxlabs.com/docs/netbox/configuration/miscellaneous/#disk_base_unit) in the configuration.py to 1024. For your calculation example: 33,554,432 KiB / 1024 = 32,768 MiB -> this will display NetBox as 32GB in the UI. The API returns "size": 32768.
Author
Owner

@Robertas1975 commented on GitHub (Sep 11, 2025):

Thank you very much ! It works !

@Robertas1975 commented on GitHub (Sep 11, 2025): Thank you very much ! It works !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11584