Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38899

ForemanSharedNodeCloud.provision(Label) has to iterate over the whole collection

XMLWordPrintable

      Current impl. tries to find the first complying node, if found, tries to reserve it and then provisions it. If reservation failed it ended with "No Foreman resources available...". That's simply wrong, it has to iterate over the whole collection of slaves and failed in such state only at the end when nothing usable found.

      I think it isn't a bad practice to obtain the whole collection of free nodes at the time (so not to make a request for every node separately) like:

      curl -k -u admin:changeme  -H "Content-Type:application/json" -H "Accept:application/json"  'http://10.8.48.62:32768/api/v2/hosts?search=params.RESERVED=false'

      and iterate through this collection and tries to find matches label(s) (including a label expression!). This can improve the throughput significantly.

            pajasoft Pavel Janoušek
            pajasoft Pavel Janoušek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: