Package org.jenkinsci.plugins.proxmox
Class ProxmoxAgent
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Node
hudson.model.Slave
hudson.slaves.AbstractCloudSlave
org.jenkinsci.plugins.proxmox.ProxmoxAgent
- All Implemented Interfaces:
ExtensionPoint,Describable<Node>,ModelObject,PersistenceRoot,ReconfigurableDescribable<Node>,Saveable,SearchableModelObject,SearchItem,AccessControlled,Serializable,OnMaster,org.jenkinsci.plugins.cloudstats.TrackedItem
public class ProxmoxAgent
extends AbstractCloudSlave
implements org.jenkinsci.plugins.cloudstats.TrackedItem
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.model.Slave
Slave.JnlpJar, Slave.SlaveDescriptorNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Node
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS -
Constructor Summary
ConstructorsConstructorDescriptionProxmoxAgent(String name, String remoteFs, int numExecutors, Node.Mode mode, String labelString, ProxmoxLauncher launcher, String cloudName, String templateName, String proxmoxNode, int vmId, int idleTerminationMinutes, int maxTotalUses, org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_terminate(TaskListener listener) getCloud()longorg.jenkinsci.plugins.cloudstats.ProvisioningActivity.IdgetId()The cloud-stats provisioning activity this agent belongs to, ornullif it was created before the integration (untracked).intintTemplate-level instance cap, shown read-only on the agent config page.intlongWhen this agent's computer went offline, in epoch millis, or-1if it is online or still connecting (i.e.intintgetVmId()voidbooleanisOfflineDead(long nowMs, long graceMs) Whether this agent's computer has been offline beyond the given grace window.reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) Methods inherited from class hudson.slaves.AbstractCloudSlave
terminateMethods inherited from class hudson.model.Slave
createLauncher, drainLabelsToTrim, equals, getClockDifferenceCallable, getComputer, getDescriptor, getLabelAtomSet, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, readResolve, save, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId, toStringMethods inherited from class hudson.model.Node
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getConfigFile, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getRootDir, getSearchUrl, getSelfLabel, getTemporaryOfflineCause, isAcceptingTasks, isHoldOffLaunchUntilSave, onLoad, reconfigure, toComputerMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
Constructor Details
-
ProxmoxAgent
public ProxmoxAgent(String name, String remoteFs, int numExecutors, Node.Mode mode, String labelString, ProxmoxLauncher launcher, String cloudName, String templateName, String proxmoxNode, int vmId, int idleTerminationMinutes, int maxTotalUses, org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId) throws Descriptor.FormException, IOException - Throws:
Descriptor.FormExceptionIOException
-
-
Method Details
-
createComputer
- Specified by:
createComputerin classAbstractCloudSlave
-
getId
public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()The cloud-stats provisioning activity this agent belongs to, ornullif it was created before the integration (untracked). cloud-stats correlates this id across the planned node, the node, and the computer to follow the agent through its provisioning phases.- Specified by:
getIdin interfaceorg.jenkinsci.plugins.cloudstats.TrackedItem
-
_terminate
- Specified by:
_terminatein classAbstractCloudSlave- Throws:
IOExceptionInterruptedException
-
reconfigure
public Node reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException - Specified by:
reconfigurein interfaceReconfigurableDescribable<Node>- Overrides:
reconfigurein classNode- Throws:
Descriptor.FormException
-
getCloud
-
getCloudName
-
getTemplateName
-
getProxmoxNode
-
getVmId
public int getVmId() -
getIdleTerminationMinutes
public int getIdleTerminationMinutes() -
getMaxTotalUses
public int getMaxTotalUses() -
getInstanceCap
public int getInstanceCap()Template-level instance cap, shown read-only on the agent config page. Reads through to the owning template; returns 0 (no limit) if the cloud or template no longer exists. -
getCreatedAt
public long getCreatedAt() -
getOfflineSince
public long getOfflineSince()When this agent's computer went offline, in epoch millis, or-1if it is online or still connecting (i.e. functional or mid-launch). A node with no computer yet (a phantom whose VM is gone, or one removed mid-provision) is treated as offline since it was created.Drives both the offline-with-running-VM reconcile (issue #16) and keeping dead nodes from holding instance-cap slots (issue #17): a brief blip is tolerated, an extended outage is not. The disconnect timestamp comes from the
OfflineCause; when unavailable (e.g. never connected) it falls back togetCreatedAt(). -
isOfflineDead
public boolean isOfflineDead(long nowMs, long graceMs) Whether this agent's computer has been offline beyond the given grace window. -
getTotalUses
public int getTotalUses() -
incrementUses
public void incrementUses()
-