Package com.parallels.jenkins
Class PrlDevopsPlannedNode
java.lang.Object
hudson.slaves.NodeProvisioner.PlannedNode
com.parallels.jenkins.PrlDevopsPlannedNode
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.
-
Field Summary
Fields inherited from class hudson.slaves.NodeProvisioner.PlannedNode
displayName, future, numExecutors -
Constructor Summary
ConstructorsConstructorDescriptionPrlDevopsPlannedNode(String cloudName, AgentTemplate template, String vmId, PrlDevopsApiClient apiClient, Duration timeout, Duration pollInterval, boolean startOnCreate, ExecutorService executor) -
Method Summary
Methods inherited from class hudson.slaves.NodeProvisioner.PlannedNode
spent
-
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 owningPrlDevopsCloud(stored on the agent for counting).template- TheAgentTemplateused 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 reachrunning.pollInterval- Time between polling attempts.startOnCreate- Whentruethe VM was created withstartOnCreate=trueand is already booting —startVm()must NOT be called again. Whenfalse(clone mode) the VM is stopped after cloning and must be explicitly started.executor- Thread pool on which the wait loop is executed.
-