Class HostSelectionOptions
java.lang.Object
org.jenkinsci.plugins.vsphere.tools.HostSelectionOptions
Optional refinements for automatic host selection (see
VSphereHostSelection), already
resolved from cloud-level defaults and call-site overrides, so VSphere only has to apply
them.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HostSelectionOptionsNo refinements: the original behaviour. -
Constructor Summary
ConstructorsConstructorDescriptionHostSelectionOptions(boolean requireCores, boolean requireMemory) HostSelectionOptions(boolean requireCores, boolean requireMemory, boolean requireAvailableMemory) -
Method Summary
Modifier and TypeMethodDescriptionvCPU count the VM will end up with, if known ahead of cloning; else null.Memory size in MB the VM will end up with, if known ahead of cloning; else null.What "most available host" means;HostWeights.DEFAULTfor the original ranking.booleanOnly consider hosts that currently have at least as much memory free as the VM is configured with, so the new VM does not push the host into swapping.booleanOnly consider hosts with at least as many physical cores as the VM has vCPUs.booleanOnly consider hosts with at least as much physical RAM as the VM is configured with.static booleanResolves a tri-state call-site setting against the cloud-wide default:null(never set at the call site) inheritscloudDefault; an explicitTRUEorFALSEwins outright.static BooleantriStateFromString(String value) Inverse oftriStateToString(java.lang.Boolean): blank or anything unrecognised means unset (inherit).static ListBoxModelDrop-down for a tri-state call-site setting: inherit the cloud's default, or force yes/no.static StringtriStateToString(Boolean value) The form representation of a tri-state setting: "" for unset (inherit), else "true"/"false".withVmSize(Integer vmCpus, Long vmMemoryMB) Same options, but telling the host size checks to compare against this vCPU count and memory size (null: unknown, use the source VM's) instead of the source VM's own - for VMs that are known to be resized right after being cloned.withWeights(HostWeights weights) Same options, ranking the candidate hosts with these weights.
-
Field Details
-
NONE
No refinements: the original behaviour.
-
-
Constructor Details
-
HostSelectionOptions
public HostSelectionOptions(boolean requireCores, boolean requireMemory) -
HostSelectionOptions
public HostSelectionOptions(boolean requireCores, boolean requireMemory, boolean requireAvailableMemory)
-
-
Method Details
-
withVmSize
Same options, but telling the host size checks to compare against this vCPU count and memory size (null: unknown, use the source VM's) instead of the source VM's own - for VMs that are known to be resized right after being cloned. -
withWeights
Same options, ranking the candidate hosts with these weights. -
getWeights
What "most available host" means;HostWeights.DEFAULTfor the original ranking. -
getVmCpus
vCPU count the VM will end up with, if known ahead of cloning; else null. -
getVmMemoryMB
Memory size in MB the VM will end up with, if known ahead of cloning; else null. -
isRequireCores
public boolean isRequireCores()Only consider hosts with at least as many physical cores as the VM has vCPUs. -
isRequireAvailableMemory
public boolean isRequireAvailableMemory()Only consider hosts that currently have at least as much memory free as the VM is configured with, so the new VM does not push the host into swapping. -
isRequireMemory
public boolean isRequireMemory()Only consider hosts with at least as much physical RAM as the VM is configured with. -
resolve
Resolves a tri-state call-site setting against the cloud-wide default:null(never set at the call site) inheritscloudDefault; an explicitTRUEorFALSEwins outright. -
triStateToString
The form representation of a tri-state setting: "" for unset (inherit), else "true"/"false". Needed because Stapler binds an empty form value to an explicitfalsefor aBooleanproperty, which would silently override the cloud's default instead of inheriting it. -
triStateFromString
Inverse oftriStateToString(java.lang.Boolean): blank or anything unrecognised means unset (inherit). -
triStateItems
Drop-down for a tri-state call-site setting: inherit the cloud's default, or force yes/no.
-