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
snapshotName
The name of the snapshot.
consolidate
Consolidate all redundant redo logs for this VM?
failOnNoExist
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
The name of the vSphere template to clone.
clone
The name of the cloned VM.
linkedClone
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
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster
The vCenter cluster to be used by the VM.
datastore
The data store to be used by the VM.
folder
(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
timeoutInSeconds
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
Specifies whether or not the new VirtualMachine should be powered on after creation.
step([$class: 'ExposeGuestInfo'])
: Expose Guest Info
vm
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
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4
step([$class: 'PowerOff'])
: Power-Off VM
vm
The name of the VM to shut down.
evenIfSuspended
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully
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
gracefulShutdownTimeout
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
vm
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation
(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
(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
coresPerSocket
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize
datastore
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch
portGroup
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch
distributedPortGroup
Specifies the Distributed Switch Port Group.
distributedPortId
Port Id to be used from the specified Distributed Switch Port Group.
step([$class: 'Rename'])
: Rename VM
oldName
The old name of the VM or template to be renamed.
newName
The new name of the VM or template.
step([$class: 'RenameSnapshot'])
: Rename Snapshot
vm
The name of the VM or template.
oldName
The old name of the snapshot to be renamed.
newName
The new name of the snapshot.
newDescription
The new description of the snapshot.
step([$class: 'RevertToSnapshot'])
: Revert to Snapshot
vm
snapshotName
The name of the snapshot.
step([$class: 'SuspendVm'])
: Suspend VM
vm
The name of the VM to suspend.
step([$class: 'TakeSnapshot'])
: Take Snapshot
vm
The name of the VM you'd like to take a snapshot of.
snapshotName
The name of the snapshot.
description
The description to be saved with the snapshot.
includeMemory
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
The name of the vSphere VM or template to clone.
clone
The name of the cloned VM.
linkedClone
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
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
The vCenter cluster to be used by the VM.
datastore
The data store to be used by the VM.
folder
(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
Specifies whether or not the new VirtualMachine should be powered on after creation.
timeoutInSeconds
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
The customization specification name, as defined under 'Policies and Profiles'
$class: 'ConvertToTemplate'
vm
The name of the VM to be converted to a template.
force
Check this if you want to force the conversion in the case where the VM is not already powered down.
$class: 'ConvertToVm'
template
The name of the template to be converted to a Virtual Machine.
resourcePool
The Resource Pool to be used by the VM.
cluster
The vCenter cluster to be used by the VM.
$class: 'Delete'
vm
The name of the VM to be destroyed. This is a destructive operation that cannot be undone!
failOnNoExist
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
snapshotName
The name of the snapshot.
consolidate
Consolidate all redundant redo logs for this VM?
failOnNoExist
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
The name of the vSphere template to clone.
clone
The name of the cloned VM.
linkedClone
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
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster
The vCenter cluster to be used by the VM.
datastore
The data store to be used by the VM.
folder
(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
timeoutInSeconds
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
Specifies whether or not the new VirtualMachine should be powered on after creation.
$class: 'ExposeGuestInfo'
vm
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
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4
$class: 'PowerOff'
vm
The name of the VM to shut down.
evenIfSuspended
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully
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
gracefulShutdownTimeout
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
$class: 'PowerOn'
vm
The name of the VM to power on.
timeoutInSeconds
The maximum number of seconds to wait for the IP.
$class: 'Reconfigure'
vm
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation
(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
(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
coresPerSocket
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize
datastore
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch
portGroup
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch
distributedPortGroup
Specifies the Distributed Switch Port Group.
distributedPortId
Port Id to be used from the specified Distributed Switch Port Group.
$class: 'Rename'
oldName
The old name of the VM or template to be renamed.
newName
The new name of the VM or template.
$class: 'RenameSnapshot'
vm
The name of the VM or template.
oldName
The old name of the snapshot to be renamed.
newName
The new name of the snapshot.
newDescription
The new description of the snapshot.
$class: 'RevertToSnapshot'
vm
snapshotName
The name of the snapshot.
$class: 'SuspendVm'
vm
The name of the VM to suspend.
$class: 'TakeSnapshot'
vm
The name of the VM you'd like to take a snapshot of.
snapshotName
The name of the snapshot.
description
The description to be saved with the snapshot.
includeMemory
Would you like to save the active memory in the snapshot?
serverName
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
The name of the vSphere VM or template to clone.
clone
The name of the cloned VM.
linkedClone
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
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
The vCenter cluster to be used by the VM.
datastore
The data store to be used by the VM.
folder
(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
Specifies whether or not the new VirtualMachine should be powered on after creation.
timeoutInSeconds
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
The customization specification name, as defined under 'Policies and Profiles'
$class: 'ConvertToTemplate'
vm
The name of the VM to be converted to a template.
force
Check this if you want to force the conversion in the case where the VM is not already powered down.
$class: 'ConvertToVm'
template
The name of the template to be converted to a Virtual Machine.
resourcePool
The Resource Pool to be used by the VM.
cluster
The vCenter cluster to be used by the VM.
$class: 'Delete'
vm
The name of the VM to be destroyed. This is a destructive operation that cannot be undone!
failOnNoExist
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
snapshotName
The name of the snapshot.
consolidate
Consolidate all redundant redo logs for this VM?
failOnNoExist
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
The name of the vSphere template to clone.
clone
The name of the cloned VM.
linkedClone
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
The Resource Pool to be used by the VM. If no resource pool is being used, then leave blank.
cluster
The vCenter cluster to be used by the VM.
datastore
The data store to be used by the VM.
folder
(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
timeoutInSeconds
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
Specifies whether or not the new VirtualMachine should be powered on after creation.
$class: 'ExposeGuestInfo'
vm
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
Prefix for guest info environmental variables. E.g. for prefix VM1, variables would be VM1_IpAddress, VM1_HostName etc.
waitForIp4
$class: 'PowerOff'
vm
The name of the VM to shut down.
evenIfSuspended
If the VM is currently suspended, it will still be shutdown.
shutdownGracefully
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
gracefulShutdownTimeout
(optional)
The number of seconds after which the graceful shutdown attempt is abandoned, and hard power off is performed.
$class: 'PowerOn'
vm
The name of the VM to power on.
timeoutInSeconds
The maximum number of seconds to wait for the IP.
$class: 'Reconfigure'
vm
The name of the VM or template to reconfigure.
reconfigureSteps
Array / List of Nested Choice of Objects
$class: 'ReconfigureAnnotation'
annotation
(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
(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
coresPerSocket
The number of CPU Cores per Socket.
$class: 'ReconfigureDisk'
diskSize
datastore
The data store to be used by the disk.
$class: 'ReconfigureMemory'
memorySize
The amount of memory (RAM) in megabytes.
$class: 'ReconfigureNetworkAdapters'
deviceAction
- Values:
ADD
, EDIT
, REMOVE
deviceLabel
The name of the network device, such as "Network adapter 1". If blank, the first network adapter will be used.
macAddress
The new MAC address for this network adapter. Leave blank to keep existing or default value.
standardSwitch
portGroup
The name of the network port group to use. Leave blank to keep existing or default value.
distributedSwitch
distributedPortGroup
Specifies the Distributed Switch Port Group.
distributedPortId
Port Id to be used from the specified Distributed Switch Port Group.
$class: 'Rename'
oldName
The old name of the VM or template to be renamed.
newName
The new name of the VM or template.
$class: 'RenameSnapshot'
vm
The name of the VM or template.
oldName
The old name of the snapshot to be renamed.
newName
The new name of the snapshot.
newDescription
The new description of the snapshot.
$class: 'RevertToSnapshot'
vm
snapshotName
The name of the snapshot.
$class: 'SuspendVm'
vm
The name of the VM to suspend.
$class: 'TakeSnapshot'
vm
The name of the VM you'd like to take a snapshot of.
snapshotName
The name of the snapshot.
description
The description to be saved with the snapshot.
includeMemory
Would you like to save the active memory in the snapshot?
serverName
(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.