Class PrlDevopsPlannedNode

java.lang.Object
hudson.slaves.NodeProvisioner.PlannedNode
com.parallels.jenkins.PrlDevopsPlannedNode

public class PrlDevopsPlannedNode extends NodeProvisioner.PlannedNode
A NodeProvisioner.PlannedNode that asynchronously waits for a cloned VM to reach the running state before registering it as a Jenkins agent.

The underlying Future is submitted to the provided ExecutorService (typically hudson.model.Computer.threadPoolForRemoting) so that the ready-wait loop never blocks the calling (provisioner) thread.

On success the future returns a fully constructed PrlDevopsAgent. On timeout or API error the future logs the failure, requests deletion of the orphaned VM, and re-throws so Jenkins cancels the planned node.

  • Constructor Details

    • PrlDevopsPlannedNode

      public PrlDevopsPlannedNode(String cloudName, AgentTemplate template, String vmId, PrlDevopsApiClient apiClient, Duration timeout, Duration pollInterval, boolean startOnCreate, ExecutorService executor)
      Parameters:
      cloudName - Name of the owning PrlDevopsCloud (stored on the agent for counting).
      template - The AgentTemplate used to clone this VM.
      vmId - ID of the newly cloned VM returned by the API.
      apiClient - API client used to poll status and clean up on failure.
      timeout - Maximum time to wait for the VM to reach running.
      pollInterval - Time between polling attempts.
      startOnCreate - When true the VM was created with startOnCreate=true and is already booting — startVm() must NOT be called again. When false (clone mode) the VM is stopped after cloning and must be explicitly started.
      executor - Thread pool on which the wait loop is executed.