Skip to content

vm resources: set VM use value to min value#563

Merged
boddumanohar merged 2 commits intomainfrom
set-limits-insteadofuse
Feb 3, 2026
Merged

vm resources: set VM use value to min value#563
boddumanohar merged 2 commits intomainfrom
set-limits-insteadofuse

Conversation

@boddumanohar
Copy link
Member

@boddumanohar boddumanohar commented Feb 2, 2026

lets say a VM requests 16vCPu and 65Gi of Memory,

this is what we set on the VM object

    Cpus:
      Max:             64
      Min:             500m
      Use:             16
    Memory Slot Size:  512Mi
    Memory Slots:
      Limit:  130
      Max:    256
      Min:    4
      Use:    130

For the pod to be initially schedulable, there should be atleast 16vCPU and 65Gi of memory available on the nodes. And then after the VM starts, the autoscaler will bring the allocated resources down based on the usage.

But instead, we can start the VM with minimum values and based on the VM's resource usage the autoscaler will increase the size of the VM automatically based on the usage.

@boddumanohar boddumanohar force-pushed the set-limits-insteadofuse branch from b395355 to 97b75ce Compare February 2, 2026 14:34
@noctarius
Copy link
Collaborator

Is this compatible with #566 ?

@boddumanohar
Copy link
Member Author

No, both of them solves different problems. This PR set use to min values. The other PR adjusts the memory limits.

@noctarius
Copy link
Collaborator

Compatible not "the same" :)

@boddumanohar
Copy link
Member Author

Got it. yeah I guess they are compatible.

Copy link
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this correctly, this initially sets use to min instead of desired, and introduces setting the limit for CPU resources as well, right?

I agree with both changes, for resizing though I don't think we should touch use. The VM is already running and settled at whatever value is appropriate. If it needs to scale down due to the lower limit it'll do that on its own, no need to interrupt the process by bringing it to the bare minimum. Though I suspect the use-value wouldn't even be applied in that case, but still.

@boddumanohar
Copy link
Member Author

Good catch, yeah during resize, we don't need to set use during resize. Just setting the limit would be sufficient.

@boddumanohar boddumanohar requested a review from mxsrc February 2, 2026 15:03
@boddumanohar boddumanohar merged commit ef8de94 into main Feb 3, 2026
5 checks passed
@boddumanohar boddumanohar deleted the set-limits-insteadofuse branch February 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants