The following plugin provides functionality available through
Pipeline-compatible steps. Read more about how to integrate steps into your
Pipeline in the
Steps
section of the
Pipeline Syntax
page.
For a list of other such plugins, see the
Pipeline Steps Reference
page.
vSphere Plugin
step([$class: 'DeleteSnapshot'])
: Delete a Snapshot
vm : String
snapshotName : String
The name of the snapshot.
consolidate : boolean
Consolidate all redundant redo logs for this VM?
failOnNoExist : boolean
If the snapshot you are trying to delete doesnt exist, fail this build step. Sometimes, the job doesnt care if deletion was successful and only wants it gone---if this is the case, leave unchecked.
step([$class: 'Deploy'])
: Deploy VM from template
template : String
The name of the vSphere template to clone.
clone : String
The name of the cloned VM.
linkedClone : boolean
Linked clones will re-use any read-only disk backings (like snapshots) and create new children for your clone. This will drastically save time, but the disk backings will be shared.
resourcePool : String
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster : String
The vCenter cluster to be used by the VM.
datastore : String
The data store to be used by the VM.
folder : String
(Optional) VSphere folder path or unique folder name where VM is going to be created.
If blank, it will be created in the same folder as the original VM.
customizationSpec : String
timeoutInSeconds : int
The length of time, in seconds, to wait for the new VirtualMachine to be assigned an IP address after it has been powered on. If this value is zero, no attempt will be made to determine the IP address.
powerOn : boolean
Specifies whether or not the new VirtualMachine should be powered on after creation.
step([$class: 'ExposeGuestInfo'])
: Expose Guest Info
vm : String
The name of the VM to expose guest info for.
Variables IpAddress, Hostname, ToolsStatus, ToolsRunningStatus, ToolsVersion, ToolsVersionStatus, GuestState, GuestId, GuestFamily, GuestFullName, AppHeartbeatStatus, GuestOperationsReady, InteractiveGuestOperationsReady are exposed.
envVariablePrefix : String
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4 : boolean
step([$class: 'PowerOff'])
: Power-Off VM
vm : String
The name of the VM to shut down.
evenIfSuspended : boolean
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully : boolean
If the VM is powered on and VMware Tools is running, a graceful shutdown will be attempted by performing a Guest Shutdown. If the VM is still running after the timeout has been reached, a hard power off will be performed.
ignoreIfNotExists : boolean
gracefulShutdownTimeout : int
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
vm : String
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation : String
(optional)
The text that will be written into the "annotations" field on the VM. This typically shows up in the vSphere UI as the "Notes" for a VM.
append : boolean
(optional)
If set then the text specified in this build step will be appended to the end of any existing text. If not set then the text specified will replace any existing text.
$class: 'ReconfigureCpu'
cpuCores : String
coresPerSocket : String
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize : String
datastore : String
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize : String
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel : String
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress : String
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch : boolean
portGroup : String
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch : boolean
distributedPortGroup : String
Specifies the Distributed Switch Port Group.
distributedPortId : String
Port Id to be used from the specified Distributed Switch Port Group.
step([$class: 'Rename'])
: Rename VM
oldName : String
The old name of the VM or template to be renamed.
newName : String
The new name of the VM or template.
step([$class: 'RenameSnapshot'])
: Rename Snapshot
vm : String
The name of the VM or template.
oldName : String
The old name of the snapshot to be renamed.
newName : String
The new name of the snapshot.
newDescription : String
The new description of the snapshot.
step([$class: 'RevertToSnapshot'])
: Revert to Snapshot
vm : String
snapshotName : String
The name of the snapshot.
step([$class: 'SuspendVm'])
: Suspend VM
vm : String
The name of the VM to suspend.
step([$class: 'TakeSnapshot'])
: Take Snapshot
vm : String
The name of the VM you'd like to take a snapshot of.
snapshotName : String
The name of the snapshot.
description : String
The description to be saved with the snapshot.
includeMemory : boolean
Would you like to save the active memory in the snapshot?
step([$class: 'VSphereBuildStepContainer'])
: vSphere Build Step
buildStep
Nested Choice of Objects
$class: 'Clone'
sourceName : String
The name of the vSphere VM or template to clone.
clone : String
The name of the cloned VM.
linkedClone : boolean
Linked clones will re-use any read-only disk backings (like snapshots) and create new children for your clone. This will drastically save time, but the disk backings will be shared.
resourcePool : String
The Resource Pool to be used by the VM. Leave it blank to use the same resource pool as the source VM. Must be specified if source VM is a template.
cluster : String
The vCenter cluster to be used by the VM.
datastore : String
The data store to be used by the VM.
folder : String
(Optional) VSphere folder path or unique folder name where VM is going to be created.
If blank, it will be created in the same folder as the original VM.
powerOn : boolean
Specifies whether or not the new VirtualMachine should be powered on after creation.
timeoutInSeconds : int
The length of time, in seconds, to wait for the new VirtualMachine to be assigned an IP address after it has been powered on. If this value is zero, no attempt will be made to determine the IP address.
customizationSpec : String
The customization specification name, as defined under 'Policies and Profiles'
$class: 'ConvertToTemplate'
vm : String
The name of the VM to be converted to a template.
force : boolean
Check this if you want to force the conversion in the case where the VM is not already powered down.
$class: 'ConvertToVm'
template : String
The name of the template to be converted to a Virtual Machine.
resourcePool : String
The Resource Pool to be used by the VM.
cluster : String
The vCenter cluster to be used by the VM.
$class: 'Delete'
vm : String
The name of the VM to be destroyed. This is a destructive operation that cannot be undone!
failOnNoExist : boolean
If the VM you are trying to delete doesnt exist, fail this build step. Sometimes, the job doesnt care if deletion was successful and only wants it gone---if this is the case, leave unchecked.
$class: 'DeleteSnapshot'
vm : String
snapshotName : String
The name of the snapshot.
consolidate : boolean
Consolidate all redundant redo logs for this VM?
failOnNoExist : boolean
If the snapshot you are trying to delete doesnt exist, fail this build step. Sometimes, the job doesnt care if deletion was successful and only wants it gone---if this is the case, leave unchecked.
$class: 'Deploy'
template : String
The name of the vSphere template to clone.
clone : String
The name of the cloned VM.
linkedClone : boolean
Linked clones will re-use any read-only disk backings (like snapshots) and create new children for your clone. This will drastically save time, but the disk backings will be shared.
resourcePool : String
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster : String
The vCenter cluster to be used by the VM.
datastore : String
The data store to be used by the VM.
folder : String
(Optional) VSphere folder path or unique folder name where VM is going to be created.
If blank, it will be created in the same folder as the original VM.
customizationSpec : String
timeoutInSeconds : int
The length of time, in seconds, to wait for the new VirtualMachine to be assigned an IP address after it has been powered on. If this value is zero, no attempt will be made to determine the IP address.
powerOn : boolean
Specifies whether or not the new VirtualMachine should be powered on after creation.
$class: 'ExposeGuestInfo'
vm : String
The name of the VM to expose guest info for.
Variables IpAddress, Hostname, ToolsStatus, ToolsRunningStatus, ToolsVersion, ToolsVersionStatus, GuestState, GuestId, GuestFamily, GuestFullName, AppHeartbeatStatus, GuestOperationsReady, InteractiveGuestOperationsReady are exposed.
envVariablePrefix : String
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4 : boolean
$class: 'PowerOff'
vm : String
The name of the VM to shut down.
evenIfSuspended : boolean
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully : boolean
If the VM is powered on and VMware Tools is running, a graceful shutdown will be attempted by performing a Guest Shutdown. If the VM is still running after the timeout has been reached, a hard power off will be performed.
ignoreIfNotExists : boolean
gracefulShutdownTimeout : int
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
$class: 'PowerOn'
vm : String
The name of the VM to power on.
timeoutInSeconds : int
The maximum number of seconds to wait for the IP.
$class: 'Reconfigure'
vm : String
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation : String
(optional)
The text that will be written into the "annotations" field on the VM. This typically shows up in the vSphere UI as the "Notes" for a VM.
append : boolean
(optional)
If set then the text specified in this build step will be appended to the end of any existing text. If not set then the text specified will replace any existing text.
$class: 'ReconfigureCpu'
cpuCores : String
coresPerSocket : String
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize : String
datastore : String
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize : String
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel : String
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress : String
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch : boolean
portGroup : String
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch : boolean
distributedPortGroup : String
Specifies the Distributed Switch Port Group.
distributedPortId : String
Port Id to be used from the specified Distributed Switch Port Group.
$class: 'Rename'
oldName : String
The old name of the VM or template to be renamed.
newName : String
The new name of the VM or template.
$class: 'RenameSnapshot'
vm : String
The name of the VM or template.
oldName : String
The old name of the snapshot to be renamed.
newName : String
The new name of the snapshot.
newDescription : String
The new description of the snapshot.
$class: 'RevertToSnapshot'
vm : String
snapshotName : String
The name of the snapshot.
$class: 'SuspendVm'
vm : String
The name of the VM to suspend.
$class: 'TakeSnapshot'
vm : String
The name of the VM you'd like to take a snapshot of.
snapshotName : String
The name of the snapshot.
description : String
The description to be saved with the snapshot.
includeMemory : boolean
Would you like to save the active memory in the snapshot?
serverName : String
The vSphere configuration to use. Use ${VSPHERE_CLOUD_NAME} and create a vsphere selection parameter if you want to dynamically select the vSphere configuration.
A vsphere selection parameter is the same as a string parameter named VSPHERE_CLOUD_NAME but allows easy selection of a vsphere cloud.
vSphere
: Invoke an vSphere action, exposing the VM IP under some actions
Execute vCenter actions. Reusing vSphereBuildStep forms, cut properly exposing VSPHERE_IP for PowerOn, Deploy and Clone options.
buildStep
(optional)
Nested Choice of Objects
$class: 'Clone'
sourceName : String
The name of the vSphere VM or template to clone.
clone : String
The name of the cloned VM.
linkedClone : boolean
Linked clones will re-use any read-only disk backings (like snapshots) and create new children for your clone. This will drastically save time, but the disk backings will be shared.
resourcePool : String
The Resource Pool to be used by the VM. Leave it blank to use the same resource pool as the source VM. Must be specified if source VM is a template.
cluster : String
The vCenter cluster to be used by the VM.
datastore : String
The data store to be used by the VM.
folder : String
(Optional) VSphere folder path or unique folder name where VM is going to be created.
If blank, it will be created in the same folder as the original VM.
powerOn : boolean
Specifies whether or not the new VirtualMachine should be powered on after creation.
timeoutInSeconds : int
The length of time, in seconds, to wait for the new VirtualMachine to be assigned an IP address after it has been powered on. If this value is zero, no attempt will be made to determine the IP address.
customizationSpec : String
The customization specification name, as defined under 'Policies and Profiles'
$class: 'ConvertToTemplate'
vm : String
The name of the VM to be converted to a template.
force : boolean
Check this if you want to force the conversion in the case where the VM is not already powered down.
$class: 'ConvertToVm'
template : String
The name of the template to be converted to a Virtual Machine.
resourcePool : String
The Resource Pool to be used by the VM.
cluster : String
The vCenter cluster to be used by the VM.
$class: 'Delete'
vm : String
The name of the VM to be destroyed. This is a destructive operation that cannot be undone!
failOnNoExist : boolean
If the VM you are trying to delete doesnt exist, fail this build step. Sometimes, the job doesnt care if deletion was successful and only wants it gone---if this is the case, leave unchecked.
$class: 'DeleteSnapshot'
vm : String
snapshotName : String
The name of the snapshot.
consolidate : boolean
Consolidate all redundant redo logs for this VM?
failOnNoExist : boolean
If the snapshot you are trying to delete doesnt exist, fail this build step. Sometimes, the job doesnt care if deletion was successful and only wants it gone---if this is the case, leave unchecked.
$class: 'Deploy'
template : String
The name of the vSphere template to clone.
clone : String
The name of the cloned VM.
linkedClone : boolean
Linked clones will re-use any read-only disk backings (like snapshots) and create new children for your clone. This will drastically save time, but the disk backings will be shared.
resourcePool : String
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster : String
The vCenter cluster to be used by the VM.
datastore : String
The data store to be used by the VM.
folder : String
(Optional) VSphere folder path or unique folder name where VM is going to be created.
If blank, it will be created in the same folder as the original VM.
customizationSpec : String
timeoutInSeconds : int
The length of time, in seconds, to wait for the new VirtualMachine to be assigned an IP address after it has been powered on. If this value is zero, no attempt will be made to determine the IP address.
powerOn : boolean
Specifies whether or not the new VirtualMachine should be powered on after creation.
$class: 'ExposeGuestInfo'
vm : String
The name of the VM to expose guest info for.
Variables IpAddress, Hostname, ToolsStatus, ToolsRunningStatus, ToolsVersion, ToolsVersionStatus, GuestState, GuestId, GuestFamily, GuestFullName, AppHeartbeatStatus, GuestOperationsReady, InteractiveGuestOperationsReady are exposed.
envVariablePrefix : String
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4 : boolean
$class: 'PowerOff'
vm : String
The name of the VM to shut down.
evenIfSuspended : boolean
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully : boolean
If the VM is powered on and VMware Tools is running, a graceful shutdown will be attempted by performing a Guest Shutdown. If the VM is still running after the timeout has been reached, a hard power off will be performed.
ignoreIfNotExists : boolean
gracefulShutdownTimeout : int
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
$class: 'PowerOn'
vm : String
The name of the VM to power on.
timeoutInSeconds : int
The maximum number of seconds to wait for the IP.
$class: 'Reconfigure'
vm : String
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation : String
(optional)
The text that will be written into the "annotations" field on the VM. This typically shows up in the vSphere UI as the "Notes" for a VM.
append : boolean
(optional)
If set then the text specified in this build step will be appended to the end of any existing text. If not set then the text specified will replace any existing text.
$class: 'ReconfigureCpu'
cpuCores : String
coresPerSocket : String
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize : String
datastore : String
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize : String
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel : String
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress : String
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch : boolean
portGroup : String
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch : boolean
distributedPortGroup : String
Specifies the Distributed Switch Port Group.
distributedPortId : String
Port Id to be used from the specified Distributed Switch Port Group.
$class: 'Rename'
oldName : String
The old name of the VM or template to be renamed.
newName : String
The new name of the VM or template.
$class: 'RenameSnapshot'
vm : String
The name of the VM or template.
oldName : String
The old name of the snapshot to be renamed.
newName : String
The new name of the snapshot.
newDescription : String
The new description of the snapshot.
$class: 'RevertToSnapshot'
vm : String
snapshotName : String
The name of the snapshot.
$class: 'SuspendVm'
vm : String
The name of the VM to suspend.
$class: 'TakeSnapshot'
vm : String
The name of the VM you'd like to take a snapshot of.
snapshotName : String
The name of the snapshot.
description : String
The description to be saved with the snapshot.
includeMemory : boolean
Would you like to save the active memory in the snapshot?
serverName : String
(optional)
Was this page helpful?
Please submit your feedback about this page through this
quick form.
Alternatively, if you don't wish to complete the quick form, you can simply
indicate if you found this page helpful?
See existing feedback here.