Allow disk size to be smaller than 1GB #9041

Closed
opened 2025-12-29 20:44:40 +01:00 by adam · 6 comments
Owner

Originally created by @v0tti on GitHub (Jan 4, 2024).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.7.0

Feature type

Change to existing functionality

Proposed functionality

I would like to be able to create virtual disks with a size that is smaller than 1GB. Ideally, disk sizes could specified in MB (like memory) or decimal values could be allowed.

Use case

We operate a lot of small VMs that are just PBX appliances. These only need disks of a few MB in size. At the moment we can not model these VMs properly since the smallest disk size possible is 1GB.

Database changes

If the disk size field is changed to represent MB no change to the database is necessary, but existing data would have to be converted during migration. Alternatively, the field could be converted to a decimal field (like vCPUs).

External dependencies

No response

Originally created by @v0tti on GitHub (Jan 4, 2024). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.7.0 ### Feature type Change to existing functionality ### Proposed functionality I would like to be able to create virtual disks with a size that is smaller than 1GB. Ideally, disk sizes could specified in MB (like memory) or decimal values could be allowed. ### Use case We operate a lot of small VMs that are just PBX appliances. These only need disks of a few MB in size. At the moment we can not model these VMs properly since the smallest disk size possible is 1GB. ### Database changes If the disk size field is changed to represent MB no change to the database is necessary, but existing data would have to be converted during migration. Alternatively, the field could be converted to a decimal field (like vCPUs). ### External dependencies _No response_
adam added the status: acceptedtype: featurebreaking changecomplexity: low labels 2025-12-29 20:44:40 +01:00
adam closed this issue 2025-12-29 20:44:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2024):

Either approach, changing the atomic unit or converting the value to a decimal, would be a breaking API change. It's unfortunate that you didn't raise this suggestion during the evaluation period ahead of the v3.7 release. We could have considered the change then, but now that v3.7 has been released this would need to wait for a new minor version bump.

That said, even before the introduction of the new VirtualDisk model, the disk attribute on VirtualMachine was always measured in gigabytes, so I'm not sure how much demand there is for the proposed change.

@jeremystretch commented on GitHub (Jan 5, 2024): Either approach, changing the atomic unit or converting the value to a decimal, would be a breaking API change. It's unfortunate that you didn't raise this suggestion during the evaluation period ahead of the v3.7 release. We could have considered the change then, but now that v3.7 has been released this would need to wait for a new minor version bump. That said, even before the introduction of the new VirtualDisk model, the `disk` attribute on VirtualMachine was always measured in gigabytes, so I'm not sure how much demand there is for the proposed change.
Author
Owner

@ITJamie commented on GitHub (Jan 8, 2024):

one suggestion that could allow this usecase without it making a major breaking change.

add an extra choice field for disk_size_measurement with options of gb/mb/tb with a default of gb. that would allow people who need to use smaller measurements to select mb as the type and use the existing integer field

@ITJamie commented on GitHub (Jan 8, 2024): one suggestion that could allow this usecase without it making a major breaking change. add an extra choice field for disk_size_measurement with options of gb/mb/tb with a default of gb. that would allow people who need to use smaller measurements to select mb as the type and use the existing integer field
Author
Owner

@jose-d commented on GitHub (Jan 9, 2024):

Just noting, that small HDDs are very common for standalone EFI partitions. Checking my datastores and I see lot of ~5MB disks for EFI part. Proxmox/Qemu.

@jose-d commented on GitHub (Jan 9, 2024): Just noting, that small HDDs are very common for standalone EFI partitions. Checking my datastores and I see lot of ~5MB disks for EFI part. Proxmox/Qemu.
Author
Owner

@abrahamvegh commented on GitHub (Feb 4, 2024):

Came here to file this while, glad to see I’m not the only one, and I have an additional use case:

I use NetBox to document Linode (Akamai) VMs, amongst other things. The storage quotas there are defined in MB, so while in theory documenting a drive in GB is mostly correct, being able to document the actual MB value would be more accurate, and allowing sub-GB values would allow accurate tracking of swap disk size, which is currently impossible (most are 256/512MB).

@abrahamvegh commented on GitHub (Feb 4, 2024): Came here to file this while, glad to see I’m not the only one, and I have an additional use case: I use NetBox to document Linode (_Akamai_) VMs, amongst other things. The storage quotas there are defined in MB, so while in theory documenting a drive in GB is mostly correct, being able to document the actual MB value would be more accurate, and allowing sub-GB values would allow accurate tracking of swap disk size, which is currently impossible (most are 256/512MB).
Author
Owner

@MalfuncEddie commented on GitHub (May 29, 2024):

What would be the impact if it was just allowed to be a float number and keep the GB status.

@MalfuncEddie commented on GitHub (May 29, 2024): What would be the impact if it was just allowed to be a float number and keep the GB status.
Author
Owner

@jeremystretch commented on GitHub (May 29, 2024):

It would still be a breaking change as the data type would change.

@jeremystretch commented on GitHub (May 29, 2024): It would still be a breaking change as the data type would change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9041