Orchestration VMware Activities

From ServiceNow Wiki
Home > Deliver > IT Operations Management > Orchestration > VMware Support > Orchestration VMware Activities
Jump to: navigation, search
Discovery
Orchestration
Related Topics
Get the Book
Knowledge.gif Discovery
Knowledge.gif Data Collected by Discovery
Knowledge.gif Orchestration for VMWare

1 Overview

Orchestration - VMware Support adds these activities for use in workflows. Your ServiceNow instance must have access to a MID Server configured to use VMware to run these activities. For the list of all Orchestration activities, see Orchestration Activities.

2 Determining VMware Activity Result Values

VMware activities communicate with vCenter through a MID Server. When a VMware activity sends a request, the MID Server sends a response to the ECC Queue. All VMware activities set their activity.result value based on the payload of the response from the MID Server. If this payload contains an error, the activity result value is failure. If the the payload contains no error, the activity result value is success. Some activities, such as Delete Snapshot, specify additional result values. For more information about activity.result, see Using the Activity Result Value.

3 Managed Object Reference ID

A managed object reference (MOR) ID uniquely identifies a VMware virtual machine. ServiceNow uses MOR ID values in several VMware activities to select specific virtual machines to act on. VMware provides additional documentation on obtaining the MOR ID for a virtual machine.

4 Virtual Machine UUID

The VMware universal unique identifier (UUID) required by VMware activities (VM uuid input variable) must be in the following format: 4210c162-e31e-70e6-4a03-b46abbe17b4f. If you are writing a workflow and not using an automated workflow from ServiceNow, you must provide a properly formatted UUID. A UUID from another source might be in the wrong format. For example the UUID from the VMX file (uuid.bios field) on the virtual machine appears in this format, 42 10 c1 62 e3 1e 70 e6-4a 03 b4 6a bb e1 7b 4f, and produces an error. If the UUID you have for a virtual machine is not in the correct format, use one of these methods to obtain the correct value.

4.1 Managed Object Browser

The Managed Object Browser (MOB) is a vCenter utility that allows users to view detailed information about vCenter objects, such as images and virtual machines. To find the UUID of a virtual machine using the MOB:

  1. Navigate to https://<vCenter IP>/mob to log into the MOB.
  2. Browse to content, rootFolder, and down the childEntity list into the appropriate datacenter, datastore, and finally down to the actual virtual machine.
  3. In the virtual machine, click config and find the uuid field.
    Copy this value into the VM uuid activity input variable.

4.2 Conversion Function

A function called turnCorrelationIdToUuid in the VMUtils script include converts a UUID to the proper format automatically. Use this function to convert a UUID to the proper format within the workflow:

javascript:VMUtils.turnCorrelationIdToUuid(<uuid from another source>)

For example, you can enter javascript:VMUtils.turnCorrelationIdToUuid('42 10 c1 62 e3 1e 70 e6-4a 03 b4 6a bb e1 7b 4f') directly in the VM uuid activity input variable.

Another method is to use the function to create a scratchpad variable that is available to all the activities in the workflow. For example, you might add a Run Script activity to the beginning of the workflow in which you create the following variable:

workflow.scratchpad.uuid=VMUtils.turnCorrelationIdToUuid('42 10 c1 62 e3 1e 70 e6-4a 03 b4 6a bb e1 7b 4f')

You can then access this variable from any activity by entering ${workflow.scratchpad.uuid} in the VM uuid activity input variable.

5 Add Disk

The Add Disk activity creates a new disk on a virtual machine. This activity selects a datastore for the new hard disk automatically if you do not specify one.

5.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to operate.
Datastore MOR id The ID of the datastore on which to put this disk. If this variable is blank, Orchestration searches all the datastores associated with the virtual machine to find one with sufficient space for the disk being added.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Disk size (MB) The size of the new disk to create, in megabytes. This activity provisions all the necessary space for the new disk immediately (thick mode).

6 Change Network

The Change Network activity changes the network that a virtual machine is configured to use.

6.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to operate.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Network Name of the network. For example, Production Network. A virtual machine can only access a network in the same datacenter.

7 Change State

The Change State activity sends commands to vCenter to control the power state of a given VMware virtual machine, such as powering on and powering off the VM. If the VM is already in the state to which it is being changed, the workflow takes no action.

