netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow disk size to be smaller than 1GB

Open v0tti opened this issue 1 year ago • 4 comments

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

v0tti avatar Jan 04 '24 12:01 v0tti

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 avatar Jan 05 '24 16:01 jeremystretch

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 avatar Jan 08 '24 18:01 ITJamie

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 avatar Jan 09 '24 10:01 jose-d

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 avatar Feb 04 '24 15:02 abrahamvegh

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

MalfuncEddie avatar May 29 '24 07:05 MalfuncEddie

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

jeremystretch avatar May 29 '24 11:05 jeremystretch