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

[RFE] Reset cloud allocation API #561

Open
josecastillolema opened this issue Jan 7, 2025 · 3 comments
Open

[RFE] Reset cloud allocation API #561

josecastillolema opened this issue Jan 7, 2025 · 3 comments

Comments

@josecastillolema
Copy link

Is your feature request related to a problem? Please describe.
The feature request is related to CI usage. Most of our tooling (jetlag, jetski) assumes a clean deployment as a pre-requisite.

Describe the solution you'd like
A reset allocation API that will:

  • Reset the nodes (foreman deploy them)
  • Allow to optionally skip the bastion (first host of the allocation)
  • Maintains the same cloud allocation number

Describe alternatives you've considered
Manually hammer host update all of the nodes of the allocation

@sadsfae
Copy link
Member

sadsfae commented Jan 7, 2025

Hi @josecastillolema I think all of this is already covered by additional processes or not in scope.

Reset the nodes (foreman deploy them)

You should just use Foreman to do this, a self-scheduled environment is the exact same functionally as a deliberately scheduled one and this isn't really in scope of the API. Foreman is a third-party complete platform where those actions are better handled there.

Allow to optionally skip the bastion (first host of the allocation)

Just re-provision via Foreman and skip this node. We would have no way of knowing what you chose to use as your bastion node anyway.

Maintains the same cloud allocation number

You will keep your environment name, cloud # and everything.

I think this RFE isn't in scope for being managed by QUADS. We do have a Forman library but we do not want to try to operate Foreman from QUADS.

@sadsfae
Copy link
Member

sadsfae commented Jan 7, 2025

@josecastillolema add here, we will be providing an RFE shortly to allow you to choose your OS so that may let you skip having to re-provision if you were just doing this to get a newer OS than the lab default, so long as that operating system is present in that QUADS Foreman. This would be an API option for self-scheduling.

#474

(WIP patchset)
https://review.gerrithub.io/c/redhat-performance/quads/+/1206450

@grafuls
Copy link
Contributor

grafuls commented Jan 7, 2025

You can achieve this via the foreman REST api like this:

  1. Get the host id:
    curl -X GET -s -k -u admin:pass https://foreman.example.com/api/hosts?search=name=host1.example.com | jq .results[0].id
  2. Put the build parameter passing the host id, from previous step, onto the endpoint:
    curl -X PUT -s -k -u admin:pass -H "content-type: application/json" -d '{"host": {"build": 1}}' https://foreman.example.com/api/hosts/36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants