74
Using VMware vCenter Orchestrator Plug-Ins vCenter Orchestrator 4.2.1 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs. EN-000784-00

Using VMware vCenter Orchestrator Plug-Ins - vCenter

  • Upload
    others

  • View
    70

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter OrchestratorPlug-Ins

vCenter Orchestrator 4.2.1

This document supports the version of each product listed andsupports all subsequent versions until the document is replacedby a new edition. To check for more recent editions of thisdocument, see http://www.vmware.com/support/pubs.

EN-000784-00

Page 2: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

2 VMware, Inc.

You can find the most up-to-date technical documentation on the VMware Web site at:

http://www.vmware.com/support/

The VMware Web site also provides the latest product updates.

If you have comments about this documentation, submit your feedback to:

[email protected]

Copyright © 2008 – 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright andintellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents.

VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marksand names mentioned herein may be trademarks of their respective companies.

VMware, Inc.3401 Hillview Ave.Palo Alto, CA 94304www.vmware.com

Page 3: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Contents

Using VMware vCenter Orchestrator Plug-Ins 7

1 Introduction to Orchestrator Plug-Ins 9

Orchestrator Architecture 9Default Orchestrator Plug-Ins 10Access the Orchestrator API Explorer 12

2 Using the vCenter Server 5.0.1 Plug-In 15

Configure the vCenter Server 5.0.1 Plug-In 15vCenter Server 5.0.1Plug-In Scripting API 16Using the vCenter Server Plug-In Inventory 16Access the vCenter Server Plug-In Workflow Library 16vCenter Server Plug-In Workflow Library 17

Batch Workflows 17Cluster and Compute Resource Workflows 17Custom Attributes Workflows 18Datacenter Workflows 18Datastore and Files Workflows 18Datacenter Folder Management Workflows 19Host Folder Management Workflows 19Virtual Machine Folder Management Workflows 19Basic Host Management Workflows 20Power Host Management Workflows 20Host Management Registration Workflows 20Networking Workflows 21Distributed Virtual Port Group Workflows 21Distributed Virtual Switch Workflows 21Standard Virtual Switch Workflows 22Resource Pool Workflows 22Storage Workflows 23Storage DRS Workflows 23Basic Virtual Machine Management Workflows 24Clone Workflows 25Linked Clone Workflows 25Linux Customization Clone Workflows 26Tools Clone Workflows 26Windows Customization Clone Workflows 27Device Management Workflows 27Move and Migrate Workflows 28Other Workflows 28Power Management Workflows 29Snapshot Workflows 29

VMware, Inc. 3

Page 4: Using VMware vCenter Orchestrator Plug-Ins - vCenter

VMware Tools Workflows 30

3 Using the vCO Library Plug-In 31

vCO Library Plug-In Workflows 31

4 Using the Database Plug-In 33

Database Plug-In Scripting API 33Connection Class 33JDBCConnection Class 33PreparedStatement Class 34ResultSet Class 34

Running the JDBC Sample Workflows 35Generate a JDBC URL 35Test a JDBC Connection 36Create a Table by Using JDBC 36Insert a Row into a JBCD Table 37Select Rows from a JDBC Table 37Delete an Entry from a JDBC Table 38Delete All Entries from a JDBC Table 38Drop a JDBC Table 39Run a Complete JDBC Cycle 39

5 Using the SSH Plug-In 41

Configure the SSH Plug-In 41SSH Plug-In Scripting API 42

SSH:File Type 42SSH:Folder Type 42SSH:RootFolder Type 42SSH:SshConnection Type 42KeyPairManager Class 42SSHCommand Class 43SSHFile Class 44SSHFolder Class 44SSHSession Class 45

Running the SSH Plug-In Sample Workflows 46Generate a Key Pair 46Change the Key Pair Passphrase 47Register an Orchestrator Public Key on an SSH Host 47Run an SSH Command 48Copy a File from an SSH Host 48Copy a File to an SSH Host 49

6 Using the XML Plug-In 51

XML Plug-In Scripting API 51XMLDocument Class 51XMLElement Class 52XMLManager Class 53XMLNamedNodeMap Class 53

Using VMware vCenter Orchestrator Plug-Ins

4 VMware, Inc.

Page 5: Using VMware vCenter Orchestrator Plug-Ins - vCenter

XMLNode Class 54XMLNodeList Class 55

Running the XML Plug-In Sample Workflows 55Create a Simple XML Document 55Find an Element in an XML Document 56Modify an XML Document 56Create an Example Address Book from XML 57

7 Using the Mail Plug-In 59

Define the Default SMTP Connection 59Mail Plug-In Scripting API 60

EmailMessage Class 60Email Scripting Examples 60Using the Mail Plug-In Sample Workflows 61

Access the Mail Plug-In Sample Workflows 61Mail Plug-In Sample Workflows 61Test an Example Interaction with Email 62

8 Using the Net Plug-In 63

Net Plug-In Scripting API 63FTPClient Class 63POP3Client Class 64POP3Message Class 65TelnetClient Class 66

9 Using the Enumeration Plug-In 67

Enumeration Plug-In Scrpting API 67Time Zone Codes 68

Index 71

Contents

VMware, Inc. 5

Page 6: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

6 VMware, Inc.

Page 7: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

The Using VMware vCenter Orchestrator Plug-Ins provides information and instructions about configuring andusing the official set of plug-ins installed with VMware® vCenter Orchestrator.

Intended AudienceThis information is intended for advanced vSphere administrators and experienced system administratorswho are familiar with virtual machine technology and datacenter operations.

VMware, Inc. 7

Page 8: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

8 VMware, Inc.

Page 9: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Introduction to Orchestrator Plug-Ins 1Plug-ins allow you to use Orchestrator to access and control external technologies and applications. Exposingan external technology in an Orchestrator plug-in allows you to incorporate objects and functions in workflowsthat access the objects and functions of that external technology.

The external technologies that you can access by using plug-ins can include virtualization management tools,email systems, databases, directory services, and remote control interfaces.

Orchestrator provides a set of standard plug-ins to allow you to incorporate such technologies as the VMwarevCenter Server API and email capabilities into workflows. In addition, the Orchestrator open plug-inarchitecture allows you to develop plug-ins to access other applications. Orchestrator implements openstandards, to simplify integration with external systems. For information about developing custom content,see Developing with VMware vCenter Orchestrator.

All default plug-ins are installed together with Orchestrator. Before you use some of them, for example thevCenter Server plug-in, you should configure the plug-ins.

Plug-ins extend the Orchestrator scripting engine with new object types and methods, and plug-ins publishnotification events from the external system that trigger events in Orchestrator and in the plugged-intechnology. Plug-ins provide an inventory of JavaScript objects that you can access on the OrchestratorInventory tab. Each plug-in can provide one or more packages of workflows and actions that you can run onthe objects in the inventory to automate the typical use cases of the integrated product.

This chapter includes the following topics:

n “Orchestrator Architecture,” on page 9

n “Default Orchestrator Plug-Ins,” on page 10

n “Access the Orchestrator API Explorer,” on page 12

Orchestrator ArchitectureOrchestrator contains a workflow library and a workflow engine to allow you to create and run workflowsthat automate orchestration processes. You run workflows on the objects of different technologies thatOrchestrator accesses through a series of plug-ins.

Orchestrator provides a standard set of plug-ins, including a plug-in for vCenter Server, to allow you toorchestrate tasks in the different environments that the plug-ins expose.

Orchestrator also presents an open architecture to allow you to plug in external third-party applications to theorchestration platform. You can run workflows on the objects of the plugged-in technologies that you defineyourself. Orchestrator connects to a directory services server to manage user accounts, and to a database tostore information from the workflows that it runs. You can access Orchestrator, the Orchestrator workflows,and the objects it exposes through the Orchestrator client interface, through a Web browser, or through Webservices.

VMware, Inc. 9

Page 10: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Figure 1-1. VMware vCenter Orchestrator Architecture

Orchestratordatabase

workflow library

vCenterServer XML SSH JDBC SMTP

3rd-partyplug-in

directoryservices

workflow engine

webservice

browseraccess

vCenterOrchestrator

Client application

vCenterServer

Default Orchestrator Plug-InsOrchestrator includes a collection of plug-ins. Each plug-in exposes an external product API to the Orchestratorplatform. Plug-ins provide inventory classes, extend the scripting engine with new object types, and publishnotification events from the external system. Each plug-in can also provide a library of workflows thatrepresents the typical use cases of the integrated product in an automated fashion.

You can see the list of available plug-ins from the Plug-ins tab in the Orchestrator configuration interface. Plug-ins that require configuration add separate tabs to the interface.

Table 1-1. Plug-Ins Installed with Orchestrator by Default

Plug-In Purpose Configuration Input Types Scripting Objects Inventory

vCenter Server5.0.1

Provides access to thevCenter Server 4.1 API, sothat you can incorporate allof the vCenter Server objectsand functions into themanagement processes thatyou use Orchestrator toautomate.

See “Configurethe vCenterServer 5.0.1 Plug-In,” on page 15.

See http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/index.html.

See http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/index.html.

Exposes allvCenterServerobjects.

vCO Library Provides workflows that actas basic building blocks forcustomization andautomation of clientprocesses. The workflowlibrary includes templatesfor lifecycle management,provisioning, disasterrecovery, hot backup, andmany other standardprocesses. Sources of libraryprocesses are accessible andcan be copied and edited.

None See Developingwith VMwarevCenterOrchestrator,Using theOrchestrator API.

See Developing withVMware vCenterOrchestrator, Using theOrchestrator API.

Exposesnothing intheinventory.

Using VMware vCenter Orchestrator Plug-Ins

10 VMware, Inc.

Page 11: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Table 1-1. Plug-Ins Installed with Orchestrator by Default (Continued)

Plug-In Purpose Configuration Input Types Scripting Objects Inventory

Database Java Database Connectivity(JDBC) API is the industrystandard for database-independent connectivitybetween the Javaprogramming language anda wide range of databases.The databases include SQLdatabases and other tabulardata sources, such asspreadsheets or flat files. TheJDBC API provides a call-level API for SQL-baseddatabase access fromworkflows.

None None Connection

JDBCConnection

PreparedStatement

ResultSet

Exposesnothing intheinventory.

SSH Provides an implementationof the Secure Shell v2 (SSH-2)protocol. Allows remotecommand and file transfersessions with password andpublic key-basedauthentication in workflows.Optionally, the SSH plug-incan provide remote filesystem browsing directly inthe vCO inventory.

See “Configurethe SSH Plug-In,” on page 41.

File

Folder

RootFolder

SshConnection

KeyPairManager

SSHCommand

SSHFile

SSHFolder

SSHSession

Can exposeobjects in theinventory.

XML A complete DocumentObject Model (DOM) XMLparser that you canimplement in workflows.Alternatively, you can usethe ECMAScript for XML(E4X) implementation in theOrchestrator JavaScript API.

None None XMLDocument

XMLElement

XMLManager

XMLNameNodeMap

XMLNode

XMLNodeList

Exposesnothing intheinventory.

Mail Uses Simple Mail TransferProtocol (SMTP) to sendemail from workflows.

Set the defaultvalues for theEmailMessageobject to use.See “Define theDefault SMTPConnection,” onpage 59.

None EmailMessage Exposesnothing intheinventory.

Net Wraps the Jakarta ApacheCommons Net Library.Provides implementations ofTelnet, FTP, and POP3. ThePOP3 part allows readingemail. In combination withthe Mail plug-in, the Netplug-in provides full emailsending and receivingcapabilities in workflows.

None None FTPClient

POP3Client

POP3Message

TelnetClient

Exposesnothing intheinventory.

Chapter 1 Introduction to Orchestrator Plug-Ins

VMware, Inc. 11

Page 12: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Table 1-1. Plug-Ins Installed with Orchestrator by Default (Continued)

Plug-In Purpose Configuration Input Types Scripting Objects Inventory

Enumeration Provides commonenumerated types that can beused in workflows by otherplug-ins.

None JavaScriptEnumerations

None Exposesnothing intheinventory.

vCOWebOperator

A Web view that allows youto access the workflows inthe Orchestrator library andinteract with them across anetwork by using a Webbrowser. See AdministeringVMware vCenter Orchestrator,Weboperator Web View.

None None None Exposesnothing intheinventory.

Plug-In ComponentsEach plug-in is a DAR file package. The DAR files are stored in Orchestrator_installation_path\app-server\server\vmo\plugins on the Orchestrator server system. The components of each plug-in, such asworkflow categories and API modules, can use different naming conventions.

Table 1-2. Names of Plug-In Components

Plug-In Name in theConfiguration UI DAR Name

WorkflowCategories API Module

vCenter Server 5.0.1 o11nplugin-vsphere501.dar vCenter VC

vCO Library o11nplugin-library.dar LockingOrchestratorTroubleshooting

N/A

Database o11nplugin-jdbc.dar JDBC Database

SSH o11nplugin-ssh.dar SSH SSH

XML o11nplugin-xml.dar XML XML

Mail o11nplugin-mail.dar Mail Mail

Net o11nplugin-jakartacommonsnet.dar None Net

Commonenumerated types

o11nplugin-enums.dar None Enums

vCO WebOperator o11nplugin-weboperator.dar None N/A

Access the Orchestrator API ExplorerOrchestrator provides an API Explorer to allow you to search the Orchestrator API and see the documentationfor JavaScript objects that you can use in scripted elements.

You can consult an online version of the Scripting API for the vCenter Server plug-in on the Orchestratordocumentation home page.

Using VMware vCenter Orchestrator Plug-Ins

12 VMware, Inc.

Page 13: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Procedure

u Access the API Explorer from either the Orchestrator client or from the Scripting tabs of the workflow,policy, and action editors.

n To access the API Explorer from the Orchestrator client, click Tools > API Explorer in the Orchestratorclient tool bar.

n To access the API Explorer from the Scripting tabs of the workflow, policy, and action editors, clickSearch API on the left.

The API Explorer appears, allowing you to search all the objects and functions of the Orchestrator API.

What to do next

Use the API Explorer to write scripts for scriptable elements.

Chapter 1 Introduction to Orchestrator Plug-Ins

VMware, Inc. 13

Page 14: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

14 VMware, Inc.

Page 15: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the vCenter Server 5.0.1 Plug-In 2The vCenter Server 5.0.1 plug-in (VMware vCenter Orchestrator plug-in for vCenter Server 5.0.1) allowsinteraction between vCenter Orchestrator and vCenter Server.

You can use the vCenter Server 5.0.1 plug-in to manage multiple vCenter Server hosts. You can createworkflows that use the vCenter Server plug-in API to automate tasks in your vCenter Server environment.

The vCenter Server 5.0.1 plug-in maps the vCenter Server 5.0 API to the JavaScript that you can use inworkflows. The plug-in also provides actions that perform individual vCenter Server tasks that you can includein workflows.

The vCenter Server 5.0.1 plug-in provides a library of standard workflows that automate vCenter Server 5.0.1operations. For example, you can run workflows that create, clone, migrate, or delete virtual machines.

This chapter includes the following topics:

n “Configure the vCenter Server 5.0.1 Plug-In,” on page 15

n “vCenter Server 5.0.1 Plug-In Scripting API,” on page 16

n “Using the vCenter Server Plug-In Inventory,” on page 16

n “Access the vCenter Server Plug-In Workflow Library,” on page 16

n “vCenter Server Plug-In Workflow Library,” on page 17

Configure the vCenter Server 5.0.1 Plug-InOrchestrator uses the vCenter Web Service API to control vCenter Server. You can set the parameters to enableOrchestrator to connect to your vCenter Sever instances.

Prerequisites

Import the SSL certificates for each vCenter Server instance you define. See Installing and Configuring VMwarevCenter Orchestrator.

Procedure

1 Log in to the Orchestrator configuration interface as vmware.

2 Click vCenter Server 5.0.1.

3 Click New vCenter Server Host.

4 From the Available drop-down menu, select Enabled.

5 In the Host text box, type the IP address or the DNS name of the vCenter Server host.

6 In the Port text box, retain the default value, 443.

VMware, Inc. 15

Page 16: Using VMware vCenter Orchestrator Plug-Ins - vCenter

7 (Optional) Select the Secure channel check box to establish a secure connection to your vCenter Serverhost.

8 In the Path text box, retain the default value, /sdk.

This value is the location of the SDK that you use to connect to your vCenter Server instance.

9 In the User name and Password text boxes, type the credentials for Orchestrator to use to establish theconnection to the vCenter Server host.

The user that you select must be a valid user with administrative privileges on your vCenter Server,preferably at the top of the vCenter Server tree structure. Orchestrator uses these credentials to monitorthe vCenter Web service, typically to operate Orchestrator system workflows. All other requests inheritthe credentials of the user who triggers an action.

10 Select the method you use to manage user access on the vCenter Server host.

Option Description

Share a unique session Allows Orchestrator to create only one connection to vCenter Server. Typethe credentials of a user who is a vCenter Server administrator.

Session per user CAUTION Each user who logs in to Orchestrator creates a new session tovCenter Server. This might rapidly use CPU, memory, and bandwidth.Select this option if your vCenter Server is in an Active Directory domain.Make sure that the user has the necessary permissions to perform therequired operations.

11 Click Apply changes.

The URL to the newly configured vCenter Server host is added to the list of defined hosts.

12 Repeat Step 3 through Step 11 for each vCenter Server instance.

vCenter Server 5.0.1Plug-In Scripting APIThe vCenter Server scripting API contains classes, with their respective attributes, methods, and constructorsthat allow interaction between vCenter Orchestrator and vCenter Server. You can use the API to developcustom workflows.

For a list of available API objects, see http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/index.html.

Using the vCenter Server Plug-In InventoryThe vCenter Server plug-in exposes all objects of the connected vCenter Server hosts in the Inventory view.You can use the Inventory view to add authorization elements or to run workflows on vCenter Server objects.

If the Use contextual menu in inventory option is enabled, all of the workflows that you can run on the selectedinventory object appear in a contextual menu.

Access the vCenter Server Plug-In Workflow LibraryYou must use the Orchestrator client to access the elements from the vCenter Server plug-in workflow library.

Prerequisites

n The vCenter Server plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run vCenter workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

Using VMware vCenter Orchestrator Plug-Ins

16 VMware, Inc.

Page 17: Using VMware vCenter Orchestrator Plug-Ins - vCenter

2 Expand the hierarchical list to Library > vCenter.

What to do next

Review the workflow library.

vCenter Server Plug-In Workflow LibraryThe vCenter Server plug-in workflow library contains workflows that you can use to run automated processesrelated to the management of vCenter Server.

Batch WorkflowsBatch workflows populate configuration elements or run workflows on a selected vCenter Server object.

You access the batch workflows from Library > vCenter > Batch.

Fill batch configurationelements

Populates the configuration elements that the Run a workflow on a selectionof objects workflow uses. Performs the following tasks:

n Resets the BatchObject and BatchAction configuration elements.

n Fills the BatchObject configuration element with all of the workflows thathave only one input parameter.

n Fills the BatchAction configuration element with all of the actions that haveno input parameters or one input parameter and that have an array as thereturnType.

Run a workflow on aselection of objects

Runs a workflow on a selection of vCenter Server objects, taking one action asinput. This is the action that retrieves the list of objects on which to run theworkflow. To return the objects without running the selected workflow, runthe workflow in simulation mode.

Cluster and Compute Resource WorkflowsWith cluster and compute resource workflows, you can create, rename or delete a cluster, and enable or disablehigh availability on a cluster.

You access the cluster and compute resource workflows from Library > vCenter > Cluster and ComputeResource.

Add DRS virtual machinegroup to cluster

Adds a DRS virtual machine group to a cluster.

Add virtual machines toDRS group

Adds a virtual machine list to an existing DRS virtual machine group.

Create cluster Creates a new cluster in a host folder.

Delete cluster Deletes a cluster.

Disable DRS on cluster Disables DRS on a cluster.

Disable HA on cluster Disables high availability on a cluster.

Enable DRS on cluster Enables DRS on a cluster.

Enable HA on cluster Enables high availability on a cluster.

Remove virtual machineDRS group from cluster

Removes a DRS virtual machine group from a cluster.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 17

Page 18: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Remove virtualmachines from DRSgroup

Removes virutal machines from a cluster DRS group.

Rename cluster Renames a cluster.

Custom Attributes WorkflowsWith custom attributes workflows, you can add custom attributes to virtual machines or get a custom attributefor a virtual machine.

You access the custom attributes workflows from Library > vCenter > Custom Attributes.

Add custom attribute toa virtual machine

Adds a custom attribute to a virtual machine.

Add custom attribute tomultiple virtualmachines

Adds a custom attribute to a selection of virtual machines.

Get custom attribute Gets a custom attribute for a virtual machine in vCenter Server.

Datacenter WorkflowsWith datacenter workflows, you can create, delete, reload, rename, or rescan a datacenter.

You access the datacenter workflows from Library > vCenter > Datacenter.

Create datacenter Creates a new datacenter in a datacenter folder.

Delete datacenter Deletes a datacenter.

Reload datacenter Forces vCenter Server to reload data from a datacenter.

Rename datacenter Renames a datacenter and waits for the task to complete.

Rescan datacenterHBAs

Scans the hosts in a datacenter and initiates a rescan on the host bus adaptersto discover new storage.

Datastore and Files WorkflowsWith datastore and files workflows, you can delete a list of files, find unused files in a datastore, and so on.

You access the datastore and files workflows from Library > vCenter > Datastore and Files.

Delete all files Deletes a list of files.

Delete all unuseddatastore files

Searches all datastores in the vCenter Server environment and deletes allunused files.

Export unused datastorefiles

Searches all datastores and creates an XML descriptor file that lists all unusedfiles.

Find unused files indatastores

Searches the vCenter Server environment for all unused disks (*.vmdk), virtualmachines (*.vmx), and template (*.vmtx) files that are not associated with anyvCenter Server instances registered with Orchestrator.

Get all configuration,template, and disk filesfrom virtual machines

Creates a list of all virtual machine descriptor files and a list of all virtualmachine disk files, for all datastores.

Using VMware vCenter Orchestrator Plug-Ins

18 VMware, Inc.

Page 19: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Log all datastore files Creates a log for every virtual machine configuration file and every virtualmachine file found in all datastores.

Log unused datastorefiles

Searches the vCenter Server environment for unused files that are registeredon virtual machines and exports a log of the files in a text file.

Datacenter Folder Management WorkflowsWith datacenter folder management workflows, you can create, delete, or rename a datacenter folder.

You access the datacenter folder management workflows from Library > vCenter > Folder management >Datacenter folder.

Create datacenter folder Creates a datacenter folder.

Delete datacenter folder Deletes a datacenter folder and waits for the task to complete.

Rename datacenterfolder

Renames a datacenter folder and waits for the task to complete.

Host Folder Management WorkflowsWith host folder management workflows, you can create, delete, or rename a host folder.

You access the host folder management workflows from Library > vCenter > Folder management > Hostfolder.

Create host folder Creates a host folder.

Delete host folder Deletes a host folder and waits for the task to complete.

Rename host folder Renames a host folder and waits for the task to complete.

Virtual Machine Folder Management WorkflowsWith virtual machine folder management workflows, you can create, delete, or rename a virtual machinefolder.

You access the virtual machine folder management workflows from Library > vCenter > Foldermanagement > VM folder.

Create virtual machinefolder

Creates a virtual machine folder.

Delete virtual machinefolder

Deletes a virtual machine folder and waits for the task to complete.

Rename virtual machinefolder

Renames a virtual machine folder and waits for the task to complete.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 19

Page 20: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Basic Host Management WorkflowsWith basic host management workflows, you can put a host into maintenance mode, make a host exitmaintenance mode, move a host to a folder or a cluster, and reload data from a host.

You access the basic host management workflows from Library > vCenter > Host management > Basic.

Enter maintenancemode

Puts the host into maintenance mode. You can cancel the task.

Exit maintenance mode Exits maintenance mode. You can cancel the task.

Move host into cluster Moves an existing host into a cluster. The host must be part of the samedatacenter, and if the host is part of a cluster, the host must be in maintenancemode.

Move host to folder Moves a host into a folder as a standalone host. The host must be part of aClusterComputeResource in the same datacenter and the host must be inmaintenance mode.

Reload host Forces vCenter Server to reload data from a host.

Power Host Management WorkflowsWith power host management workflows you can reboot or shut down a host.

You access the power host management workflows from Library > vCenter > Host management > Power.

Reboot host Reboots a host. If the Orchestrator client is connected directly to the host, itdoes not receive an indication of success in the returned task, but rather losesthe connection to the host if the operation succeeds.

Shut down host Shuts down a host. If the Orchestrator client is connected directly to the host,it does not receive an indication of success in the returned task, but rather losesthe connection to the host if the operation succeeds.

Host Management Registration WorkflowsWith host management registration workflows, you can add a host to a cluster, disconnect or reconnect a hostfrom a cluster, and so on.

You access the host management registration workflows from Library > vCenter > Host management >Registration.

Add host to cluster Adds a host to the cluster. This workflow fails if it cannot authenticate the SSLcertificate of the host.

Add standalone host Registers a host as a standalone host.

Disconnect host Disconnects a host from vCenter Server.

Reconnect host Reconnects a disconnected host by providing only the host information.

Reconnect host with allinformation

Reconnects a disconnected host by providing all information about the host.

Remove host Removes a host and unregisters it from vCenter Server. If the host is part of acluster, you must put it in maintenance mode before attempting to remove it.

Using VMware vCenter Orchestrator Plug-Ins

20 VMware, Inc.

Page 21: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Networking WorkflowsWith networking workflows you can add a port group to distributed virtual switch, create a distributed virtualswitch with a port group, and so on.

You access the networking workflows from Library > vCenter > Networking.

Add port group todistributed virtual switch

Adds a new distributed virtual port group to a specified distributed virtualswitch.

Attach host system todistributed virtual switch

Adds a host to a distributed virtual switch.

