Skip to content
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

Limit host resources via Hammer CLI #3575

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maximiliankolb
Copy link
Contributor

What changes are you introducing?

  • Add command to install Hammer CLI plugin for foreman_resource_quota
  • Use Hammer CLI to assign resource quotes to users
  • Use Hammer CLI to manage resource quotas

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

no cherry-picks: only foreman_resource_quota is part of 3.13; the Hammer CLI plugin is not available in nightly.

@maximiliankolb maximiliankolb added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective and removed Not yet reviewed labels Jan 16, 2025
$ hammer user update \
--id _My_User_ID_ \
--resource-quota-ids _My_Resource_Quota_IDs_ \
--resource-quota-is-optional _[true|false]_
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would you accept this? Is there a more idiomatic way of saying "either this or that, but not both or none"?

Copy link
Member

Choose a reason for hiding this comment

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

How about choosing one and making clear that it's an example? Like this:

"Assign resource quotas to a user. For example, to [...] while making resource quotas optional:
[...]
$ hammer user update [...] --reqource-quota-is-optional true"

And then you already refer users to --help, which gives them a clear signal where to go for all the other details.

@maximiliankolb maximiliankolb force-pushed the foreman_resource_quota_hammer_cli branch from 05b6053 to 570ebdf Compare January 17, 2025 13:51
* Add command to install Hammer CLI plugin for foreman_resource_quota
* Use Hammer CLI to assign resource quotes to users
* Use Hammer CLI to manage resource quotas

Refs PR 7 in hammer-cli-foreman-resource-quota on GitHub
Refs PR 97 in foreman_resource_quota on GitHub
Refs https://github.com/ATIX-AG/hammer-cli-foreman-resource-quota/
@maximiliankolb maximiliankolb force-pushed the foreman_resource_quota_hammer_cli branch from 570ebdf to b95fd30 Compare January 20, 2025 11:07
----
+
If you set the value to `0`, users cannot consume any resource at all.
To reset resource quotas, you can use `--remove-cpu-cores-limit`, `--remove-disk-space-limit`, and `--remove-memory-limit`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

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

Looks good to me overally. I just have a concern regarding the units...

--cpu-cores _My_CPU_Cores_ \
--disk-space _My_Disk_Space_in_GiB_ \
--id _My_Resource_Quota_ID_ \
--memory _My_Memory_in_MiB_ \
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you absolutely sure that the unit is MebiBytes (MiB) and not MegaBytes (MB)? Those are different units. And Mi- Gi- aren't usually used. 🤷‍♀️

The same for the GiB above and other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs style review Requires a review from docs style/grammar perspective Needs tech review Requires a review from the technical perspective
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants