Class NoDelayProvisionerStrategy

java.lang.Object
hudson.slaves.NodeProvisioner.Strategy
io.jenkins.plugins.kubevirt.NoDelayProvisionerStrategy
All Implemented Interfaces:
ExtensionPoint

@Extension(ordinal=100.0) public class NoDelayProvisionerStrategy extends NodeProvisioner.Strategy
Implements instant provisioning for KubeVirt cloud agents.

By default, Jenkins' NodeProvisioner runs on a periodic timer with dampening heuristics that delay provisioning. This strategy bypasses those delays by:

  1. Running at high priority (ordinal=100), before the default strategy.
  2. Provisioning the exact number of agents needed immediately.
  3. Returning PROVISIONING_COMPLETED to skip the default strategy entirely.

While KubeVirt VMs take longer to boot than containers, we still want to start provisioning immediately. The delay eliminated here is between "build enters queue" and "provisioning is triggered", not the VM boot time itself.

This works in tandem with the NoDelayProvisionerStrategy.FastProvisioning queue listener (inner class), which wakes up the NodeProvisioner the instant a buildable item enters the queue, converting Jenkins' periodic polling model into an event-driven one.

Can be disabled via system property at JVM startup:

-Dio.jenkins.plugins.kubevirt.disableNoDelayProvisioning=true

or at runtime in the script console (no restart):

io.jenkins.plugins.kubevirt.NoDelayProvisionerStrategy.DISABLE_NO_DELAY = true

When several KubeVirtCloud instances are configured, this strategy visits them in round-robin order (see plugin README). Rotation can be disabled to always use Jenkins cloud list order:

-DNoDelayProvisionerStrategy.disableCloudRotation=true

or NoDelayProvisionerStrategy.DISABLE_CLOUD_ROTATION = true in the script console. The legacy property NoDelayProvisionerStrategy.disableCloudShuffle is still honored.