Allow float value for VM cpu #4658

Closed
opened 2025-12-29 19:19:14 +01:00 by adam · 7 comments
Owner

Originally created by @maximebrun on GitHub (Mar 13, 2021).

NetBox version

v2.9.11

Feature type

Data model extension

Proposed functionality

Allow to set cpu in float format for virtual machine.

Use case

We use virtual machine and set cpu less than 1. For example, 0.5.

Database changes

Change PositiveSmallIntegerField to DecimalField for vcpus in VirtualMachine model.

External dependencies

Unknown

Originally created by @maximebrun on GitHub (Mar 13, 2021). ### NetBox version v2.9.11 ### Feature type Data model extension ### Proposed functionality Allow to set cpu in float format for virtual machine. ### Use case We use virtual machine and set cpu less than 1. For example, 0.5. ### Database changes Change PositiveSmallIntegerField to DecimalField for vcpus in VirtualMachine model. ### External dependencies Unknown
adam added the status: acceptedtype: feature labels 2025-12-29 19:19:14 +01:00
adam closed this issue 2025-12-29 19:19:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 16, 2021):

Tagging this for v2.11 since we're changing the field type from integer to float.

Does it make sense to limit this value to a particular granularity (e.g. 0.5)?

@jeremystretch commented on GitHub (Mar 16, 2021): Tagging this for v2.11 since we're changing the field type from integer to float. Does it make sense to limit this value to a particular granularity (e.g. 0.5)?
Author
Owner

@ypid commented on GitHub (Apr 24, 2021):

@maximebrun

Can you give a reference which Hypervisor software allows this setting? I have not seen this before.

@ypid commented on GitHub (Apr 24, 2021): @maximebrun Can you give a reference which Hypervisor software allows this setting? I have not seen this before.
Author
Owner

@jogulin commented on GitHub (May 24, 2021):

@maximebrun

I cannot find a reference to a hypervisor configuration that permits fractional assignments. Virtual CPUs must be assigned as integer values. VMware is a drop-down. KVM is also an integer assignment. Please provide a reference as to why this change was included. The closest thing I can find is a weight limit for Hyper-V, but you are still assigning whole integer values as the number of vCPUs. You are just limiting how much of the physical CPUs the vCPUs can consume. That is not the same as assigning half of a vCPU.

@jogulin commented on GitHub (May 24, 2021): @maximebrun I cannot find a reference to a hypervisor configuration that permits fractional assignments. Virtual CPUs must be assigned as integer values. VMware is a drop-down. KVM is also an integer assignment. Please provide a reference as to why this change was included. The closest thing I can find is a weight limit for Hyper-V, but you are still assigning whole integer values as the number of vCPUs. You are just limiting how much of the physical CPUs the vCPUs can consume. That is not the same as assigning half of a vCPU.
Author
Owner

@ziggekatten commented on GitHub (May 24, 2021):

AIX LPARs can do this in 0.25 chunks.

@ziggekatten commented on GitHub (May 24, 2021): AIX LPARs can do this in 0.25 chunks.
Author
Owner

@maximebrun commented on GitHub (Jun 16, 2021):

@maximebrun

I cannot find a reference to a hypervisor configuration that permits fractional assignments. Virtual CPUs must be assigned as integer values. VMware is a drop-down. KVM is also an integer assignment. Please provide a reference as to why this change was included. The closest thing I can find is a weight limit for Hyper-V, but you are still assigning whole integer values as the number of vCPUs. You are just limiting how much of the physical CPUs the vCPUs can consume. That is not the same as assigning half of a vCPU.

Sorry for late answer, i missed notifications...

Perhaps we didn't use this field in the same manner. I use it to set the hypervisor cpu reserved for the vm, not the number of cpu the vm see (vcpu).

I am using OpenNebula/KVM.

@maximebrun commented on GitHub (Jun 16, 2021): > @maximebrun > > I cannot find a reference to a hypervisor configuration that permits fractional assignments. Virtual CPUs must be assigned as integer values. VMware is a drop-down. KVM is also an integer assignment. Please provide a reference as to why this change was included. The closest thing I can find is a weight limit for Hyper-V, but you are still assigning whole integer values as the number of vCPUs. You are just limiting how much of the physical CPUs the vCPUs can consume. That is not the same as assigning half of a vCPU. Sorry for late answer, i missed notifications... Perhaps we didn't use this field in the same manner. I use it to set the hypervisor cpu reserved for the vm, not the number of cpu the vm see (vcpu). I am using OpenNebula/KVM.
Author
Owner

@jogulin commented on GitHub (Jun 16, 2021):

AIX LPARs can do this in 0.25 chunks.

People still use AIX? :)

Sorry for late answer, i missed notifications...

Perhaps we didn't use this field in the same manner. I use it to set the hypervisor cpu reserved for the vm, not the number of cpu the vm see (vcpu).

I am using OpenNebula/KVM.

I thought it was how many virtual CPUs were assigned to the VM itself, or at least that's how we have been using it. We are migrating away from KVM ingeneral but still have some of it sitting around, and are primarily using VMware now. In both cases we have it reflect the number of CPUs the VM will show when you sign into the guest OS, not the number of physical CPUs reserved for the VM.

@jogulin commented on GitHub (Jun 16, 2021): > AIX LPARs can do this in 0.25 chunks. People still use AIX? :) > Sorry for late answer, i missed notifications... > > Perhaps we didn't use this field in the same manner. I use it to set the hypervisor cpu reserved for the vm, not the number of cpu the vm see (vcpu). > > I am using OpenNebula/KVM. I thought it was how many virtual CPUs were assigned to the VM itself, or at least that's how we have been using it. We are migrating away from KVM ingeneral but still have some of it sitting around, and are primarily using VMware now. In both cases we have it reflect the number of CPUs the VM will show when you sign into the guest OS, not the number of physical CPUs reserved for the VM.
Author
Owner

@ziggekatten commented on GitHub (Jun 16, 2021):

Hey, AIX is still king:-)

Linux is good but those of us that want pure performance still use good ol' blue Power systems.

:-)

Joke aside, some AIX features from before year 2000 is still better than Linux counterparts today. LVM is one of those, even if Linux is almost at par with AIX (thanks to IBM).

So, you are allowed to joke about us that knows better :-)

@ziggekatten commented on GitHub (Jun 16, 2021): Hey, AIX is still king:-) Linux is good but those of us that want pure performance still use good ol' blue Power systems. :-) Joke aside, some AIX features from before year 2000 is still better than Linux counterparts today. LVM is one of those, even if Linux is *almost* at par with AIX (thanks to IBM). So, you are allowed to joke about us that knows better :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4658