7.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address to the vCenter server that manages the virtual machine to operate.
Action Select the new state for the virtual machine:
  • Power On: turns on a virtual machine that is powered off or suspended and does nothing if the virtual machine is already on.
  • Power Off: turns off a virtual machine that is powered on or suspended and does nothing if the virtual machine is already off. This variable returns an error if the virtual machine is suspended.
  • Suspend: suspends a virtual machine that is powered on and does nothing if the virtual machine is already suspended. This variable returns an error if the virtual machine is off.
  • Reset: resets a virtual machine that is powered on. This variable returns an error if the virtual machine is off or suspended.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.

8 Check VM Alive

The Check VM Alive activity uses the VMware API to determine if a newly configured virtual machine is alive. The virtual machine is alive if its state is powered on and it uses the same IP address it was configured to use.

8.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to check.
IP Address The IP address that the virtual machine with the VM uuid parameter should have to be declared alive.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.

9 Clone

The Clone activity sends commands to vCenter to clone a given VMware virtual machine or virtual machine template. Several input variables require a MOR ID. ServiceNow stores MOR data in the Object ID field of configuration item records.

9.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to clone and also will manage the clone.
VM uuid The VMware universal unique identifier assigned to the machine you are cloning. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Clone name The name to assign to the newly cloned virtual machine.
Folder MOR id The managed object reference ID for the folder in which the cloned virtual machine resides. This variable is optional. If this field is blank, Orchestration places the cloned virtual machine in the same folder as the source virtual machine.
Datastore MOR id The managed object reference ID for the datastore the new virtual machine belongs to. This variable is optional. If this field is blank, Orchestration places the cloned virtual machine in the same datastore as the source virtual machine.
Host MOR id The managed object reference ID for the host the new virtual machine is assigned to. This variable is optional. If this field is blank, Orchestration assigns the cloned virtual machine to the same host as the source virtual machine.
Resource pool MOR id The managed object reference ID for the resource pool the new virtual machine is assigned to. This variable is optional when cloning a virtual machine. If this field is blank, Orchestration assigns the cloned virtual machine to the same resource pool as the source virtual machine.
Resource Pool Owner Owner of the resource pool as seen by vCenter. For example, the owner might be something like labesx01.service-now.com or an IP address. The owner should point to the ESX box on which the original VM and clone are located (whatever vCenter's representation of that ESX name is).

10 Configure Linux

The Configure Linux activity sends commands to vCenter to set the identity and network information on a given VMware virtual Linux machine. This activity also enables guest customization for the Linux machine. This activity fails if run against a single virtual machine more than once.

10.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the Linux virtual machine being configured.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Hostname The operating system name assigned to the Linux virtual machine.
Domain The domain the Linux virtual machine is assigned to.
IP Address The IP address assigned to the Linux virtual machine.
Netmask The netmask for the network the Linux virtual machine's IP address belongs to.
Gateway The gateway address for the network the Linux virtual machine's IP address belongs to.
DNS The DNS server for the network the Linux virtual machine's IP address belongs to.

11 Configure Windows

The Configure Windows activity sends commands to vCenter to set the identity and network information on a given VMware virtual Windows machine. This activity also enables guest customization for the Windows machine. This activity fails if run against a single virtual machine more than once.

11.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the Windows virtual machine being configured.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Gateway The gateway address for the network the Windows virtual machine's IP address belongs to.
Administrator Password The password assigned to the Administrator user for this operating system.
Domain Administrator Password The password for the domain user with the proper credentials to move a machine onto the given domain.
Domain Administrator A user who has the credentials to get this Windows machine onto the domain.
DNS The DNS server for the network the Windows virtual machine's IP address belongs to.
Hostname The computer name of the Windows virtual machine.
IP Address The IP address assigned to the Windows virtual machine.
Netmask The netmask for the network the Windows virtual machine's IP address belongs to.
Organization The organization of the registered user for the OS installed on this virtual machine. This value appears in the Properties box of My Computer.
Time Zone The time zone value. For example, the value for the US/Pacific time zone is 4.
Domain The domain the Windows virtual machine is assigned to.
Product Key The Microsoft product key for the Windows operating system installed on the virtual machine.
Registered User The registered user for the operating system installed on the virtual machine. This user appears in the Properties box of My Computer.
Run once A set of Windows commands that run on the specified Windows machine when this activity initializes.
License mode The type of license the Windows operating system uses, either Per server or Per seat. See Microsoft Licensing for more information.
Concurrent connections When using a Per server license mode, the Concurrent connections value specifies how many users can access the Windows machine at a time.

12 Delete Snapshot

The Delete Snapshot activity deletes a saved virtual machine snapshot from a vCenter server. This activity is available starting with the Eureka release.

12.1 Results

  • Success: the snapshot was successfully deleted.
  • Failure: an error occurred while attempting to delete the snapshot. Additional details may be available in the workflow log.
  • Not Found: the specified snapshot was not found on the vCenter server.

12.2 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that stores the snapshot to delete.
VM uuid The VMware universal unique identifier assigned to the virtual machine storing the snapshot to delete. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Snapshot MOR id The managed object reference ID of the snapshot to delete.

13 Destroy

The Destroy activity sends a command to vCenter to destroy the named VMware virtual machine. This activity deletes the virtual machine and removes it from the disk.

13.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to destroy.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.

14 Get VM Events

The Get VM Events activity retrieves the most recent events for a virtual machine. This activity stores the retrieved event information in the events sensor script variable as an array of JavaScript objects. Each object in this array contains these fields:

  • classname: The class of the event generated by the vCenter.
  • message: The event text.
  • time: The timestamp when the event occurred.


This activity is available starting with the Eureka release.

14.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine from which you want to retrieve events.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Max events The maximum number of events to retrieve from the virtual machine. The activity returns at most 15 events if you do not specify a value.

15 Get VM Guest Info

The Get VM Guest Info activity retrieves the guest customization information for a virtual machine. This activity stores the returned information in these sensor script variables:

  • hostname: The host name of the virtual machine.
  • state: The power state of the virtual machine.
  • ip: An array of strings that lists the IPv6 and IPv4 addresses of the virtual machine.

This activity is available starting with the Eureka release.

15.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine from which you want to retrieve guest customization information.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.

16 Reconfigure

The Reconfigure activity updates the number of CPUs and the amount of memory assigned to a virtual machine.

16.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine to operate.
VM uuid The VMware universal unique identifier assigned to this virtual machine. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Number of CPUs The number of CPUs to allocate to the virtual machine. If this field is blank, you must reconfigure the memory for this virtual machine.
Memory (MB) The amount of memory, in megabytes, to allocate to the virtual machine. If this field is blank, you must reconfigure the number of CPUs for this virtual machine. This value must be divisible by 4. If the amount is not divisible by 4, the activity succeeds but the virtual machine cannot start.

17 Revert to Snapshot

The Revert to Snapshot activity reverts a virtual machine to the state captured in a given snapshot.

17.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine for which the snapshot was created.
VM uuid The VMware universal unique identifier assigned to the virtual machine from which the snapshot was created. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Snapshot name Unique name of the snapshot.
Snapshot MOR id Reverts the virtual machine to the snapshot with this ManagedObjectReference ID. If this variable is present, the workflow ignores the Snapshot name.

18 Snapshot

The Snapshot activity creates a snapshot of a virtual machine. A snapshot stores the current state of a virtual machine, but is not a full backup.

18.1 Input Variables

These variables determine the behavior of the activity.

Field Description
vCenter IP address of the vCenter server that manages the virtual machine for which you want to create a snapshot.
VM uuid The VMware universal unique identifier assigned to the virtual machine from which the snapshot is created. If you are creating your own workflow, see Virtual Machine UUID for instructions on properly formatting the unique identifier.
Snapshot name Unique name of the snapshot.
Snapshot description Description that distinguishes this snapshot from other snapshots of the same virtual machine.
Scratchpad variable The scratchpad variable to store the returned snapshot ID. You can use this snapshot ID in the Snapshot MOR id variable for the Revert to Snapshot and Delete Snapshot activities. This variable is available starting with the Eureka release.

19 Select Datacenter, Network, and Folder

The Select Datacenter, Network, and Folder activity is deprecated starting with the Eureka release. Datacenter, network, and folder selection is handled by extension points.

19.1 Versions Prior to the Eureka Release

20 Select ESX Host and Datastore

The Select ESX Host and Datastore activity is deprecated starting with the Eureka release. ESX host and datastore selection is handled by extension points.

20.1 Versions Prior to the Eureka Release

21 Select IP Address

The Select IP Address activity is deprecated starting with the Eureka release. IP address selection is handled by extension points.

21.1 Versions Prior to the Eureka Release

22 Select Name

The Select Name activity is deprecated starting with the Eureka release. Name selection is handled by extension points.

22.1 Versions Prior to the Eureka Release

Was this article helpful?
Yes, I found what I needed
No, I need more assistance