Class ProxmoxMinimumInstances

java.lang.Object
org.jenkinsci.plugins.proxmox.ProxmoxMinimumInstances

public final class ProxmoxMinimumInstances extends Object
Keeps a per-template warm pool: provisions agents until every template with instanceMin > 0 has that many functional instances running, bounded by the template and cloud instance caps. Mirrors the EC2 plugin's MinimumInstanceChecker: every check runs serialized on a single background thread via scheduleCheck(), so callers (the periodic orphan-cleanup work, config save, startup) never block on provisioning. The retention strategy preserves the minimum by not idle-reaping below it; this class restores the count after a max-uses recycle or any other drop.
  • Method Details

    • scheduleCheck

      public static void scheduleCheck()
      Schedule a minimum-instance check to run asynchronously, so the caller returns immediately.
    • checkForMinimumInstances

      public static void checkForMinimumInstances()
      Provision toward every template's instanceMin. Synchronized as a belt-and-suspenders guard on top of the single-thread executor. Blocks while provisioning (it runs on the dedicated thread), so by the time it returns the new agents are registered and counted, which prevents the next check from over-provisioning the same deficit.
    • init

      @Initializer(after=JOB_LOADED) public static void init()
      Top up warm pools at startup (analog of the EC2 plugin's PluginImpl.postInitialize).