Create distributed virtualswitch with port group

Creates a new distributed virtual switch with a distributed virtual port group.

Distributed Virtual Port Group WorkflowsWith distributed virtual port group workflows you can update or delete a port group, and reconfigure the portgroup.

You access the distributed virtual port group workflows from Library > vCenter > Networking > Distributedvirtual port group.

Connect virtual machineNIC number todistributed virtual portgroup

Reconfigures the network connection of the specified virtual machine NICnumber to connect to the specified distributed virtual port group. If no NICnumber is specified, the number zero is used.

Delete distributed virtualport group

Deletes a specified distributed virtual port group.

Set teaming options Provides an interface to manage the teaming options for a distributed virtualport group.

Update distributedvirtual port group

Updates the configuration of a specified distributed virtual port group.

Distributed Virtual Switch WorkflowsWith distributed virtual switch workflows, you can create, update or delete a distributed virtual switch, andcreate, delete, or update a private VLAN.

You access the distributed virtual switch workflows from Library > vCenter > Networking > Distributedvirtual switch.

Create distributed virtualswitch

Creates a distributed virtual switch in the specified network folder with a nameand uplink port names that you specify. You must specify at least one uplinkport name.

Create private VLAN Creates a VLAN on the specified distributed virtual switch.

Delete distributed virtualswitch

Deletes a distributed virtual switch and all port groups, uplink ports and soon, that are associated with the switch.

Delete private VLAN Deletes a VLAN from a specified distributed virtual switch. If a secondaryVLAN exists, you should first delete the secondary VLAN.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 21

Page 22: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Update distributedvirtual switch

Updates the properties of a distributed virtual switch.

Update private VLAN Updates a VLAN on the specified distributed virtual switch.

Standard Virtual Switch WorkflowsWith standard virtual switch workflows you can create, update, or delete a standard virtual switch, and create,delete, or update port groups in standard virtual switches.

You access the standard virtual switch workflows from Library > vCenter > Networking > Standard virtualswitch.

Add port group instandard virtual switch

Adds a port group in a standard virtual switch.

Create standard virtualswitch

Creates a standard virtual switch.

Delete port group fromstandard virtual switch

Deletes a port group from a standard virtual switch.

Delete standard virtualswitch

Deletes a standard virtual switch from a host's network configuration.

Retrieve all standardvirtual switches

Retrieves all standard virtual switches from a host.

Update port group instandard virtual switch

Updates the properties of a port group in a standard virtual switch.

Update standard virtualswitch

Updates the properties of a standard virtual switch.

Update VNIC for portgroup in standard virtualswitch

Updates a VNIC associated to a port group in a standard virtual switch.

Resource Pool WorkflowsWith resource pool workflows you can create, rename, reconfigure or delete a resource pool, and get resourcepool information.

You access the resource pool workflows from Library > vCenter > Resource Pool.

Create resource pool Creates a resource pool with the default CPU and memory allocation values.To create a resource pool in a cluster, the cluster must have VMware DRSenabled.

Create resource poolwith specified values

Creates a resource pool with CPU and memory allocation values that youspecify. To create a resource pool in a cluster, the cluster must have VMwareDRS enabled.

Delete resource pool Deletes a resource pool and waits for the task to complete.

Get resource poolinformation

Returns CPU and memory information about a given resource pool.

Using VMware vCenter Orchestrator Plug-Ins

22 VMware, Inc.

Page 23: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Reconfigure resourcepool

Reconfigures CPU and memory allocation configuration for a given resourcepool.

Rename resource pool Renames a resource pool and waits for the task to complete.

Storage WorkflowsWith storage workflows you can perform storage-related operations.

You access the storage workflows from Library > vCenter > Storage.

Add datastore oniSCSI/FC/local SCSI

Creates a datastore on a Fibre Channel, iSCSI or local SCSI disk. Only disks thatare not currently in use by an existing VMFS are applicable to new datastorecreation. The new datastore allocates the maximum available space of thespecified disk.

Add datastore on NFS Adds a datastore on an NFS server.

Add iSCSI target Adds iSCSI send and static targets to a vCenter Server host.

Create VMFS for allavailable disks

Creates a VMFS volume for all available disks of a specified host.

Delete datastore Deletes datastores from a vCenter Server host.

Delete iSCSI target Deletes an already configured iSCSI send and static target.

Disable iSCSI adapter Disables the software iSCSI adapter of a specified host.

Display all datastoresand disks

Displays the existing datastores and available disks on a specified host.

Enable iSCSI adapter Enables an iSCSI adapter.

List all storage adapters Lists all storage adapters of a specified host.

Storage DRS WorkflowsWith storage DRS workflows you perform storage-related operations, such as creating and configuring adatastore cluster, removing a datastore from cluster, adding storage to a cluster, and so on.

You access the storage DRS workflows from Library > vCenter > Storage > Storage DRS.

Add datastore to cluster Adds datastores to a datastore cluster. Datastores must be able to connect toall hosts to be included in the datastore cluster. Datastores must have the sameconnection type to reside within a datastore cluster.

Change Storage DRS pervirtual machineconfiguration

Sets Storage DRS settings for each virtual machine.

Configure datastorecluster

Configures datastore cluster setting values for automation and runtime rules.

Create simple datastorecluster

Creates a simple datastore cluster with default configuration. The newdatastore cluster contains no datastores.

Create Storage DRSscheduled task

Creates a scheduled task for reconfiguring a datastore cluster. Only automationand runtime rules can be set.

Create virtual machineanti-affinity rule

Creates an anti-affinity rule to indicate that all virtual disks of certain virtualmachines must be kept on different datastores.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 23

Page 24: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Create VMDK anti-affinity rule

Creates a VMDK anti-affinity rule for a virtual machine that indicates whichof its virtual disks must be kept on different datastores. The rule applies to thevirtual disks of the selected virtual machine.

Remove datastorecluster

Removes a datastore cluster. Removing a datastore cluster also removes all ofthe settings and the alarms for the cluster from the vCenter Server system.

Remove datastore fromcluster

Removes a datastore from a datastore cluster and puts the datastore in adatastore folder.

Remove Storage DRSscheduled task

Removes a scheduled Storage DRS task.

Remove virtual machineanti-affinity rule

Removes a virtual machine anti-affinity rule for a given datastore cluster.

Remove VMDK anti-affinity rule

Removes a VMDK anti-affinity rule for a given datastore cluster.

Basic Virtual Machine Management WorkflowsWith basic virtual machine management workflows you can perform basic operations on virtual machines, forexample, create, rename or delete a virtual machine, upgrade virtual hardware, and so on.

You access the basic virtual machine management workflows from Library > vCenter > Virtual Machinemanagement > Basic.

Create custom virtualmachine

Creates a virtual machine with the specified configuration options andadditional devices.

Create simpledvPortGroup virtualmachine

Creates a simple virtual machine. The network used is a Distributed VirtualPort Group.

Create simple virtualmachine

Creates a virtual machine with the most common devices and configurationoptions.

Delete virtual machine Removes a virtual machine from the inventory and datastore.

Mark as template Converts an existing virtual machine to a template, not allowing it to start. Youcan use templates to create virtual machines.

Mark as virtual machine Converts an existing template to a virtual machine, allowing it to start.

Move virtual machine tofolder

Moves a virtual machine to a specified virtual machine folder.

Move virtual machine toresource pool

Moves a virtual machine to a resource pool. If the target resource pool is not inthe same cluster, you must use the migrate or relocate workflows.

Move virtual machines tofolder

Moves several virtual machines to a specified virtual machine folder.

Move virtual machines toresource pool

Moves several virtual machines to a resource pool.

Register virtual machine Registers a virtual machine. The virtual machine files must be placed in anexisting datastore and must not be already registered.

Reload virtual machine Forces vCenter Server to reload a virtual machine.

Using VMware vCenter Orchestrator Plug-Ins

24 VMware, Inc.

Page 25: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Rename virtual machine Renames an existing virtual machine on the vCenter Server system or host andnot on the datastore.

Set virtual machineperformance

Changes performance settings such as shares, minimum and maximum values,shaping for network, and disk access of a virtual machine.

Unregister virtualmachine

Removes an existing virtual machine from the inventory.

Upgrade VM Hardware(force if required)

Upgrades the virtual machine hardware to the latest revision that the hostsupports. This workflow forces the upgrade to continue, even if VMware Toolsis out of date. If the VMware Tools is out of date, forcing the upgrade tocontinue reverts the guest network settings to the default settings. To avoidthis situation, upgrade VMware Tools before running the workflow.

Upgrade virtual machine Upgrades the virtual hardware to the latest revision that the host supports. Aninput parameter allows a forced upgrade even if VMware Tools is out of date.

Wait for task and answervirtual machine question

Waits for a vCenter Server task to complete or for the virtual machine to ask aquestion. If the virtual machine requires an answer, accepts user input andanswers the question.

Clone WorkflowsWith clone workflows you can clone virtual machines with or without customizing the virtual machineproperties.

You access the clone workflows from Library > vCenter > Virtual Machine management > Clone.

Clone virtual machinefrom properties

Clones virtual machines by using properties as input parameters.

Clone virtual machine,no customization

Clones a virtual machine without changing anything except the virtualmachine UUID.

Customize virtualmachine from properties

Customizes a virtual machine by using properties as input parameters.

Linked Clone WorkflowsWith linked clone workflows, you can perform linked clone operations such as restoring a virtual machinefrom a linked clone, creating a linked clone, and so on.

You access the linked clone workflows from Library > vCenter > Virtual Machine management > Clone >Linked Clone.

Restore virtual machinefrom linked clone

Removes a virtual machine from a linked clone setup.

Set up virtual machinefor linked clone

Prepares a virtual machine to be link cloned.

Linked clone, Linux withmultiple NICs

Creates a linked clone of a Linux virtual machine, performs the guest operatingsystem customization, and configures up to four virtual network cards.

Linked clone, Linux withsingle NIC

Creates a linked clone of a Linux virtual machine, performs the guest operatingsystem customization, and configures one virtual network card.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 25

Page 26: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Linked clone, Windowswith multiple NICs andcredential

Creates a linked clone of a Windows virtual machine and performs the guestoperating system customization. Configures up to four virtual network cardsand a local administrator user account.

Linked clone, Windowswith single NIC andcredential

Creates a linked clone of a Windows virtual machine and performs the guestoperating system customization. Configures one virtual network card and alocal administrator user account.

Linked clone, nocustomization

Creates the specified number of linked clones of a given virtual machine.

Linux Customization Clone WorkflowsWith Linux customization workflows you can clone a Linux virtual machine and customize the guest operatingsystem.

You access the Linux customization clone workflows from Library > vCenter > Virtual Machinemanagement > Clone > Linux Customization.

Clone, Linux withmultiple NICs

Clones a Linux virtual machine, performs the guest operating systemcustomization, and configures up to four virtual network cards.

Clone, Linux with singleNIC

Clones a Linux virtual machine, performs the guest operating systemcustomization, and configures one virtual network card.

Tools Clone WorkflowsWith tools clone workflows you can obtain customization information about the operating system of the virtualmachine, information needed to update a virtual device, and so on.

You access the tools clone workflows from Library > vCenter > Virtual Machine management > Clone >Tools.

Get Linux customization Returns the Linux customization preparation.

Get NIC setting map Returns the setting map for a virtual network card by usingVimAdapterMapping.

Get Windowscustomization, Sysprepwith Unattended.txt

Returns customization information about the Microsoft Sysprep process byusing an Unattended.txt file. Workflows for cloning Windows virtual machinesuse this workflow.

Get Windowscustomization, Sysprepwith credentials

Returns customization information about the Microsoft Sysprep process, withcredentials. Workflows for cloning Windows virtual machines use thisworkflow.

Get Windowscustomization forSysprep

Returns customization information about the Microsoft Sysprep process.Workflows for cloning Windows virtual machines use this workflow.

Get aVirtualEthernetCard tochange the network

Returns a new ethernet card to update a virtual device. Contains only the devicekey of the given virtual device and the new network.

Get multipleVirtualEthernetCarddevice changes

Returns an array of VirtualDeviceConfigSpec objects for add and removeoperations on VirtualEthernetCard objects.

Using VMware vCenter Orchestrator Plug-Ins

26 VMware, Inc.

Page 27: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Windows Customization Clone WorkflowsWith Windows customization clone workflows you can clone Windows virtual machines and customize theguest operating system.

You access the Windows customization clone workflows from Library > vCenter > Virtual Machinemanagement > Clone > Windows Customization.

Customize, Windowswith single NIC andcredential

Performs guest operating system customization, configures one virtualnetwork card and a local administrator user account on a Windows virtualmachine.

Clone thin provisioned,Windows with single NICand credential

Clones a Windows virtual machine performing the guest operating systemcustomization. Specifies virtual disk thin provisioning policy and configuresone virtual network card and a local administrator user account. Sysprep toolsmust be available on the vCenter Server system.

Clone, WindowsSysprep with single NICand credential

Clones a Windows virtual machine performing the guest operating systemcustomization. Configures one virtual network card and a local administratoruser account. Sysprep tools must be available on vCenter Server.

Clone, Windows withmultiple NICs andcredential

Clones a Windows virtual machine performing the guest operating systemcustomization. Configures the local administrator user account and up to fourvirtual network cards. Sysprep tools must be available on the vCenter Serversystem.

Clone, Windows withsingle NIC

Clones a Windows virtual machine performing the guest operating systemcustomization and configures one virtual network card. Sysprep tools must beavailable on the vCenter Server system.

Clone, Windows withsingle NIC and credential

Clones a Windows virtual machine performing the guest operating systemcustomization. Configures one virtual network card and a local administratoruser account. Sysprep tools must be available on the vCenter Server system.

Device Management WorkflowsWith device management workflows you can manage the devices that are connected to a virtual machine orto a host datastore.

You access the device management workflows from Library > vCenter > Virtual Machine management >Device Management.

Add CD-ROM Adds a virtual CD-ROM to a virtual machine. If the virtual machine has no IDEcontroller, the workflow creates one.

Add disk Adds a virtual disk to a virtual machine.

Change RAM Changes the amount of RAM of a virtual machine.

Convert disks to thinprovisioning

Converts thick-provisioned disks of virtual machines to thin-provisioneddisks.

Convert independentdisks

Converts all independent virtual machine disks to normal disks by removingthe independent flag from the disks.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 27

Page 28: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Disconnect alldetachable devices froma running virtualmachine

Disconnects floppy disks, CD-ROM drives, parallel ports, and serial ports froma running virtual machine.

Mount floppy disk drive Mounts a floppy disk drive FLP file from the ESX datastore.

Move and Migrate WorkflowsWith move and migrate workflows, you can migrate virtual machines.

You access the move and migrate workflows from Library > vCenter > Virtual Machine management > Moveand Migrate.

Mass migrate virtualmachines with storagevMotion

Uses Storage vMotion to migrate a single virtual machine, a selection of virtualmachines, or all available virtual machines.

Mass migrate virtualmachines with vMotion

Uses vMotion, Storage vMotion, or both vMotion and Storage vMotion tomigrate a single virtual machine, a selection of virtual machines, or all availablevirtual machines.

Migrate virtual machinewith vMotion

Migrates a virtual machine from one host to another by using theMigrateVM_Task operation from the vSphere API.

Move virtual machine toanother vCenter Server

Moves a list of virtual machines to another vCenter Server system.

Quick migrate multiplevirtual machines

Suspends the virtual machines if they are powered on and migrates them toanother host using the same storage.

Quick migration ofvirtual machine

Suspends the virtual machine if it is powered on and migrates it to another hostusing the same storage.

Relocate virtual machinedisks

Relocates virtual machine disks to another host or datastore while the virtualmachine is powered off by using the RelocateVM_Task operation from thevSphere API.

Other WorkflowsWith other workflows, you can enable and disable Fault Tolerance (FT), extract virtual machine information,and find orphaned virtual machines.

You access these workflows fromLibrary > vCenter > Virtual Machine management > Others.

Disable FT Disables Fault Tolerance for a specified virtual machine.

Enable FT Enables Fault Tolerance for a specified virtual machine.

Extract virtual machineinformation

Returns the virtual machine folder, host system, resource pool, computeresource, datastore, hard drive sizes, CPU and memory, network, and IPaddress for a given virtual machine. Might require VMware Tools.

Find orphaned virtualmachines

Lists all virtual machines in an orphaned state in the Orchestrator inventory.Lists the VMDK and VMTX files for all datastores in the Orchestrator inventorythat have no association with any virtual machines in the Orchestratorinventory. Sends the lists by email (optional).

Using VMware vCenter Orchestrator Plug-Ins

28 VMware, Inc.

Page 29: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Power Management WorkflowsWith power management workflows, you can power on and off virtual machines, reboot the guest operatingsystem of a virtual machine, suspend a virtual machine, and so on.

You access the power management workflows fromLibrary > vCenter > Virtual Machine management >Power Management.

Power off virtualmachine and wait

Powers off a virtual machine and waits for the process to complete.

Reboot guest OS Reboots the virtual machine's guest operating system. Does not resetnonpersistent virtual machines. VMware Tools must be running.

Reset virtual machineand wait

Resets a virtual machine and waits for the process to complete.

Resume virtual machineand wait

Resumes a suspended virtual machine and waits for the process to complete.

Set guest OS to standby Sets the guest operating system to standby mode. VMware Tools must berunning.

Shut down and deletevirtual machine

Shuts down a virtual machine and deletes it from the inventory and disk.

Shut down guest OS andwait

Shuts down a guest operating system and waits for the process to complete.

Start virtual machine andwait

Starts a virtual machine and waits for VMware Tools to start.

Suspend virtual machineand wait

Suspends a virtual machine and waits for the process to complete.

Snapshot WorkflowsWith snapshot workflows, you can perform snapshot-related operations.

You access the snapshot workflows from Library > vCenter > Virtual Machine management > Snapshot.

Create a snapshot Creates a snapshot.

Create snapshots of allvirtual machines in aresource pool

Creates a snapshot of each virtual machine in a resource pool.

Remove all snapshots Removes all existing snapshots without reverting to a previous snapshot.

Remove excesssnapshots

Finds virtual machines with more than a given number of snapshots andoptionally deletes the oldest snapshots. Sends the results by email.

Remove old snapshots Gets all snapshots that are older than a given number of days and prompts theuser to select which ones to delete.

Remove snapshots of agiven size

Gets all snapshots that are larger than a given size and prompts the user toconfirm deletion.

Chapter 2 Using the vCenter Server 5.0.1 Plug-In

VMware, Inc. 29

Page 30: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Revert to currentsnapshot

Reverts to the current snapshot.

Revert to snapshot andwait

Reverts to a specific snapshot. Does not delete the snapshot.

VMware Tools WorkflowsWith VMware Tools workflows, you can perform VMware Tools-related tasks on virtual machines.

You access the VMware Tools workflows from Library > vCenter > Virtual Machine management > VMwareTools.

Mount tools installer Mounts the VMware Tools installer on the virtual CD-ROM.

Set console screenresolution

Sets the console window's resolution. The virtual machine must be poweredon.

Turn on timesynchronization

Turns on time synchronization between the virtual machine and the ESX serverin VMware Tools.

Unmount tools installer Unmounts the VMware Tools CD-ROM.

Upgrade tools Upgrades VMware Tools on a virtual machine.

Upgrade tools at nextreboot

Upgrades VMware Tools on a virtual machine without performing anautomatic reboot.

Using VMware vCenter Orchestrator Plug-Ins

30 VMware, Inc.

Page 31: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the vCO Library Plug-In 3You can use the vCO Library plug-in workflows as templates for customization and automation of clientprocesses, and to troubleshoot Orchestrator.

vCO Library Plug-In WorkflowsThe vCO Library plug-in provides the workflows in the Locking, Orchestrator, and Troubleshooting workflowcategories.

Locking WorkflowsYou access these workflows from Library > Locking in the Workflows view of the Orchestrator client.

Display all locks Shows all locks.

Locking test A test workflow that creates a lock.

Locking test (x5) A test workflow that creates five locks.

Release all locks Releases all locks.

Orchestrator Task WorkflowsYou access these workflows from Library > Orchestrator > Task in the Workflows view of the Orchestratorclient.

Create recurrent task Creates a recurrent task an returns the newly created task.

Create task Schedules a workflow to run at a later time and date, as a task.

Orchestrator WorkflowsYou access these workflows from Library > Orchestrator > Task in the Workflows view of the Orchestratorclient.

Start workflows in aseries

Runs a workflow multiple times in a series, one instance after the other. Youprovide workflow parameters in an array, providing a property list, with oneproperty per workflow input, for each instance of the workflow that starts. Thenumber of properties in the array define the number of workflow runs.

Start workflows inparallel

Runs a workflow multiple times, with different parameters. You provideworkflow parameters in an array, providing a property list, with one propertyper workflow input, for each instance of the workflow that starts. The numberof properties in the array define the number of workflow runs.

VMware, Inc. 31

Page 32: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Troubleshooting WorkflowsYou access these workflows from Library > Troubleshooting in the Workflows view of the Orchestrator client.

Export logs andapplication settings

Generates a ZIP archive of troubleshooting information that containsconfiguration files, server, configuration, wrapper, and installation log files.The output directory must exist and write access must be permitted.

Using VMware vCenter Orchestrator Plug-Ins

32 VMware, Inc.

Page 33: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the Database Plug-In 4You can use the API that the Database plug-in provides to implement connectivity to SQL databases and othertabular data sources, such as spreadsheets or flat files.

The Database plug-in API which is based on JDBC, provides a call-level API for SQL-based database access.The Database plug-in also provides sample workflows that demonstrate how to use the API in workflows.

This chapter includes the following topics:

n “Database Plug-In Scripting API,” on page 33

n “Running the JDBC Sample Workflows,” on page 35

Database Plug-In Scripting APIThe Database scripting API contains classes, with their respective methods, that enable interaction betweenvCenter Orchestrator and SQL-based databases. You can use the API to create workflows that read data fromand write data to SQL-based databases.

Connection ClassThe Connection class contains methods that control the connection to a database.

The Connection class defines the following methods.

Method Returns Description

close():Object Object Releases the database and JDBCresources for a Connection object.

createStatement():Object Object Creates a Statement object for sendingSQL statements to the database.

prepareCall(string):PreparedStatement

PreparedStatement Creates a CallableStatement objectfor calling database stored procedures.

prepareStatement(string):PreparedStatement

PreparedStatement Creates a PreparedStatement objectfor sending parameterized SQLstatements to the database.

JDBCConnection ClassThe JDBCConnection class contains a method that specifies the URL and credentials for a connection to adatabase.

The Connection class defines the following method.

VMware, Inc. 33

Page 34: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

getConnection(string,string,string):Connection

Connection The three strings represent URL, username, and password.

PreparedStatement ClassThe PreparedStatement class represents a precompiled SQL statement.

The PreparedStatement class defines the following methods.

Method Returns Description

execute():boolean Boolean Runs an SQL statement in thePreparedStatement object.

executeQuery():ResultSet ResultSet Runs an SQL query in thePreparedStatement object and returnsthe ResultSet object generated by thequery.

executeUpdate():number Number Runs an SQL INSERT, UPDATE, orDELETE statement, or an SQLstatement that returns nothing, in thePreparedStatement object.

setDate(number,object):Object Object Sets a designated parameter to the givenDate value.

setString(number,object):Object Object Sets a designated parameter to the givenString value.

setTimestamp(number,object):Object

Object Sets a designated parameter to the givenTimestamp value.

ResultSet ClassThe ResultSet class is the result of a run of an executeQuery method.

The ResultSet class defines the following methods.

Method Returns Description

afterLast():Object Object Moves the cursor to the end of theResultSet object, after the last row.This method has no effect if the resultset contains no rows.

beforeFirst():Object Object Moves the cursor to the front of theResultSet object, before the first row.This method has no effect if the resultset contains no rows.

first():boolean Boolean Moves the cursor to the first row in theResultSet object. Returns true if thecursor is on a valid row, and false ifthere are no rows in the result set.

getDate(string):Object Object Returns the Date value of a givencolumn name.

getDateAt(number):Object Object Returns the Date value of a givencolumn index.

getNumber(string):number Number Returns the Number value of a givencolumn name.

Using VMware vCenter Orchestrator Plug-Ins

34 VMware, Inc.

Page 35: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

getNumberAt(number):number Number Returns the Number value of a givencolumn index.

getString(string):string String Returns the String value of a givencolumn name.

getStringAt(number):string String Returns the String value of a givencolumn index.

getTimestamp(string):Object Object Returns the Timestamp value of a givencolumn name.

getTimestampAt(number):Object Object Returns the Timestamp value of a givencolumn index.

last():boolean Boolean Moves the cursor to the last row in theResultSet object. Returns true if thecursor is on a valid row, and false ifthere are no rows in the result set.

next():boolean Boolean Moves the cursor down one row.Returns true if the cursor is on a validrow, and false if there are no morerows.

previous():boolean Boolean Moves the cursor to the previous row inthe ResultSet object. Returns true ifthe cursor is on a valid row, and falseif it is off the result set.

wasNull():boolean Boolean Reports whether the last column readhad a value of SQL NULL.

Running the JDBC Sample WorkflowsYou can run the Database plug-in sample workflows from the Orchestrator client to test SQL-based databaseoperations.

Generate a JDBC URLYou can run a workflow from the Orchestrator client to generate a JDBC connection URL.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC to navigate to the JDBC URL generator workflow.

3 Right-click the JDBC URL generator workflow and select Start workflow.

4 Select the type of database for which to generate a URL.

NOTE If you use a Microsoft database, you might need to provide the database instance name and databaseuser domain name.

5 Provide the required information to generate a database URL.

a Type a database server name or IP address.

b Type a database name.

Chapter 4 Using the Database Plug-In

VMware, Inc. 35

Page 36: Using VMware vCenter Orchestrator Plug-Ins - vCenter

c (Optional) Type a database port number.

