-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌱 Defaults for ConfigSpec CPU/mem alloc #902
base: main
Are you sure you want to change the base?
Conversation
This patch ensures there are defaults for the ConfigSpec CPU/mem allocation fields for limits and shares. The documentation for a ResourceAllocation object states that all (VM) fields must be set for certain APIs, including ImportVApp. A part of that API is used by the vpxd placement engine to construct fake VMs in order to support assignable hardware. Therefore: CPU allocation: - Ensure limit is set to -1 if there is a reservation. Memory allocation: - Ensure shares is not nil. - Ensure limit is set to -1 if there is a reservation.
Minimum allowed line rate is |
// Memory allocation: | ||
// - Ensure shares is not nil. | ||
// - Ensure limit is set to -1 if there is a reservation. | ||
if a := configSpec.CpuAllocation; a != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make more sense to have these as a final } else {
clause in the CPU or memory blocks above, since we're otherwise kind of spreading our defaulting logic out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way it handles it no matter how they started. That was intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment but otherwise gtg
What does this PR do, and why is it needed?
This patch ensures there are defaults for the ConfigSpec CPU/mem allocation fields for limits and shares.
The documentation for a ResourceAllocation object states that all (VM) fields must be set for certain APIs, including ImportVApp. A part of that API is used by the vpxd placement engine to construct fake VMs in order to support assignable hardware. Therefore:
CPU allocation:
Memory allocation:
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes
NA
Are there any special notes for your reviewer:
Please add a release note if necessary: