Class JCloudsPreCreationThread

All Implemented Interfaces:
ExtensionPoint, Runnable

@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class JCloudsPreCreationThread extends AsyncPeriodicWork
Periodically ensure enough slaves are created. The goal of this class is to pre-provision slaves ahead of time to avoid jobs having to wait until a slave gets provisioned to run. It works in conjunction with the logic in JCloudsRetentionStrategy to not only pre-provision slaves but also keep the slaves around to meet requirements. The behaviour is configured via the `instanceMin` setting which controls how many instances per-template will be pre-provisioned. A template's retention time of 0 (zero) will be interpreted as a sign that used instances shouldn't be re-used and thus new instances will be pre-provisioned, even if used instances are running. The pre-provisioning always respects the instance capacity (either global or per template).