If you do not specify a port number, the workflow uses a default port number.

d Type a user name to access the database.

e Type a password to access the database.

6 Click Submit to run the workflow.

Test a JDBC ConnectionYou can run a workflow from the Orchestrator client to test the connection to a database.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBCconnection example workflow.

3 Right-click the JDBC connection example workflow and select Start workflow.

4 Provide the required information to test a database connection.

a Type a user name to access the database.

b Type the URL to test.

c Type a password to access the database.

5 Click Submit to run the workflow.

Create a Table by Using JDBCYou can run a workflow from the Orchestrator client to test the creation of a database.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC createtable example workflow.

3 Right-click the JDBC create table example workflow and select Start workflow.

4 Provide the required information to create a table.

a Type a password to access the database.

b Type a JDBC connection URL.

Using VMware vCenter Orchestrator Plug-Ins

36 VMware, Inc.

Page 37: Using VMware vCenter Orchestrator Plug-Ins - vCenter

c Type a user name to access the database.

d Type an SQL create statement.

An example syntax is:

CREATE TABLE "table_name"

("column1" "data_type_for_column1",

"column2" "data_type_for_column2")

5 Click Submit to run the workflow.

Insert a Row into a JBCD TableYou can run a workflow from the Orchestrator client to test the insertion of a row into a JDBC table.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC insertinto table example workflow.

3 Right-click the JDBC insert into table example workflow and select Start workflow.

4 Provide the required information to insert a row into a table.

a Type a JDBC connection URL.

b Type a user name to access the database.

c Type a password to access the database.

d Type an SQL insert statement.

An example syntax is:

INSERT INTO "table_name" ("column1", "column2")

VALUES ("value1", "value2")

e Type the values to insert into the row.

5 Click Submit to run the workflow.

Select Rows from a JDBC TableYou can run a workflow from the Orchestrator client to test the selection of rows from a JDBC table.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC selectfrom table example workflow.

3 Right-click the JDBC select from table example workflow and select Start workflow.

Chapter 4 Using the Database Plug-In

VMware, Inc. 37

Page 38: Using VMware vCenter Orchestrator Plug-Ins - vCenter

4 Provide the required information to select rows from a table.

a Type a JDBC connection URL.

b Type a user name to access the database.

c Type a password to access the database.

d Type an SQL select statement.

An example syntax is:

SELECT * FROM "table_name"

5 Click Submit to run the workflow.

Delete an Entry from a JDBC TableYou can run a workflow from the Orchestrator client to test the deletion of an entry from a JDBC table.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC deleteentry from table example workflow.

3 Right-click the JDBC delete entry from table example workflow and select Start workflow.

4 Provide the required information to delete an entry from a table.

a Type the first name of the user entry to be deleted.

b Type a user name to access the database.

c Type a JDBC connection URL.

d Type the last name of the user entry to be deleted.

e Type a password to access the database.

f Type an SQL delete statement.

An example syntax is:

DELETE FROM "table_name" where ("column1" = ?, "column2" = ?)

5 Click Submit to run the workflow.

Delete All Entries from a JDBC TableYou can run a workflow from the Orchestrator client to test the deletion of all entries from a JDBC table.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

Using VMware vCenter Orchestrator Plug-Ins

38 VMware, Inc.

Page 39: Using VMware vCenter Orchestrator Plug-Ins - vCenter

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC deleteall from table example workflow.

3 Right-click the JDBC delete all from table example workflow and select Start workflow.

4 Provide the required information to delete all all entries from a table.

a Type a JDBC connection URL.

b Type a user name to access the database.

c Type a password to access the database.

d Type an SQL delete statement.

An example syntax is:

DELETE FROM "table_name"

5 Click Submit to run the workflow.

Drop a JDBC TableYou can run a workflow from the Orchestrator client to test the dropping of a JDBC table.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the JDBC droptable example workflow.

3 Right-click the JDBC drop table example workflow and select Start workflow.

4 Provide the required information to drop a table from the database.

a Type a password to access the database.

b Type a JDBC connection URL.

c Type a user name to access the database.

d Type an SQL drop statement.

An example syntax is:

DROP TABLE "table_name"

5 Click Submit to run the workflow.

Run a Complete JDBC CycleYou can run a workflow from the Orchestrator client to test all JDBC example workflows in one full cycle.

Prerequisites

n The Database plug-in must be enabled in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run JDBC workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

Chapter 4 Using the Database Plug-In

VMware, Inc. 39

Page 40: Using VMware vCenter Orchestrator Plug-Ins - vCenter

2 In the workflows hierarchical list, open Library > JDBC > JDBC Examples to navigate to the Full JDBCcycle example workflow.

3 Right-click the Full JDBC cycle example workflow and select Start workflow.

4 Provide the required information to run a complete database cycle.

a Type a JDBC connection URL.

b Type a user name to access the database.

c Type a password to access the database.

d Type the values to be used as entries in the database.

5 Click Submit to run the workflow.

Using VMware vCenter Orchestrator Plug-Ins

40 VMware, Inc.

Page 41: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the SSH Plug-In 5You can use the SSH plug-in workflows to run SSH commands on a remote host that supports SSH and transferfiles between an Orchestrator server and a remote host through a secure connection.

This chapter includes the following topics:

n “Configure the SSH Plug-In,” on page 41

n “SSH Plug-In Scripting API,” on page 42

n “Running the SSH Plug-In Sample Workflows,” on page 46

Configure the SSH Plug-InYou can set up the SSH plug-in to ensure encrypted connections.

Procedure

1 Log in to the Orchestrator configuration interface as vmware.

2 Click SSH.

3 Click New connection.

4 In the Host name text box, enter the host to access with SSH through Orchestrator.

NOTE The username and password are not required because Orchestrator uses the credentials of thecurrently logged-in user to run SSH commands. You must reproduce the accounts you want to work onSSH on target hosts from the LDAP server.

5 Click Apply changes.

The host is added to the list of SSH connections.

6 (Optional) Configure an entry path on the server.

a Click New root folder.

b Enter the new path and click Apply changes.

The SSH host is available in the Inventory view of the Orchestrator client.

VMware, Inc. 41

Page 42: Using VMware vCenter Orchestrator Plug-Ins - vCenter

SSH Plug-In Scripting APIThe SSH scripting API contains classes, with their respective attributes, methods, and constructors, that allowOrchestrator to perform SSH operations from workflows. You can use the API to develop custom workflowsthat access a remote server through SSH.

SSH:File TypeThe SSH:File type uses the SSHFile class as its scripting object.

The SSH:File type contains the following properties.

n path

n name

n hostname

n port

SSH:Folder TypeThe SSH:Folder type uses the SSHFolder class as its scripting object.

The SSH:Folder type contains the following properties.

n path

n name

n hostname

n port

SSH:RootFolder TypeThe SSH:RootFolder type uses the SSHFolder class as its scripting object.

The SSH:RootFile type contains the following property.

n name

SSH:SshConnection TypeThe SSH:SshConnection type uses the FinderResult class as its scripting object.

The SSH:SshConnection type contains the following properties.

n name

n userName

KeyPairManager ClassThe KeyPairManager class contains a set of functions to manage private and public SSH keys.

The KeyPairManager class defines the following methods.

Using VMware vCenter Orchestrator Plug-Ins

42 VMware, Inc.

Page 43: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

changePassphrase(Path,SecureString,SecureString):Object

Object Changes the passphrase of a privatekey.

generateKeyPair(string,Path,SecureString,number,string):string

String Generates a pair of a public and aprivate key. Returns the generated keyfingerprint.

SSHCommand ClassThe SSHCommand class is the main class for running SSH commands from workflows.

The SSHCommand class defines the following constructors.

Constructor Description

SSHCommand(string,string,SecureString):SSHCommand Creates a new SSHCommand.

SSHCommand(string,string,string,number):SSHCommand Creates a new SSHCommand.

The SSHCommand class defines the following attributes.

Attribute Returns Description

cmd String Command to run

error String Command error, if anyNOTE The error message depends onyour operating system. The operatingsystem returns a string from the errormessages buffer.

exitCode Number Exit code of the last commandNOTE The exit code depends on youroperating system. Refer to youroperating system's documentation fordescriptions.

output String Command output, if any

state String Run state

The SSHCommand class defines the following methods.

Method Returns Description

disconnect():Object Object Disconnects the current session.

execute():Object Object Runs a single command and returnsimmediately. Leaves an open session.You can disconnect the sessionmanually.

executeAndLog(string):Object Object Runs a single command and waits untilit is completed.

executeCommand(string,boolean):string

String Runs a single command, waits until it iscompleted, and returns the stdoutresult, if synchronous. Leaves an opensession. You can disconnect the sessionmanually.

findAll(string,string):string[] Array of String Searches recursively and returns filesand directories that match a pattern.Leaves an open session. You candisconnect the session manually.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 43

Page 44: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

findDir(string,string):string[] Array of String Searches recursively and returnsdirectories that match a pattern. Leavesan open session. You can disconnect thesession manually.

findFile(string,string):string[]

Array of String Searches recursively and returns filesthat match a pattern. Leaves an opensession. You can disconnect the sessionmanually.

getFile(string,string):number Number Copies a file from a remote host to theOrchestrator server. Leaves an opensession. You can disconnect the sessionmanually. Returns 0 if successful, -1 ifan error has occured, and -2 if a fatalerror has occured.

listAll(string):string[] Array of String Lists files and directories in a path.Leaves an open session. You candisconnect the session manually.

listDir(string):string[] Array of String Lists directories in a path. Leaves anopen session. You can disconnect thesession manually.

listFile(string):string[] Array of String Lists files in a path. Leaves an opensession. You can disconnect the sessionmanually.

putFile(string,string):number Number Copies a file from the Orchestratorserver to a remote host. The destinationdirectory must exist. Returns 0 ifsuccessful, or -1 if an error has occured.

SSHFile ClassThe SSHFile class contains attributes for SSH access to files on a remote file system.

The SSHFile class defines the following attributes.

Attribute Returns Description

fileName String File name

hostname String SSH host name

name String File name

path String Full file path

port Number SSH port

SSHFolder ClassThe SSHFolder class contains attributes for SSH access to folders on a remote file system.

The SSHFolder class defines the following attributes.

Attribute Returns Description

folderName String Folder name

hostname String SSH host name

name String Folder name

Using VMware vCenter Orchestrator Plug-Ins

44 VMware, Inc.

Page 45: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Attribute Returns Description

path String Full folder path

port Number SSH port

SSHSession ClassThe SSHSession class is the main class for SSH session management.

The SSHSession class defines the following constructors.

Constructor Description

SSHSession(string,string):SSHSession Creates a new SSHSession.

SSHSession(string,string,number):SSHSession Creates a new SSHSession.

The SSHSession class defines the following attributes.

Attribute Returns Description

cmd String Command to run

error String Command error, if anyNOTE The error message depends onyour operating system. The operatingsystem returns a string from the errormessages buffer.

exitCode Number Exit code of the last commandNOTE The exit code depends on youroperating system. Refer to youroperating system's documentation fordescriptions.

output String Command output, if any

pty Boolean Requesting a pseudo-terminal

state String Run state

terminal String Terminal type

The SSHSession class defines the following methods.

Method Returns Description

addEnvironment(string,string):Object

Object Fills a property list of environmentvariables that are set prior to opening achannel.

connectWithIdentity(Path,SecureString):Object

Object Connects the session using public keyauthentication.

connectWithPassword(SecureString):Object

Object Connects the session using simplepassword authentication.

connectWithPasswordOrIdentity(boolean,SecureString,Path):Object

Object Connects the session using eitherpassword or public key authentication.

disconnect():Object Object Disconnects the current session.

execute():Object Object Runs a single command and returnsimmediately. Leaves an open session.You can disconnect the sessionmanually.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 45

Page 46: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

executeAndLog(string):Object Object Runs a single command and waits untilit is completed.

executeCommand(string,boolean):string

String Runs a single command, waits until it iscompleted, and returns the stdoutresult, if synchronous. Leaves an opensession. You can disconnect the sessionmanually.

findAll(Path,string):string[] Array of String Searches recursively and returns filesand directories that match a pattern.Leaves an open session. You candisconnect the session manually.

findDir(Path,string):string[] Array of String Searches recursively and returnsdirectories that match a pattern. Leavesan open session. You can disconnect thesession manually.

findFile(Path,string):string[] Array of String Searches recursively and returns filesthat match a pattern. Leaves an opensession. You can disconnect the sessionmanually.

getFile(Path,Path):number Number Copies a file from a remote host to theOrchestrator server. Leaves an opensession. You can disconnect the sessionmanually. Returns 0 if successful, -1 ifan error has occured, and -2 if a fatalerror has occured.

listAll(Path):string[] Array of String Lists files and directories in a path.Leaves an open session. You candisconnect the session manually.

listDir(Path):string[] Array of String Lists directories in a path. Leaves anopen session. You can disconnect thesession manually.

listFile(Path):string[] Array of String Lists files in a path. Leaves an opensession. You can disconnect the sessionmanually.

