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

[RFC] How to handle Resource Quota assignment at host registration #53

Open
bastian-src opened this issue May 8, 2024 · 2 comments
Open

Comments

@bastian-src
Copy link
Contributor

Problem

When registering a new host using the host registration form, a new host is created in the database. One validation step during the host creation is the assignment of a resource quota. It fails, if no resource quota is assigned to the new host.

Such assignment cannot be performed when using the host registration.

Possible Solutions

A: Make the resource quota assignment optional in the global settings (Resource quota optional assignment).

B: Implement a default quota. A default quota can be set for a user which is used automatically if none was given.

C: Identify that this host is being registered using the host registration form and make this bypass the validation (→ it is ok to assign no quota if a host is registered using the host registration form)

A can already be used as of now. B and C must be implemented.

@maximiliankolb
Copy link
Contributor

Hey Bastian,

  • As an admin of Foreman/a hypervisor such as Proxmox, I would not care if someone registers an existing VM to Foreman for content management and configuration management. They would not use additional resources that they didn't consume in the first place. > No need to perform any checks.
  • From a "Foreman as self service" perspective, there should not be any "normal" resource quota on CPU/GPU/memory/disk space if I bring my own VM/ bare metal machine. > No validation by foreman_resource_quote when using "Register Host" is a feature, not a bug in my eyes.

My question: what happens if I edit a VM? Is there a validation when I click "submit"? Could I cheat by registering my existing small VM and then rebuild it to something bigger?

Can you somehow store/differentiate between resources someone consumes and resources they bring by registering an existing host?

@bastian-src
Copy link
Contributor Author

Thanks for your comment!

Can you somehow store/differentiate between resources someone consumes and resources they bring by registering an existing host?

I gotta check whether such differentiation (a Foreman-deployed host vs an externally registered one) is already done within Foreman. If that's the case, I can easily disregard registered hosts from the resource quota check.

My question: what happens if I edit a VM? Is there a validation when I click "submit"? Could I cheat by registering my existing small VM and then rebuild it to something bigger?

The validation is also executed when editing a host. So, currently such a cheat would not be possible.
But, if implementing the first and when a hosts stays "externally registered" even after editing it, such cheat would be made possible.

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

No branches or pull requests

2 participants