Class 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:
  • Constructor Details

  • Method Details

    • createComputer

      public AbstractCloudComputer<?> createComputer()
      Specified by:
      createComputer in class AbstractCloudSlave
    • getId

      public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()
      The cloud-stats provisioning activity this agent belongs to, or null if 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:
      getId in interface org.jenkinsci.plugins.cloudstats.TrackedItem
    • _terminate

      protected void _terminate(TaskListener listener) throws IOException, InterruptedException
      Specified by:
      _terminate in class AbstractCloudSlave
      Throws:
      IOException
      InterruptedException
    • reconfigure

      public Node reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException
      Specified by:
      reconfigure in interface ReconfigurableDescribable<Node>
      Overrides:
      reconfigure in class Node
      Throws:
      Descriptor.FormException
    • getCloud

      public ProxmoxCloud getCloud()
    • getCloudName

      public String getCloudName()
    • getTemplateName

      public String getTemplateName()
    • getProxmoxNode

      public String 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 -1 if 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 to getCreatedAt().

    • 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()