Change VM resource memory from MB to GB #7308

Closed
opened 2025-12-29 20:21:35 +01:00 by adam · 9 comments
Owner

Originally created by @ghost on GitHub (Dec 1, 2022).

NetBox version

v3.3.8

Feature type

Change to existing functionality

Proposed functionality

When creating a new virtual machine in Netbox you are asked to assign vCPU, memory, and storage resources for the virtual machine. Storage is inputted as GB, but memory is inputted as MB.
After VM creation the resources for Memory are display as GB anyway, so it would be easier to just input 4 (GB) instead of 4096.

Use case

By inputting MB for VM memory you have to remember 4096 for 4GB, 8192 for 8GB, etc.
It would be easier to just input the GB value of memory for the virtual machine. NetBox converts and displays this figure as GB anyway after the VM is created, so why not just input it as GB in the first place?

Database changes

None

External dependencies

None

Originally created by @ghost on GitHub (Dec 1, 2022). ### NetBox version v3.3.8 ### Feature type Change to existing functionality ### Proposed functionality When creating a new virtual machine in Netbox you are asked to assign vCPU, memory, and storage resources for the virtual machine. Storage is inputted as GB, but memory is inputted as MB. After VM creation the resources for Memory are display as GB anyway, so it would be easier to just input 4 (GB) instead of 4096. ### Use case By inputting MB for VM memory you have to remember 4096 for 4GB, 8192 for 8GB, etc. It would be easier to just input the GB value of memory for the virtual machine. NetBox converts and displays this figure as GB anyway after the VM is created, so why not just input it as GB in the first place? ### Database changes None ### External dependencies None
adam added the type: feature label 2025-12-29 20:21:35 +01:00
adam closed this issue 2025-12-29 20:21:35 +01:00
Author
Owner

@abhi1693 commented on GitHub (Dec 1, 2022):

I have not yet looked at the model for memory but it'll have to accept a floating integer if this changes. Because I have VMs which have been allocated 256 MB RAM in some cases.

@abhi1693 commented on GitHub (Dec 1, 2022): I have not yet looked at the model for memory but it'll have to accept a floating integer if this changes. Because I have VMs which have been allocated 256 MB RAM in some cases.
Author
Owner

@ghost commented on GitHub (Dec 1, 2022):

So no offense intended, but come on. It's almost 2023. Ram is so cheap why do VM's only need 256mb of ram?
Can't we just make the minimum amount of RAM 1GB?
I feel like allocating less than 1GB of ram to a virtual machine is an extreme edge case.

@ghost commented on GitHub (Dec 1, 2022): So no offense intended, but come on. It's almost 2023. Ram is so cheap why do VM's only need 256mb of ram? Can't we just make the minimum amount of RAM 1GB? I feel like allocating less than 1GB of ram to a virtual machine is an extreme edge case.
Author
Owner

@abhi1693 commented on GitHub (Dec 1, 2022):

A Mikrotik Cloud router (even in 2023) only requires 256 MB of memory. You can check their website for more details. Even with an edge case, it should still provide backward compatibility not to break someone's setup. Showing a VM with 1 GB memory that can only consume 256 MB does not represent the real-world model which NetBox is all about.

Also, cheap memory has nothing to do with my request.

@abhi1693 commented on GitHub (Dec 1, 2022): A Mikrotik Cloud router (even in 2023) only requires 256 MB of memory. You can check their website for more details. Even with an edge case, it should still provide backward compatibility not to break someone's setup. Showing a VM with 1 GB memory that can only consume 256 MB does not represent the real-world model which NetBox is all about. Also, cheap memory has nothing to do with my request.
Author
Owner

@ghost commented on GitHub (Dec 1, 2022):

Then a floating integer is likely best. Allows you to specify 0.25 GB.
Perhaps if the number is less than 1GB it would translate that to 256MB like it does currently, when viewing the VM resource.

@ghost commented on GitHub (Dec 1, 2022): Then a floating integer is likely best. Allows you to specify 0.25 GB. Perhaps if the number is less than 1GB it would translate that to 256MB like it does currently, when viewing the VM resource.
Author
Owner

@jeremystretch commented on GitHub (Dec 1, 2022):

NetBox converts and displays this figure as GB anyway after the VM is created, so why not just input it as GB in the first place?

NetBox uses megabytes as the atomic unit for VM memory. Values are displayed in GB/TB only where exactly conforming values are used.

Then a floating integer is likely best. Allows you to specify 0.25 GB.

So instead of requiring the user to always specify a whole number of one unit, you want to require that they sometimes specify a partial number of a different unit? I don't see any reason to make this change.

@jeremystretch commented on GitHub (Dec 1, 2022): > NetBox converts and displays this figure as GB anyway after the VM is created, so why not just input it as GB in the first place? NetBox uses megabytes as the atomic unit for VM memory. Values are displayed in GB/TB only where exactly conforming values are used. > Then a floating integer is likely best. Allows you to specify 0.25 GB. So instead of requiring the user to always specify a whole number of one unit, you want to require that they sometimes specify a partial number of a different unit? I don't see any reason to make this change.
Author
Owner

@ghost commented on GitHub (Dec 1, 2022):

The fractional numbers are only necessary when the number is less than 1.
You don't have 1.5 GB of memory, you have 1GB or 2GB.

The reason for the change is consistency. You have storage as GB but RAM as MB.
The user must remember 1024 = 1, 2048 = 2, 4096 = 4 and so on and so forth. I would counter that requiring users to memorize binary values for 32gb, 64gb, 128gb, etc. is far greater than the edge cases of someone having less than 1GB of memory and putting in 0.25, 0.5.

@ghost commented on GitHub (Dec 1, 2022): The fractional numbers are only necessary when the number is less than 1. You don't have 1.5 GB of memory, you have 1GB or 2GB. The reason for the change is consistency. You have storage as GB but RAM as MB. The user must remember 1024 = 1, 2048 = 2, 4096 = 4 and so on and so forth. I would counter that requiring users to memorize binary values for 32gb, 64gb, 128gb, etc. is far greater than the edge cases of someone having less than 1GB of memory and putting in 0.25, 0.5.
Author
Owner

@jeremystretch commented on GitHub (Dec 1, 2022):

You don't have 1.5 GB of memory, you have 1GB or 2GB.

I can absolutely have a VM with 1.5GB of memory.

@jeremystretch commented on GitHub (Dec 1, 2022): > You don't have 1.5 GB of memory, you have 1GB or 2GB. I can absolutely have a VM with 1.5GB of memory.
Author
Owner

@ThomasADavis commented on GitHub (Dec 1, 2022):

oVirt (a VM manager) ansible modules looks for the VM size to be specified in MB. This would mean I'd have to convert from GB to MB, and deal with fractions in my automations and check to see what version of netbox the automation is working against.

@ThomasADavis commented on GitHub (Dec 1, 2022): oVirt (a VM manager) ansible modules looks for the VM size to be specified in MB. This would mean I'd have to convert from GB to MB, and deal with fractions in my automations and check to see what version of netbox the automation is working against.
Author
Owner

@ghost commented on GitHub (Dec 1, 2022):

Guess it's just me that wants this :D

@ghost commented on GitHub (Dec 1, 2022): Guess it's just me that wants this :D
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7308