putFile(Path,Path):number Number Copies a file from the Orchestratorserver to a remote host. The destinationdirectory must exist. Returns 0 ifsuccessful, or -1 if an error has occured.

Running the SSH Plug-In Sample WorkflowsYou can run the SSH plug-in sample workflows from the Orchestrator client to test the connection betweenthe Orchestrator server and the SSH host.

Generate a Key PairYou can run a workflow from the Orchestrator client to generate a key pair. You can use the key pair to connectto an SSH host without a password.

A key pair consists of a public key and a private key. Orchestrator can use the private key to connect to thepublic key on an SSH host. You can use a passphrase to improve security.

CAUTION All Orchestrator users with the right set of privileges can read, use, and overwrite your private key.

Using VMware vCenter Orchestrator Plug-Ins

46 VMware, Inc.

Page 47: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the Generate key pair workflow.

3 Right-click the Generate key pair workflow and select Start workflow.

4 Provide the required information.

a Select the key type.

b Select the key size.

c (Optional) Type a passphrase.

NOTE You can change the passphrase later.

d (Optional) Type a comment.

5 Click Submit to run the workflow.

If a key pair exists, the new key pair overwrites it.

Change the Key Pair PassphraseYou can run a workflow from the Orchestrator client to change the passphrase for the key pair that yougenerated last.

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the Change key pair passphraseworkflow.

3 Right-click the Change key pair passphrase workflow and select Start workflow.

4 Reset the key pair passphrase.

a Type the current passphrase.

b Type the new passphrase.

5 Click Submit to run the workflow.

Register an Orchestrator Public Key on an SSH HostYou can use a public key instead of a password. To register an Orchestrator public key on an SSH host, youcan run a workflow from the Orchestrator client.

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 47

Page 48: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the Register vCO public key on hostworkflow.

3 Right-click the Register vCO public key on host workflow and select Start workflow.

4 Provide the host and authentication information.

NOTE You must provide credentials that are registered on the SSH host.

5 Click Submit to run the workflow.

You can use public key authentication instead of password authentication when you connect to the SSH hostas the registered user.

Run an SSH CommandYou can run a workflow from the Orchestrator client to run SSH commands on a remote ESX host.

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the Run SSH command workflow.

3 Right-click the Run SSH command workflow and select Start workflow.

4 Provide the required information.

a Type an SSH host name or IP.

b Type an SSH command to run.

NOTE The default SSH command is uptime. It shows how long the server has been active and theuser load for that period.

c (Optional) Select Yes to use password authentication.

NOTE The default option is to use key file authentication.

d Type the authentication information.

5 Click Submit to run the workflow.

Copy a File from an SSH HostYou can run a workflow from the Orchestrator client to copy files from an SSH host to the Orchestrator server.

The SSH plug-in uses the Java JCraft library, which implements SFTP. The SCP get command workflowtransfers files by using SFTP.

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Using VMware vCenter Orchestrator Plug-Ins

48 VMware, Inc.

Page 49: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the SCP get command workflow.

3 Right-click the SCP get command workflow and select Start workflow.

4 Provide the required information.

a Type an SSH host name or IP address.

b Type the SSH authentication information.

c Type the path to the directory on the Orchestrator server into which to copy the file.

d Type the path to the file to get from the remote SSH host.

5 Click Submit to run the workflow.

Copy a File to an SSH HostYou can run a workflow from the Orchestrator client to copy files from the Orchestrator server to an SSH host.

The SSH plug-in uses the Java JCraft library, which implements SFTP. The SCP put command workflowtransfers files by using SFTP.

Prerequisites

n The SSH plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run SSH workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > SSH to navigate to the SCP put command workflow.

3 Right-click the SCP put command workflow and select Start workflow.

4 Provide the required information.

a Type an SSH host name or IP address.

b Type the SSH authentication information.

c Type the path to the file that you want to copy from the local Orchestrator server to the remote SSHhost.

d Type the path to the directory on the remote SSH host into which to copy the file.

5 Click Submit to run the workflow.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 49

Page 50: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

50 VMware, Inc.

Page 51: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the XML Plug-In 6You can use the XML plug-in to run workflows that create and modify XML documents.

The XML plug-in adds an implementation of a Document Object Model (DOM) XML parser to the OrchestratorJavaScript API. The XML plug-in also provides some sample workflows to demonstrate how you can createand modify XML documents from workflows.

Alternatively, you can use the ECMAScript for XML (E4X) implementation in the Orchestrator JavaScript APIto process XML documents directly in JavaScript. For an E4X scripting example, see Developing with VMwarevCenter Orchestrator.

For information about E4X, go to the Web site of the organization that maintains the ECMA-357 standard.

This chapter includes the following topics:

n “XML Plug-In Scripting API,” on page 51

n “Running the XML Plug-In Sample Workflows,” on page 55

XML Plug-In Scripting APIThe XML scripting API contains classes, with their respective attributes and methods, that allow vCenterOrchestrator to manage XML documents. You can use the API to develop custom workflows.

XMLDocument ClassThe XMLDocument class is the main XML class.

The XMLDocument class defines the following methods.

Method Returns Description

appendChild(XMLNode):Object Object Adds a newChild node to the end of thelist of child nodes of this node. If thenewChild node exists in the tree, it isfirst removed.

cloneNode(boolean):Object Object Clones a node.

createCDATASection(Object):XMLNode

XMLNode Creates a CDATA node.

createComment(String):XMLNode XMLNode Creates a comment node.

createElement(String):XMLElement

XMLElement Creates an element with a given name.

createProcessingInstruction(String,String):XMLNode

XMLNode Creates a ProcessingInstruction nodewith specified name and data strings.

VMware, Inc. 51

Page 52: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

createTextNode(String):XMLNode XMLNode Creates a text node.

getChildNodes():Object Object Gets all child nodes.

getDocumentElement():XMLElement XMLElement Allows direct access to the child nodethat is at the root element of thedocument.

getElementsByTagName(String):Object

Object Returns an XMLNodeList of all elementswith a given tag name in the order inwhich they are encountered in a pre-ordered traversal of the XMLDocumenttree.

insertBefore(XMLNode,XMLNode):Object

Object Inserts a newChild node before theexisting child node refChild. IfrefChild is null, the newChild node isinserted at the end of list of child nodes.If the newChild node exists in the tree,it is first removed.

normalize():Object Object Normalizes the document.

removeChild(XMLNode):Object Object Removes the child node indicated byoldChild from the list of child nodesand returns it.

replaceChild(XMLNode,XMLNode):Object

Object Replaces the oldChild node with anewChild node in the list of child nodesand returns the oldChild node. If thenewChild node exists in the tree, it isfirst removed.

XMLElement ClassThe XMLElement class is the main element class.

The XMLElement class defines the following attributes.

Attribute Returns Description

tagName String The tag name

textContent String The text content

The XMLElement class defines the following methods.

Method Returns Description

appendChild(XMLNode):Object Object Adds a newChild node to the end of thelist of child nodes of this node. If thenewChild node exists in the tree, it isfirst removed.

cloneNode(boolean):Object Object Clones a node.

getAttributes():Object Object Contains the attributes of an element.

getChildNodes():XMLNodeList XMLNodeList Gets all child nodes.

getElementsByTagName(String):Object

Object Returns an XMLNodeList of all elementswith a given tag name in the order inwhich they are encountered in a pre-ordered traversal of the current elementtree.

Using VMware vCenter Orchestrator Plug-Ins

52 VMware, Inc.

Page 53: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

hasAttribute(String):boolean Boolean Returns true if the attribute exists.

insertBefore(XMLNode,XMLNode):Object

Object Inserts a newChild node before theexisting child node refChild. IfrefChild is null, the newChild node isinserted at the end of list of child nodes.If the newChild node exists in the tree,it is first removed.

normalize():Object Object Normalizes the node.

removeAttribute(String):Object Object Removes an attribute with a givenname.

removeChild(XMLNode):Object Object Removes the child node indicated byoldChild from the list of child nodesand returns it.

replaceChild(XMLNode,XMLNode):Object

Object Replaces the oldChild node with anewChild node in the list of child nodesand returns the oldChild node. If thenewChild node exists in the tree, it isfirst removed.

setAttribute(String,String):Object

Object Sets a new attribute.

XMLManager ClassThe XMLManager class is the main class for creation of XML document parsers.

The XMLManager class defines the following methods.

Method Returns Description

fromString(String):XMLDocument XMLDocument Gets a document for a given stringcontent.

getDocumentContent(XMLDocument):string

String Gets a document as a string.

loadDocument(String,boolean):XMLDocument

XMLDocument Gets a document for a given path usingthe default character encoding.

loadDocumentWithEncoding(String,String,boolean):XMLDocument

XMLDocument Gets a document for a given path usingthe specified character encoding.

newDocument():XMLDocument XMLDocument Creates an empty XML document.

saveDocument(XMLDocument,String,String,String):Object

Object Saves a document to a given path usingthe default character encoding.

saveDocumentWithEncoding(XMLDocument,String,String,String,String):Object

Object Saves a document to a given path usingthe specified character encoding.

validateDocument(XMLDocument,String,String):Object

Object Validates a document without saving it.

XMLNamedNodeMap ClassThe XMLNamedNodeMap class is the main class for node maps, usually used for attributes of an element.

The XMLNamedNodeMap class defines the following attribute.

Chapter 6 Using the XML Plug-In

VMware, Inc. 53

Page 54: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Attribute Returns Description

length Number The length of a list

The XMLNamedNodeMap class defines the following methods.

Method Returns Description

getNamedItem(string):XMLNode XMLNode Retrieves a node specified by name.

item(number):XMLNode XMLNode Retrieves a child node at index.

XMLNode ClassThe XMLNode class is the main node class.

The XMLNode class defines the following attributes.

Attribute Returns Description

nodeName String The node name

nodeValue String The node value

parentNode Object The parent node (XMLNode)

The XMLNode class defines the following methods.

Method Returns Description

appendChild(XMLNode):Object Object Adds a newChild node to the end of thelist of child nodes of this node. If thenewChild node exists in the tree, it isfirst removed.

cloneNode(boolean):Object Object Clones a node.

getChildNodes():XMLNodeList XMLNodeList Gets all child nodes.

insertBefore(XMLNode,XMLNode):Object

Object Inserts a newChild node before theexisting child node refChild. IfrefChild is null, the newChild node isinserted at the end of list of child nodes.If the newChild node exists in the tree,it is first removed.

normalize():Object Object Normalizes the node.

removeChild(XMLNode):Object Object Removes the child node indicated byoldChild from the list of child nodesand returns it.

insertBefore(XMLNode,XMLNode):Object

Object Inserts a newChild node before theexisting child node refChild. IfrefChild is null, the newChild node isinserted at the end of list of child nodes.If the newChild node exists in the tree,it is first removed.

replaceChild(XMLNode,XMLNode):Object

Object Replaces the oldChild node with anewChild node in the list of child nodesand returns the oldChild node. If thenewChild node exists in the tree, it isfirst removed.

Using VMware vCenter Orchestrator Plug-Ins

54 VMware, Inc.

Page 55: Using VMware vCenter Orchestrator Plug-Ins - vCenter

XMLNodeList ClassThe XMLNodeList class is the main class for node lists.

The XMLNodeList class defines the following attribute.

Attribute Returns Description

length Number The length of a list

The XMLNodeList class defines the following method.

Method Returns Description

item(number):Object Object Retrieves a child node at index.

Running the XML Plug-In Sample WorkflowsYou can run the XML plug-in sample workflows from the Orchestrator client to create and modify XMLdocuments for testing purposes.

Because the workflows can create, read, or modify files, you must have sufficient access rights to the workingdirectory.

Orchestrator has read, write, and execute rights to a folder named orchestrator, at the root of the server system.Although workflows have permission to read, write, and execute in this folder, you must create the folder onthe server system.

You can allow access to other folders by changing the settings for server file system access from workflowsand JavaScript. See Administering VMware vCenter Orchestrator, Setting Server File System Access from Workflowsand JavaScript.

Create a Simple XML DocumentYou can run a workflow from the Orchestrator client to create a simple XML document for testing purposes.

Prerequisites

n The XML plug-in must be enabled from the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run XML workflows.

n Verify that you created the c:/orchestrator folder at the root of the Orchestrator server system or setaccess rights to another folder.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > XML > Samples XML (Simple) to navigate to the Createa simple XML document workflow.

3 Right-click the Create a simple XML document workflow and select Start workflow.

4 Type the filepath to the XML document to create.

For example, c:/orchestrator/filename.xml.

5 Click Submit to run the workflow.

The workflow creates an XML document that contains a list of users. The attributes for each entry are userID and name.

Chapter 6 Using the XML Plug-In

VMware, Inc. 55

Page 56: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Find an Element in an XML DocumentYou can run a workflow from the Orchestrator client to find an element in the XML created by the Create asimple XML document workflow.

Prerequisites

n The XML plug-in must be enabled from the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run XML workflows.

n Verify that you created the c:/orchestrator folder at the root of the Orchestrator server system or setaccess rights to another folder.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > XML > Samples XML (Simple) to navigate to the Findelement in document workflow.

3 Right-click the Find element in document workflow and select Start workflow.

4 Type the filepath to the XML document.

For example, c:/orchestrator/filename.xml.

5 Click Submit to run the workflow.

The workflow searches for an element and displays the result in the system log.

What to do next

To view the result, select the completed workflow run in the Orchestrator client and click Logs on theSchema tab.

Modify an XML DocumentYou can run a workflow from the Orchestrator client to modify the XML that the Create a simple XMLdocument workflow creates.

Prerequisites

n The XML plug-in must be enabled from the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run XML workflows.

n Verify that you created the c:/orchestrator folder at the root of the Orchestrator server system or setaccess rights to another folder.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > XML > Samples XML (Simple) to navigate to the ModifyXML document workflow.

3 Right-click the Modify XML document workflow and select Start workflow.

Using VMware vCenter Orchestrator Plug-Ins

56 VMware, Inc.

Page 57: Using VMware vCenter Orchestrator Plug-Ins - vCenter

4 Provide the input and output filepaths.

a Type the filepath to the XML document to modify.

For example, c:/orchestrator/filename.xml.

b Type the filepath to the modified XML document.

For example, c:/orchestrator/filename.xml.

NOTE If you type the same filepath in both fields, the workflow overwrites the original file with themodified file. If you type an output filepath to a file that does not exist, the workflow creates a modifiedfile.

5 Click Submit to run the workflow.

The workflow searches for an element and modifies the entry where the element is found.

Create an Example Address Book from XMLYou can run a workflow from the Orchestrator client to create an address book for testing purposes.

Prerequisites

n The XML plug-in must be enabled from the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run XML workflows.

n Verify that you created the c:/orchestrator folder at the root of the Orchestrator server system or setaccess rights to another folder.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > XML > Samples XML (Address Book) to navigate tothe Full address book test workflow.

3 Right-click the Full address book test workflow and select Start workflow.

4 Type the path to the address book folder.

For example, c:/orchestrator/foldername.

The workflow automatically creates the folder if it does not exist.

5 Click Submit to run the workflow.

The workflow creates a DTD, an XML, and a CSS file, appends the stylesheet, and stores the files in the specifiedfolder.

Chapter 6 Using the XML Plug-In

VMware, Inc. 57

Page 58: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

58 VMware, Inc.

Page 59: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the Mail Plug-In 7You can send email messages from workflows by using the Mail plug-in, which uses the Simple Mail TransferProtocol (SMTP). For example, you can create a workflow to send an email to a given address if the workflowrequires user interaction or when it completes its run.

This chapter includes the following topics:

n “Define the Default SMTP Connection,” on page 59

n “Mail Plug-In Scripting API,” on page 60

n “Email Scripting Examples,” on page 60

n “Using the Mail Plug-In Sample Workflows,” on page 61

Define the Default SMTP ConnectionThe Mail plug-in is installed with Orchestrator Server and is used for email notifications. The only optionavailable for this plug-in is to use default values for new mail messages. You can set the default email account.

Avoid load balancers when configuring mail in Orchestrator. You might receive SMTP_HOST_UNREACHABLE error.

Procedure

1 Log in to the Orchestrator configuration interface as vmware.

2 Click Mail.

3 Select the Define default values check box and fill in the required text boxes.

Text box Description

SMTP host Enter the IP address or domain name of your SMTP server.

SMTP port Enter a port number to match your SMTP configuration.The default SMTP port is 25.

User name Enter a valid email account.This is the email account Orchestrator uses to send emails.

Password Enter the password associated with the user name.

From name and address Enter the sender information to appear in all emails sent by Orchestrator.

4 Click Apply changes.

VMware, Inc. 59

Page 60: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Mail Plug-In Scripting APIThe Mail scripting API contains one class, with its respective attributes and methods, that allow vCenterOrchestrator workflows to send email messages. You can use the API to develop custom workflows.

EmailMessage ClassThe EmailMessage class is the main class for creating email messages that you want to send from workflows.

The EmailMessage class defines the following attributes.

Attribute Returns Description

bccAddress String Comma-separated list of blind carboncopy email address entries

ccAddress String Comma-separated list of carbon copyemail address entries

fromAddress String Sender's email address

fromName String Sender's name

password String Password for authentication

smtpHost String SMTP host name or IP address

smtpPort Number SMTP port number (default is 25)

subject String Email subject

toAddress String Comma-separated list of email addressentries

username String User name for authentication

The EmailMessage class defines the following methods.

Method Returns Description

addMimePart(Object,String):void Void Adds a MIME part to the message.

sendMessage():void Void Sends an email message.

Email Scripting ExamplesWorkflow scripted elements can include scripting of common email-related tasks. You can cut, paste, and adaptthese examples into your scripted elements.

When you run a mail workflow, it uses the default mail server configuration that you set in the Orchestratorconfiguration interface. You can override the default values by using input parameters, or by defining customvalues in workflow scripted elements.

Obtain an Email AddressThe following JavaScript example obtains the email address of the current owner of a running script.

var emailAddress = Server.getRunningUser().emailAddress ;

Using VMware vCenter Orchestrator Plug-Ins

60 VMware, Inc.

Page 61: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Send an EmailThe following JavaScript example sends an email to the defined recipient, through an SMTP server, with thedefined content.

var message = new EmailMessage() ;

message.smtpHost = "smtpHost" ;

message.subject= "my subject" ;

message.toAddress = "[email protected]" ;

message.fromAddress = "[email protected]" ;

message.addMimePart("This is a simple message","text/html") ;

message.sendMessage() ;

Using the Mail Plug-In Sample WorkflowsYou can call the sample workflows of the Mail plug-in from custom workflows to implement emailfunctionality. You can run an example workflow to test interaction with email.

Access the Mail Plug-In Sample WorkflowsYou must use the Orchestrator client to access the Mail plug-in sample workflows.

Prerequisites

n The Mail plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run Mail workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 Expand the hierarchical list to Library > Mail.

What to do next

Review the sample workflows.

Mail Plug-In Sample WorkflowsYou can integrate the sample Mail plug-in workflows in custom workflows.

Retrieve messages Retrieves the messages of a given email account by using the POP3 protocol.

Send interaction Sends an email to answer a user interaction. The email body contains both thedirect answer URL, and an interaction URL to process this request. If optionalparameters are not specified, the workflow uses the default values set in theOrchestrator configuration interface.

Send notification Sends an email with specified content to a given email address. If optionalparameters are not specified, the workflow uses the default values set in theOrchestrator configuration interface.

Send notification tomailing list

Sends an email with specified content to a given email address list, CC list, andBCC list. If optional parameters are not specified, the workflow uses the defaultvalues set in the Orchestrator configuration interface.

Chapter 7 Using the Mail Plug-In

VMware, Inc. 61

Page 62: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Test an Example Interaction with EmailYou can run a workflow from the Orchestrator client to send an email to respond to a query, known as a userinteraction.

The workflow uses the default mail server configuration that you set in the Orchestrator configurationinterface. See “Define the Default SMTP Connection,” on page 59.

Prerequisites

n The Mail plug-in must be enabled and configured in the Orchestrator configuration interface.

n You must be logged in to the Orchestrator client as a user who can run Mail workflows.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, open Library > Mail to navigate to the Example interaction with emailworkflow.

3 Right-click the Example interaction with email workflow and select Start workflow.

4 Provide the required information.

a Type a recipient address.

b Select an LDAP group of users who are authorized to answer the query.

5 Click Submit to run the workflow.

The workflow suspends its run and sends an email to the given address. The email body contains a link to theweboperator Web view. If weboperator is running, the user can answer the request for interaction directly inweboperator, allowing the workflow to finish its run.

Using VMware vCenter Orchestrator Plug-Ins

62 VMware, Inc.

Page 63: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the Net Plug-In 8You can use the Net plug-in to implement the Telnet, FTP, and POP3 protocols in workflows. The POP3 partallows reading email. In combination with the Mail plug-in, the Net plug-in provides full email sending andreceiving capabilities in workflows.

Net Plug-In Scripting APIThe Net scripting API contains classes, with their respective attributes, methods, and constructors, that allowvCenter Orchestrator workflows to implement Telnet, POP3, and FTP functionality. You can use the API todevelop custom workflows.

FTPClient ClassThe FTPClient class is the main class for implementing FTP functionality into workflows.

The FTPClient class defines the FTPClient():FTPClient constructor.

The FTPClient class defines the following attributes.

Attribute Returns Description

connectTimeout number Socket connection timeout

cwd String Current working directory

output String Command output if any

replyCode Number Last reply code

soLinger Number Socket SO Linger (null if disabled)

state String Run state

tcpNoDelay Boolean Socket TCP no delay

timeout Number Socket timeout

The FTPClient class defines the following methods.

Method Returns Description

connect(String,number) : Object Object Connects the client to a host.

disconnect() : Object Object Logs out and disconnects the currentsession if open.

enableSSL(boolean) : Object Object Enables SSL.

executeCommand(String,String) :number

Number Runs a command.

VMware, Inc. 63

Page 64: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

getFile(String,String) : Number Number Copies a file from a remote host to theOrchestrator server.

getStatus() : String String Provides the status informationreturned by the server.

getString(String) : String String Gets the content of a remote file.

isAvailable() : boolean Boolean Makes checks on the socket to testwhether it is available for use.

isConnected() : boolean Boolean Provides information if the client iscurrently connected to a server.

listAll(String) : String[] Array of String Lists all files and directories in a path.

listDir(String) : String[] Array of String Lists directories in a path.

listFile(String) : String[] Array of String Lists files in a path.

login(String,String,String) :boolean

Boolean Logs in on an FTP server.

putFile(String,String) : Number Number Copies a file from the Orchestratorserver to a remote host.

putString(String,String) :Number

Number Puts a string of content to a remote file.

POP3Client ClassThe POP3Client class is the main class for implementing POP3 functionality into workflows.

The POP3Client class defines the POP3Client():POP3Client constructor.

The POP3Client class defines the following attributes.

Attribute Returns Description

connectTimeout Number Socket connect timeout

output String Command output if any

soLinger Number Socket SO Linger (null if disabled)

state String Connection state

tcpNoDelay Boolean Socket TCP no delay

timeout Number Socket timeout

The POP3Client class defines the following methods.

Method Returns Description

connect(String,number):Object Object Connects the client to a host.

disconnect():Object Object Disconnects the client from the server.

enableSSL(boolean):Object Object Enables SSL.

isAvailable():Boolean Boolean Makes checks on the socket to test if it isavailable for use.

isConnected():Boolean Boolean Provides information if the client iscurrently connected to a server.

Using VMware vCenter Orchestrator Plug-Ins

64 VMware, Inc.

Page 65: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Method Returns Description

listMessages():POP3Message[] Array of POP3Message Lists all messages. If there are nomessages, the method returns a zerolength array. If the operation fails, themethod returns null.

login(String,String):boolean Boolean Logs in on POP3 server with the givenuser name and password. You must firstconnect to the server with theconnect() method, before attemptingto log in.

loginWithSecret(String,String,String):boolean

Boolean Logs in on POP3 server with the givenuser name and authenticationinformation.

logout():Object Object Logs out of the POP3 server. To fullydisconnect from the server, you mustcall the disconnect() method.

noop():Object Object Sends a NOOP command to the POP3server. This is useful for keeping theconnection alive.

reset():Object Object Resets the POP3 session. This is usefulfor undoing any message deletions thatmight have been performed.

POP3Message ClassThe POP3Message class provides POP3 email functionality.

The POP3Message class defines the following attributes.

Attribute Returns Description

body String Message body

from String Sender

id Number Message ID in current session

subject String Message subject

to String Recepient

The POP3Message class defines the following methods.

Method Returns Description

deleteFromServer():Object Object Deletes a message from the POP3server. The server marks the messagefor deletion but does not delete itimmediately. If you decide to unmarkthe message, you must use call thereset() command from thePOP3Client class. The server deletes allmessages marked for deletion whenyou call the logout() command fromthe POP3Client class.

getHeader(String):string String Gets the header value.

Chapter 8 Using the Net Plug-In

VMware, Inc. 65

Page 66: Using VMware vCenter Orchestrator Plug-Ins - vCenter

TelnetClient ClassThe TelnetClient class is the main class for implementing Telnet functionality into workflows.

The TelnetClient class defines the TelnetClient(String):TelnetClient constructor.

The TelnetClient class defines the following attributes.

Attribute Returns Description

soLinger Number Socket SO Linger (null if disabled)

tcpNoDelay Boolean Socket TCP no delay

timeout Number Socket timeout

The TelnetClient class defines the following methods.

Method Returns Description

connect(String,number):Object Object Connects the client to a host.

disconnect():Object Object Disconnects the client.

enableSSL(boolean):Object Object Enables SSL.

receiveAsBinary():Object[] Array of Object Gets a response as an array of numbers.

receiveAsString():string String Gets a response as a string.

sendBinary(Object[]):Object Object Sends binary information as an array ofnumbers.

sendString(String):Object Object Sends a string command.

waitForData(Number):boolean Boolean Waits for data to become available andreturns true if data is available orfalse if the request times out.

