Class HostLimits
java.lang.Object
org.jenkinsci.plugins.vsphere.tools.HostLimits
Minimal amounts of free resources a host must have right now to be a candidate for a new VM
at all (see
VSphereHostSelection.limitShortfall(org.jenkinsci.plugins.vsphere.tools.VSphereHostSelection.HostCandidate, org.jenkinsci.plugins.vsphere.tools.HostLimits)), as opposed to HostWeights, which
only decide which of the candidates is preferred. A host with less than the limit is kept off the
list, however attractive it would otherwise be.
Each limit is a floor; zero (the default) switches it off, since no host has less than none free. The absolute ones (MHz, MB) suit farms of similar hosts, the relative ones (percent of the host's own capacity) suit mixed farms; all four may be combined, and a host must then satisfy every one set.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHostLimits(long minFreeCpuMhz, int minFreeCpuPercent, long minFreeMemoryMB, int minFreeMemoryPercent) -
Method Summary
Modifier and TypeMethodDescriptionlongintlongintbooleanisActive()True if at least one limit is set.static HostLimitsparseOverride(String minFreeCpuMhz, String minFreeCpuPercent, String minFreeMemoryMB, String minFreeMemoryPercent) Builds the limits a single call (build step or template) sets for itself from the text of its four settings, already variable-expanded.shortfall(VSphereHostSelection.HostCandidate candidate) Why this host is below the limits, or null if it satisfies all of them.toString()
-
Field Details
-
NONE
All zero: no limits.
-
-
Constructor Details
-
HostLimits
public HostLimits(long minFreeCpuMhz, int minFreeCpuPercent, long minFreeMemoryMB, int minFreeMemoryPercent)
-
-
Method Details
-
parseOverride
@CheckForNull public static HostLimits parseOverride(@CheckForNull String minFreeCpuMhz, @CheckForNull String minFreeCpuPercent, @CheckForNull String minFreeMemoryMB, @CheckForNull String minFreeMemoryPercent) throws VSphereException Builds the limits a single call (build step or template) sets for itself from the text of its four settings, already variable-expanded. If none is set (all null or blank) there is no override and null is returned, meaning: use the cloud's limits. If any is set, these four values replace the cloud's limits entirely, those left blank counting as zero. Setting them all to0is therefore a way to have no limits despite the cloud's.- Throws:
VSphereException- if a value is set but is not a non-negative whole number (or, for a percentage, is above 100)
-
getMinFreeCpuMhz
public long getMinFreeCpuMhz() -
getMinFreeCpuPercent
public int getMinFreeCpuPercent() -
getMinFreeMemoryMB
public long getMinFreeMemoryMB() -
getMinFreeMemoryPercent
public int getMinFreeMemoryPercent() -
isActive
public boolean isActive()True if at least one limit is set. -
shortfall
Why this host is below the limits, or null if it satisfies all of them. A host whose usage is not known cannot be shown to satisfy a limit that is set, so it is below it. -
toString
-