jenkinsci / openstack-cloud-plugin

Provision nodes from OpenStack on demand
https://plugins.jenkins.io/openstack-cloud
MIT License
47 stars 83 forks source link

Pick random temaplate to provision in case several matches the label #50

Open olivergondza opened 8 years ago

olivergondza commented 8 years ago

In case the first matching template got misconfigured (unable to provision, snapshot not working, etc.), plugin keeps picking it for further provisioning. It would be better to pick one at random if more matches the label to avoid it. Additional advantage is it will constantly test all other templates for early problem discovery.

olivergondza commented 8 years ago

This can, however, cause problems to people that for some reason do not want to provision one of the latter templates unless necessary. Consider job that can run everywhere will pick a template that takes several times longer to provision, uses more resources, will use limited number of licences, etc. An alternative can be to detect one template have a poor provisioning success record and move on to a more stable.

olivergondza commented 8 years ago

We can implement better heuristics once https://github.com/jenkinsci/cloud-stats-plugin gets ready.

basovnik commented 8 years ago

Hi, I think that the list of templates should be ordered (templates with less resources are first) and plugin should use first matching template. If the provisioning fails then plugin can continue to next template in ordered list. It can safe some resources.