Using VMware vCenter Orchestrator Plug-Ins

66 VMware, Inc.

Page 67: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using the Enumeration Plug-In 9You can use the Enumeration plug-in to implement common enumerated types in workflows.

This chapter includes the following topics:

n “Enumeration Plug-In Scrpting API,” on page 67

n “Time Zone Codes,” on page 68

Enumeration Plug-In Scrpting APIThe Enums scripting API contains common enumerated types.

Table 9-1. Common Enumerated Types

Enumeration Name Possible Values Description

Enums:Backup All: Configuration file and all disksConfig: Configuration file onlyNone: No backup at allSystem: Configuration file and firstdisk

Kind of backup

Enums:Disk 0: No disk2: 2GB4: 4GB8: 8GB12: 12GB16: 16GB20: 20GB60: 60GB80: 80GB100: 100GB120: 120GB160: 160GB

Possible disk sizes

Enums:Environment Validation: ValidationenvironmentsTest: Test environmentsDevelopment: DevelopmentenvironmentsProduction: Productionenvironments

Type of deployment environment

Enums:MSTimeZone See “Time Zone Codes,” on page 68. Time zones

VMware, Inc. 67

Page 68: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Table 9-1. Common Enumerated Types (Continued)

Enumeration Name Possible Values Description

Enums:Performance Low: Low (20%)Medium: Medium (60%)High: High (80%)

Type of performance

Enums:RAM 128: 128MB256: 256MB512: 512MB1024: 1GB2048: 2GB3584: 3.5GB (ESX 2 maximum)4096: 4GB6144: 6GB8192: 8GB10240: 10GB12288: 12GB14336: 14GB16384: 16GB

Possible RAM sizes

Enums:vCPU 1: Virtual machine with 1 virtual CPU2: Virtual machine with 2 virtual CPUs3: Virtual machine with 3 virtual CPUs4: Virtual machine with 4 virtual CPUs5: Virtual machine with 5 virtual CPUs6: Virtual machine with 6 virtual CPUs7: Virtual machine with 7 virtual CPUs8: Virtual machine with 8 virtual CPUs

Number of virtual CPUs

Time Zone CodesYou can use the time zone codes as possible values for the Enums:MSTimeZone enumeration.

Time Zone Code Time Zone Name Description

000 Dateline Standard Time (GMT-12:00) International Date LineWest

001 Samoa Standard Time (GMT-11:00) Midway Island, Samoa

002 Hawaiian Standard Time (GMT-10:00) Hawaii

003 Alaskan Standard Time (GMT-09:00) Alaska

004 Pacific Standard Time (GMT-08:00) Pacific Time (US andCanada); Tijuana

010 Mountain Standard Time (GMT-07:00) Mountain Time (US andCanada)

013 Mexico Standard Time 2 (GMT-07:00) Chihuahua, La Paz,Mazatlan

015 U.S. Mountain Standard Time (GMT-07:00) Arizona

020 Central Standard Time (GMT-06:00) Central Time (US andCanada)

025 Canada Central Standard Time (GMT-06:00) Saskatchewan

Using VMware vCenter Orchestrator Plug-Ins

68 VMware, Inc.

Page 69: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Time Zone Code Time Zone Name Description

030 Mexico Standard Time (GMT-06:00) Guadalajara, Mexico City,Monterrey

033 Central America Standard Time (GMT-06:00) Central America

035 Eastern Standard Time (GMT-05:00) Eastern Time (US andCanada)

040 U.S. Eastern Standard Time (GMT-05:00) Indiana (East)

045 S.A. Pacific Standard Time (GMT-05:00) Bogota, Lima, Quito

050 Atlantic Standard Time (GMT-04:00) Atlantic Time (Canada)

055 S.A. Western Standard Time (GMT-04:00) Caracas, La Paz

056 Pacific S.A. Standard Time (GMT-04:00) Santiago

060 Newfoundland and LabradorStandard Time

(GMT-03:30) Newfoundland andLabrador

065 E. South America Standard Time (GMT-03:00) Brasilia

070 S.A. Eastern Standard Time (GMT-03:00) Buenos Aires,Georgetown

073 Greenland Standard Time (GMT-03:00) Greenland

075 Mid-Atlantic Standard Time (GMT-02:00) Mid-Atlantic

080 Azores Standard Time (GMT-01:00) Azores

083 Cape Verde Standard Time (GMT-01:00) Cape Verde Islands

085 GMT Standard Time (GMT) Greenwich Mean Time : Dublin,Edinburgh, Lisbon, London

090 Greenwich Standard Time (GMT) Casablanca, Monrovia

095 Central Europe Standard Time (GMT+01:00) Belgrade, Bratislava,Budapest, Ljubljana, Prague

100 Central European Standard Time (GMT+01:00) Sarajevo, Skopje, Warsaw,Zagreb

105 Romance Standard Time (GMT+01:00) Brussels, Copenhagen,Madrid, Paris

110 W. Europe Standard Time (GMT+01:00) Amsterdam, Berlin, Bern,Rome, Stockholm, Vienna

113 W. Central Africa Standard Time (GMT+01:00) West Central Africa

115 E. Europe Standard Time (GMT+02:00) Bucharest

120 Egypt Standard Time (GMT+02:00) Cairo

125 FLE Standard Time (GMT+02:00) Helsinki, Kyiv, Riga,Sofia, Tallinn, Vilnius

130 GTB Standard Time (GMT+02:00) Athens, Istanbul, Minsk

135 Israel Standard Time (GMT+02:00) Jerusalem

140 South Africa Standard Time (GMT+02:00) Harare, Pretoria

145 Russian Standard Time (GMT+03:00) Moscow, St. Petersburg,Volgograd

150 Arab Standard Time (GMT+03:00) Kuwait, Riyadh

155 E. Africa Standard Time (GMT+03:00) Nairobi

158 Arabic Standard Time (GMT+03:00) Baghdad

160 Iran Standard Time (GMT+03:30) Tehran

Chapter 9 Using the Enumeration Plug-In

VMware, Inc. 69

Page 70: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Time Zone Code Time Zone Name Description

165 Arabian Standard Time (GMT+04:00) Abu Dhabi, Muscat

170 Caucasus Standard Time (GMT+04:00) Baku, Tbilisi, Yerevan

175 Transitional Islamic State ofAfghanistan Standard Time

(GMT+04:30) Kabul

180 Ekaterinburg Standard Time (GMT+05:00) Ekaterinburg

185 West Asia Standard Time (GMT+05:00) Islamabad, Karachi,Tashkent

190 India Standard Time (GMT+05:30) Chennai, Kolkata,Mumbai, New Delhi

193 Nepal Standard Time (GMT+05:45) Kathmandu

195 Central Asia Standard Time (GMT+06:00) Astana, Dhaka

200 Sri Lanka Standard Time (GMT+06:00) Sri Jayawardenepura

201 N. Central Asia Standard Time (GMT+06:00) Almaty, Novosibirsk

203 Myanmar Standard Time (GMT+06:30) Yangon (Rangoon)

205 S.E. Asia Standard Time (GMT+07:00) Bangkok, Hanoi, Jakarta

207 North Asia Standard Time (GMT+07:00) Krasnoyarsk

210 China Standard Time (GMT+08:00) Beijing, Chongqing, HongKong SAR, Urumqi

215 Singapore Standard Time (GMT+08:00) Kuala Lumpur, Singapore

220 Taipei Standard Time (GMT+08:00) Taipei

225 W. Australia Standard Time (GMT+08:00) Perth

227 North Asia East Standard Time (GMT+08:00) Irkutsk, Ulaan Bataar

230 Korea Standard Time (GMT+09:00) Seoul

235 Tokyo Standard Time (GMT+09:00) Osaka, Sapporo, Tokyo

240 Yakutsk Standard Time (GMT+09:00) Yakutsk

245 A.U.S. Central Standard Time (GMT+09:30) Darwin

250 Cen. Australia Standard Time (GMT+09:30) Adelaide

255 A.U.S. Eastern Standard Time (GMT+10:00) Canberra, Melbourne,Sydney

260 E. Australia Standard Time (GMT+10:00) Brisbane

265 Tasmania Standard Time (GMT+10:00) Hobart

270 Vladivostok Standard Time (GMT+10:00) Vladivostok

275 West Pacific Standard Time (GMT+10:00) Guam, Port Moresby

280 Central Pacific Standard Time (GMT+11:00) Magadan, SolomonIslands, New Caledonia

285 Fiji Islands Standard Time (GMT+12:00) Fiji Islands, Kamchatka,Marshall Islands

290 New Zealand Standard Time (GMT+12:00) Auckland, Wellington

300 Tonga Standard Time (GMT+13:00) Nuku'alofa

Using VMware vCenter Orchestrator Plug-Ins

70 VMware, Inc.

Page 71: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Index

AAPI Explorer, accessing 12audience 7

Bbasic host management workflows 20basic virtual machine workflows 24batch workflows 17

Cclone workflows 25cluster and compute resource workflows 17custom attributes workflows 18

DDatabase plug-in

scripting API 33usage 33

Database plug-in APIconnecting to a database 33Connection class 33database connection parameters 33JDBCConnection class 33precompiled SQL statement 34PreparedStatement class 34ResultSet class 34

Database plug-in sample workflows 35datacenter folder management folder 19datacenter workflows 18datastore and files workflows 18default plug-ins 10device management workflows 27distributed virtual port group workflows 21distributed virtual switch workflows 21

EEnumeration plug-in

Enums:MSTimeZone values 68scrpting API 67usage 67

Hhost folder management workflows 19host management registration workflows 20

Iintroduction 9

JJDBC connection, testing 36JDBC dropping, testing 39JDBC entry deletion, testing 38JDBC full cycle, testing 39JDBC plug-in, usage 33JDBC row insertion, testing 37JDBC row selection, testing 37JDBC sample workflows 35JDBC table creation, testing 36JDBC URL generator 35

Llinked clone workflows 25Linux customization clone workflows 26load balancing 59

MMail plug-in

sample workflows access 61scripting API 60usage 59

Mail plug-in API, EmailMessage class 60Mail plug-in sample workflows 61Mail plug-in workflows, example interaction with

email 62move and migrate workflows 28

NNet plug-in

scripting API 63usage 63

Net plug-in APIFTPClient class 63POP3Client class 64POP3Message class 65TelnetClient class 66

networking workflows 21

OOrchestrator architecture 9overview of

Database plug-in 10Enumeration plug-in 10

VMware, Inc. 71

Page 72: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Mail plug-in 10Net plug-in 10overview of 10SSH plug-in 10vCenter Server 4.1 plug-in 10vCO Library plug-in 10vCO Weboperator plug-in 10XML plug-in 10

Pplug-ins configuration

Mail plug-in 59SSH plug-in 41vCenter Server plug-in 15

power host management workflows 20power management workflows 29

Rresource pool workflows 22

Sscripting, email examples 60SFTP 48, 49SMTP connection 59snapshot workflows 29SSH commands, running 48SSH file copy

SCP get command 48SCP put command 49

SSH plug-inscripting API 42usage 41

SSH plug-in APIKeyPairManager class 42managing private and public SSH keys 42SSH:File type 42SSH:Folder type 42SSH:RootFolder type 42SSH:SshConnection type 42SSHCommand class 43SSHFile class 44SSHFolder class 44SSHSession class 45

SSH plug-in sample workflows 46SSH workflows

changing a key pair passphrase 47generating a key pair 46registering a public key 47

standard virtual switch workflows 22storage DRS workflows 23storage workflows 23

Ttools clone workflows 26

VvCenter Server 5.0.1 plug-in

scripting API 16usage 15

vCenter Server plug-inInventory 16workflow library 17workflow library access 16

vCO Library plug-inusage 31workflows 31

virtual machine folder managementworkflows 19

VMware Tools workflows 30

Wwindows customization clone workflows 27workflows

basic host management 20basic virtual machine 24batch 17clone 25cluster and compute resource 17custom attributes 18datacenter folder management 19datancenter 18datastore and files 18device management 27distributed virtual port group 21distributed virtual switch 21host folder management 19host management registration 20linked clone 25Linux customization clone 26move and migrate 28networking 21other 28power host management 20power management 29resource pool 22snapshot 29standard virtual switch 22storage 23Storage DRS 23tools clone 26virtual machine folder management 19VMware Tools 30windows customization clone 27

Using VMware vCenter Orchestrator Plug-Ins

72 VMware, Inc.

Page 73: Using VMware vCenter Orchestrator Plug-Ins - vCenter

XXML

DOM 51E4X 51

XML plug-inscripting API 51usage 51

XML plug-in APIXMLDocument class 51XMLElement class 52XMLManager class 53XMLNamedNodeMap class 53XMLNode class 54XMLNodeList class 55

XML plug-in sample workflowscreating a simple XML document 55creating an address book 57finding an element 56modifying an XML document 56

Index

VMware, Inc. 73

Page 74: Using VMware vCenter Orchestrator Plug-Ins - vCenter

Using VMware vCenter Orchestrator Plug-Ins

74 VMware, Inc.