using vmware vcenter orchestrator plug-ins - vcenter ... · using vmware vcenter orchestrator...

88
Using VMware vCenter Orchestrator Plug-Ins vCenter Orchestrator 5.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-000735-01

Upload: others

Post on 20-Oct-2019

100 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter OrchestratorPlug-Ins

vCenter Orchestrator 5.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-000735-01

Page 2: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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–2013 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 ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Contents

Using VMware vCenter Orchestrator Plug-Ins 7

Updated Information 9

1 Introduction to Orchestrator Plug-Ins 11

Orchestrator Architecture 11Default Orchestrator Plug-Ins 12Access the Orchestrator API Explorer 14

2 Using the vCenter Server 5.1 Plug-In 17

Configure the vCenter Server 5.1 Plug-In 17vCenter Server 5.1 Plug-In Scripting API 18Using the vCenter Server 5.1 Plug-In Inventory 18Access the vCenter Server 5.1 Plug-In Workflow Library 18vCenter Server 5.1 Plug-In Workflow Library 19

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

VMware, Inc. 3

Page 4: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Move and Migrate Workflows 32Other Workflows 32Power Management Workflows 33Snapshot Workflows 33VMware Tools Workflows 34

3 Using the vCO Library Plug-In 35

vCO Library Plug-In Workflows 35

4 Using the SQL Plug-In 37

Configuring the SQL Plug-In 37SQL Plug-In Configuration Workflows 37Add a Database 38Add Tables to a Database 38Update a Database 39

SQL Plug-In Scripting API 39SQL:ActiveRecord Type 39SQL:Column Type 40SQL:Database Type 40SQL:Table Type 40Connection Class 40JDBCConnection Class 41PreparedStatement Class 41ResultSet Class 41ResultSetMetaData Class 42SQLActiveRecord Class 42SQLColumn Class 43SQLDatabase Class 43SQLDatabaseManager Class 44SQLTable Class 45

Running the SQL Sample Workflows 45Generate a JDBC URL 45Test a JDBC Connection 46Create a Table by Using JDBC 46Insert a Row into a JDBC Table 47Select Rows from a JDBC Table 47Delete an Entry from a JDBC Table 48Delete All Entries from a JDBC Table 48Drop a JDBC Table 49Run a Complete JDBC Cycle 49

Using the SQL Plug-In Standard Workflows 50SQL Plug-In Workflow Library 50Generate CRUD Workflows for a Table 50

5 Using the SSH Plug-In 53

Configure the SSH Plug-In 53SSH Plug-In Scripting API 54

SSH:File Type 54

Using VMware vCenter Orchestrator Plug-Ins

4 VMware, Inc.

Page 5: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

SSH:Folder Type 54SSH:RootFolder Type 54SSH:SshConnection Type 54KeyPairManager Class 54SSHCommand Class 55SSHFile Class 56SSHFolder Class 56SSHSession Class 57

Running the SSH Plug-In Sample Workflows 58Generate a Key Pair 58Change the Key Pair Passphrase 59Register an Orchestrator Public Key on an SSH Host 59Run an SSH Command 60Copy a File from an SSH Host 60Copy a File to an SSH Host 61

6 Using the XML Plug-In 63

XML Plug-In Scripting API 63XMLDocument Class 63XMLElement Class 64XMLManager Class 65XMLNamedNodeMap Class 65XMLNode Class 66XMLNodeList Class 67

Running the XML Plug-In Sample Workflows 67Create a Simple XML Document 67Find an Element in an XML Document 68Modify an XML Document 68Create an Example Address Book from XML 69

7 Using the Mail Plug-In 71

Define the Default SMTP Connection 71Mail Plug-In Scripting API 72

EmailMessage Class 72Email Scripting Examples 72Using the Mail Plug-In Sample Workflows 73

Access the Mail Plug-In Sample Workflows 73Mail Plug-In Sample Workflows 73Test an Example Interaction with Email 74

8 Using the Net Plug-In 75

Net Plug-In Scripting API 75FTPClient Class 75POP3Client Class 76POP3Message Class 77TelnetClient Class 78

Contents

VMware, Inc. 5

Page 6: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

9 Using the Enumeration Plug-In 79Enumeration Plug-In Scripting API 79Time Zone Codes 80

10 Using the Workflow Documentation Plug-In 83

Workflow Documentation Plug-In Scripting API 83WorkflowDocumentationService Class 83

Workflow Library for the Workflow Documentation Plug-In 83Generate Workflow Documentation 84

Index 85

Using VMware vCenter Orchestrator Plug-Ins

6 VMware, Inc.

Page 7: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

Using VMware vCenter Orchestrator Plug-Ins provides information and instructions about configuring and usingthe 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 is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

8 VMware, Inc.

Page 9: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Updated Information

Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary.

This table provides the update history of Using VMware vCenter Orchestrator Plug-Ins.

Revision Description

000735 -01 n Updated Chapter 4, “Using the SQL Plug-In,” on page 37 with information about configuring the SQLplug-in, adding and updating databases.

n Updated the “SQL Plug-In Scripting API,” on page 39 section to include all of the API types and classes.n Included information about using the SQL plug-in standard workflows. For more details, see “Using the

SQL Plug-In Standard Workflows,” on page 50.n Minor updates.

000735 -00 Initial release.

VMware, Inc. 9

Page 10: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

10 VMware, Inc.

Page 11: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 the Orchestrator server. Before you use some of the plug-ins,for example the vCenter Server plug-in, you should configure them.

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 11

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

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

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. 11

Page 12: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Figure 1-1. VMware vCenter Orchestrator Architecture

Orchestratordatabase

workflow library

vCenterServer XML SSH SQL SMTP

3rd-partyplug-in

workflow engine

browseraccess

vCenterOrchestrator

Client application

vCenterServer

Directory servicesor vCenter

Single Sign On

Web servicesREST/SOAP

Default Orchestrator Plug-InsOrchestrator includes a collection of default plug-ins. Each plug-in exposes an external product API to theOrchestrator platform. Plug-ins provide inventory classes, extend the scripting engine with new object types,and publish notification events from the external system. Each plug-in can also provide a library of workflowsthat represents 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.1

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

See “Configurethe vCenterServer 5.1 Plug-In,” on page 17.

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

See http://www.vmware.com/support/orchestrator/doc/vco_vsphere51_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

12 VMware, Inc.

Page 13: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

Plug-In Purpose Configuration Input Types Scripting Objects Inventory

SQL 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 ActiveRecord

Column

Database

Table

Connection

JDBCConnection

PreparedStatement

ResultSet

ResultSetMetaData

SQLActiveRecord

SQLColumn

SQLDatabase

SQLDatabaseManager

SQLTable

Exposes thedatabasesyou add 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 53.

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 71.

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.

Workflowdocumentation

Provides workflows thatallow you to generateinformation in PDF formatabout a workflow or aworkflow category.

None None workflowDocumentationService

Exposesnothing intheinventory.

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 is updated with each release of the product or when necessary. This table provides

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.

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.1 o11nplugin-vsphere51.dar vCenter VC

vCO Library o11nplugin-library.dar LockingOrchestratorTroubleshooting

N/A

SQL o11nplugin-database.dar JDBCSQL

SQL

SSH o11nplugin-ssh.dar SSH SSH

XML o11nplugin-xml.dar XML XML

Mail o11nplugin-mail.dar Mail Mail

Net o11nplugin-jakartacommonsnet.dar None Net

Workflowdocumentation

o11nplugin-wfdocs.dar Workflowdocumentation

Workflow documentation

Commonenumerated types

o11nplugin-enums.dar None Enums

vCO WebOperator o11nplugin-weboperator.dar None N/A

Access the Orchestrator API ExplorerOrchestrator provides an API Explorer that you can use to search the Orchestrator API and see thedocumentation for 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.

Procedure

1 Log in to the Orchestrator client and select Design or Run from the drop-down menu in the left uppercorner.

2 Select Tools > API Explorer.

Using VMware vCenter Orchestrator Plug-Ins

14 VMware, Inc.

Page 15: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

The API Explorer appears. You can use it 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. 15

Page 16: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

16 VMware, Inc.

Page 17: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using the vCenter Server 5.1 Plug-In 2You can use the vCenter Server 5.1 plug-in to manage multiple vCenter Server instances. You can createworkflows that use the vCenter Server plug-in API to automate tasks in your vCenter Server environment.

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

The vCenter Server 5.1 plug-in provides a library of standard workflows that automate vCenter Server 5.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.1 Plug-In,” on page 17

n “vCenter Server 5.1 Plug-In Scripting API,” on page 18

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

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

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

Configure the vCenter Server 5.1 Plug-InYou can configure Orchestrator to connect to your vCenter Sever instances to run workflows over the objectsin your vSphere infrastructure.

To manage the objects in your vSphere inventory by using the vSphere Web Client, make sure that youconfigure the Orchestrator server to work with the vCenter Server instance registered with thevSphere Web Client that uses the same vCenter Single Sign On instance with which you registeredOrchestrator.

Prerequisites

Import the SSL certificates for each vCenter Server instance you define.

Procedure

1 Log in to the Orchestrator configuration interface as vmware.

2 Click vCenter Server, and click the New vCenter Server Host tab.

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

4 In the Host text box, type the IP address or the DNS name of the machine on which the vCenter Serverinstance you want to add is installed.

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

VMware, Inc. 17

Page 18: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

7 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.

8 Select the method you want to use to manage user access on the vCenter Server system.

Option Description

Share a unique session Allows Orchestrator to create only one connection to vCenter Server.In the User name and Password text boxes, type the credentials forOrchestrator to use to establish the connection to the vCenter Server host.The user that you select must be a valid user with privileges to managevCenter Server extensions and a set of custom defined privileges.Orchestrator uses these credentials to monitor the vCenter Web service,typically to operate Orchestrator system workflows.

Session per user Creates a new session to vCenter Server. This might rapidly use CPU,memory, and bandwidth.Select this option only if your vCenter Server is in an Active Directorydomain or if vCenter Server Sign On is enabled.The user that you select must be a valid user with privileges to managevCenter Server extensions.You can leave the User name and Password text boxes empty, because thecredentials are used only for connection check.

The user account that you select is also used by the policy engine to collect statistical and other data. If theuser that you select does not have enough privileges, the policy engine cannot access the necessary partsof the vCenter Server inventory and thus cannot collect the necessary data.

9 Click Apply changes.

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

10 Repeat Step 2 through Step 9 for each vCenter Server instance.

vCenter Server 5.1 Plug-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_vsphere51_api/index.html.

Using the vCenter Server 5.1 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 you enable the Use contextual menu in inventory option from the Inventory tab of the User preferencestool, all of the workflows that you can run on the selected inventory object appear in a pop-up menu.

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

Prerequisites

n Configure the vCenter Server 5.1 plug-in in the Orchestrator configuration interface.

Using VMware vCenter Orchestrator Plug-Ins

18 VMware, Inc.

Page 19: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

n Log in to the Orchestrator client as a user who can run vCenter Server workflows.

Procedure

1 Log in to the Orchestrator client and select Design or Run from the drop-down menu in the left uppercorner.

2 Click the Workflows view in the Orchestrator client left pane.

3 Expand the hierarchical list to Library > vCenter.

What to do next

Review the workflow library.

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

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

You can access the batch workflows from Library > vCenter > Batch in the Workflows view of the Orchestratorclient.

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 can access the cluster and compute resource workflows from Library > vCenter > Cluster and ComputeResource in the Workflows view of the Orchestrator client.

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.

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 19

Page 20: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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.

Remove virtualmachines from DRSgroup

Removes virtual machines from a cluster DRS group.

Rename cluster Renames a cluster.

Guest Operation Files WorkflowsWith guest operation files workflows, you can manage files in a guest operating system.

You can access the guest operation files workflows from Library > vCenter > Guest operations > Files in theWorkflows view of the Orchestrator client.

Check for directory inguest

Verifies that a directory exists in a guest virtual machine.

Check for file in guest Verifies that a file exists in a guest virtual machine.

Copy file from guest toOrchestrator

Copies a specified file from a guest file system to an Orchestrator server.

Copy file fromOrchestrator to guest

Copies a specified file from an Orchestrator server to a guest file system.

Create directory in guest Creates a directory in a guest virtual machine.

Create temporarydirectory in guest

Creates a temporary directory in a guest virtual machine.

Create temporary file inguest

Creates a temporary file in a guest virtual machine.

Delete directory in guest Deletes a directory from a guest virtual machine.

Delete file in guest Deletes a file from a guest virtual machine.

List path in guest Shows a path in a guest virtual machine.

Move directory in guest Moves a directory in a guest virtual machine.

Move file in guest Moves a file in a guest virtual machine.

Using VMware vCenter Orchestrator Plug-Ins

20 VMware, Inc.

Page 21: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Guest Operation Processes WorkflowsWith guest operation processes workflows, you can get information and control the running processes in aguest operating system.

You can access the guest operation files workflows from Library > vCenter > Guest operations > Processes inthe Workflows view of the Orchestrator client.

Get environmentvariables from guest

Returns a list with environmental variables from a guest. An interactive sessionreturns the variables of the user who is currently logged in.

Get processes fromguest

Returns a list with the processes running in the guest operating system and therecently completed processes started by the API.

Run program in guest Starts a program in a guest operating system.

Stop process in guest Stops a process in a guest operating system.

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

You can access the custom attributes workflows from Library > vCenter > Custom Attributes in theWorkflows view of the Orchestrator client.

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 can access the datacenter workflows from Library > vCenter > Datacenter in the Workflows view of theOrchestrator client.

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.

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 21

Page 22: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the datastore and files workflows from Library > vCenter > Datastore and Files in theWorkflows view of the Orchestrator client.

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.

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 can access the datacenter folder management workflows from Library > vCenter > Folder management> Datacenter folder in the Workflows view of the Orchestrator client.

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 can access the host folder management workflows from Library > vCenter > Folder management > Hostfolder in the Workflows view of the Orchestrator client.

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.

Using VMware vCenter Orchestrator Plug-Ins

22 VMware, Inc.

Page 23: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

You can access the virtual machine folder management workflows from Library > vCenter > Foldermanagement > VM folder in the Workflow view of the Orchestrator client.

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.

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 can access the basic host management workflows from Library > vCenter > Host management > Basic inthe Workflows view of the Orchestrator client.

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 to 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 can access the power host management workflows from Library > vCenter > Host management >Power in the Workflows view of the Orchestrator client.

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.

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 23

Page 24: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

You can access the host management registration workflows from Library > vCenter > Host management >Registration in the Workflows view of the Orchestrator client.

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.

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 can access the networking workflows from Library > vCenter > Networking in the Workflows view ofthe Orchestrator client.

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 can access the distributed virtual port group workflows from Library > vCenter > Networking >Distributed virtual port group in the Workflows view of the Orchestrator client.

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.

Using VMware vCenter Orchestrator Plug-Ins

24 VMware, Inc.

Page 25: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the distributed virtual switch workflows from Library > vCenter > Networking > Distributedvirtual switch in the Workflows view of the Orchestrator client.

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 associated elements.

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

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 can access the standard virtual switch workflows from Library > vCenter > Networking > Standard virtualswitch in the Workflows view of the Orchestrator client.

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.

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 25

Page 26: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Update standard virtualswitch

Updates the properties of a standard virtual switch.

Update VNIC for portgroup in standard virtualswitch

Updates a VNIC associated with 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 can access the resource pool workflows from Library > vCenter > Resource Pool in the Workflows viewof the Orchestrator client.

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.

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 can access the storage workflows from Library > vCenter > Storage in the Workflows view of theOrchestrator client.

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 targets to a vCenter Server host. The targets can be of the typeSend or Static.

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 already configured iSCSI targets. The targets can be of type Send orStatic.

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

Using VMware vCenter Orchestrator Plug-Ins

26 VMware, Inc.

Page 27: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the storage DRS workflows from Library > vCenter > Storage > Storage DRS in theWorkflows view of the Orchestrator client.

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.

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.

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 27

Page 28: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the basic virtual machine management workflows from Library > vCenter > Virtual Machinemanagement > Basic in the Workflows view of the Orchestrator client.

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.

Get virtual machines byname

Returns a list of virtual machines from all registered vCenter Server hosts thatmatch the provided expression.

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.

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 virtual machinehardware (force ifrequired)

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.

Using VMware vCenter Orchestrator Plug-Ins

28 VMware, Inc.

Page 29: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the clone workflows from Library > vCenter > Virtual Machine management > Clone in theWorkflows view of the Orchestrator client.

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 can access the linked clone workflows from Library > vCenter > Virtual Machine management > Clone> Linked Clone folder and its subfolders in the Workflows view of the Orchestrator client.

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.

Create a linked clone of aLinux machine withmultiple NICs

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

Create a linked clone of aLinux machine with asingle NIC

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

Create a linked clone of aWindows machine withmultiple 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.

Create a linked clone of aWindows machine with asingle NIC and credential

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.

Create a linked clonewith no customization

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

Chapter 2 Using the vCenter Server 5.1 Plug-In

VMware, Inc. 29

Page 30: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

You can access the Linux customization clone workflows from Library > vCenter > Virtual Machinemanagement > Clone > Linux Customization in the Workflows view of the Orchestrator client.

Clone a Linux machinewith multiple NICs

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

Clone a Linux machinewith a single NIC

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 can access the tools clone workflows from Library > vCenter > Virtual Machine management > Clone >Tools in the Workflows view of the Orchestrator client.

Get a virtual Ethernetcard to change thenetwork

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

Get Linux customization Returns the Linux customization preparation.

Get multiple virtualEthernet card devicechanges

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

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

Get Windowscustomization forSysprep with credentials

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

Get Windowscustomization forSysprep withUnattended.txt

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

Get Windowscustomization forSysprep

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

Using VMware vCenter Orchestrator Plug-Ins

30 VMware, Inc.

Page 31: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

You can access the Windows customization clone workflows from Library > vCenter > Virtual Machinemanagement > Clone > Windows Customization folder and its subfolder in the Workflows view of theOrchestrator client.

Customize a Windowsmachine with single NICand credential

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

Clone a thin provisionedWindows machine withsingle NIC and 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 a Windowsmachine Sysprep 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 vCenter Server.

Clone a Windowsmachine with multipleNICs and credential

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 a Windowsmachine with single 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 a Windowsmachine 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 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 can access the device management workflows from Library > vCenter > Virtual Machine management> Device Management in the Workflows view of the Orchestrator client.

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.1 Plug-In

VMware, Inc. 31

Page 32: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the move and migrate workflows from Library > vCenter > Virtual Machine management >Move and Migrate in the Workflows view of the Orchestrator client.

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 Serversystem

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 migrate virtualmachine

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 can access these workflows fromLibrary > vCenter > Virtual Machine management > Others in theWorkflows view of the Orchestrator client.

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

32 VMware, Inc.

Page 33: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the power management workflows fromLibrary > vCenter > Virtual Machine management >Power Management in the Workflows view of the Orchestrator client.

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 standbymode

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 can access the snapshot workflows from Library > vCenter > Virtual Machine management >Snapshot in the Workflows view of the Orchestrator client.

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.1 Plug-In

VMware, Inc. 33

Page 34: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 can access the VMware Tools workflows from Library > vCenter > Virtual Machine management >VMware Tools in the Workflows view of the Orchestrator client.

Mount VMware toolsinstaller

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 VMware toolsinstaller

Unmounts the VMware Tools CD-ROM.

Upgrade VMware tools Upgrades VMware Tools on a virtual machine.

Upgrade VMware tools atnext reboot

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

Using VMware vCenter Orchestrator Plug-Ins

34 VMware, Inc.

Page 35: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 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 > Tasks 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.

VMware, Inc. 35

Page 36: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

Start workflows in aseries

Runs a workflow multiple times in a series, one instance after the other. Youprovide workflow parameters in an array. You also provide a property list,with one property per workflow input, for each instance of the workflow thatstarts. The number of properties in the array define the number of workflowruns.

Start workflows inparallel

Runs a workflow multiple times, with different parameters. You provideworkflow parameters in an array. You also provide 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.

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 and server, configuration, wrapper, and installation logfiles. The output directory must exist and Orchestrator must have writingpermissions.

Using VMware vCenter Orchestrator Plug-Ins

36 VMware, Inc.

Page 37: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

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

This chapter includes the following topics:

n “Configuring the SQL Plug-In,” on page 37

n “SQL Plug-In Scripting API,” on page 39

n “Running the SQL Sample Workflows,” on page 45

n “Using the SQL Plug-In Standard Workflows,” on page 50

Configuring the SQL Plug-InYou can use the workflows included in the SQL plug-in and run them from the Orchestrator client to configurethe SQL plug-in and to add, update, or remove a database.

SQL Plug-In Configuration WorkflowsThe Configuration workflow category of the SQL plug-in contains workflows that allow you to managedatabases and database tables.

You can access these workflows from Library > SQL > Configuration in the Workflows view of theOrchestrator client.

Workflow Name Description

Add a database Adds a database object to the Database plug-in inventory.

Add tables to a database Adds database tables to a database in the Database plug-in inventory.

Remove a database Removes a database object from the Database plug-in inventory.

Remove a table from a database Removes a database table from a database in the Database plug-in inventory.

Update a database Updates the configuration of a database object in the Database plug-in inventory.

Validate a database Validates a database in the Database plug-in inventory.

VMware, Inc. 37

Page 38: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Add a DatabaseYou can run a workflow to add a database and configure the host connection parameters.

When you add a database that requires a secure connection, you must import the database SSL certificate. Youcan import the SSL certificate from the Network tab in the Orchestrator configuration interface.

Procedure

1 Log in to the Orchestrator client as an administrator.

2 Click the Workflows view in the Orchestrator client.

3 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Add a databaseworkflow.

4 Right-click the Add a database workflow and select Start workflow.

5 In the Name text box, type the name of the database.

After the workflow runs successfully, the database appears in the Inventory view of the Orchestratorclient with the name that you specify.

6 Select the type of the database.

7 In the Connection URL text box, type the address of the database.

Database Type Syntax

Oracle jdbc:oracle:thin:@database_url:port_number:SID

Microsoft SQL jdbc:jtds:sqlserver://database_url:port_number/database_name

PostgreSQL jdbc:postgresql://database_url:port_number/database_name

MySQL jdbc:mysql://database_url:port_number/database_name

8 Select the session mode that the plug-in uses to connect to the database.

Option Description

Shared Session The plug-in uses shared credentials to connect to the database. You mustprovide the database credentials for the shared session.

Session Per User The Orchestrator client retrieves credentials from the user who is logged in.

9 Click Submit to run the workflow.

After the workflow runs successfully, the database and all tables that belong to it appear in the Inventory view.

Add Tables to a DatabaseYou can run a workflow to add tables to a database that is in the Database plug-in inventory.

Prerequisites

n Verify that you are logged in to the Orchestrator client as an administrator.

n Verify that you have a connection to a database from the Inventory view.

Procedure

1 Click the Workflows view in the Orchestrator client.

2 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Add tablesto a database workflow.

Using VMware vCenter Orchestrator Plug-Ins

38 VMware, Inc.

Page 39: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

3 Right-click the Add tables to a database workflow and select Start workflow.

4 Select a database to which to add tables.

5 Select the tables that you want to add.

6 Click Submit to run the workflow.

After the workflow runs successfully, the added database tables appear in the Inventory view of theOrchestrator client.

Update a DatabaseYou can run a workflow to update the configuration of a database that is in the plug-in's inventory.

Procedure

1 Log in to the Orchestrator client as an administrator.

2 Click the Workflows view in the Orchestrator client.

3 In the workflows hierarchical list, select Library > SQL > Configuration and navigate to the Update adatabase workflow.

4 Right-click the Update a database workflow and select Start workflow.

5 Select a database that you want to update.

6 In the Name text box, type the new name of the database.

The database appears in the Inventory view with the name that you specify.

7 Select the type of the database.

8 In the Connection URL text box, type the new address of the database.

9 Select the session mode that the plug-in uses to connect to the database.

Option Description

Shared Session The plug-in uses shared credentials to connect to the database. You mustprovide the database credentials for the shared session.

Session Per User The Orchestrator client retrieves credentials from the user who is logged in.

10 Click Submit to run the workflow.

SQL Plug-In Scripting APIThe SQL scripting API contains classes, with their respective methods, that enable interaction between vCenterOrchestrator and SQL-based databases. You can use the API to create workflows that read data from and writedata to SQL-based databases.

SQL:ActiveRecord TypeThe SQL:ActiveRecord type uses the SQLActiveRecord class as its scripting object.

The SQL:ActiveRecord type contains no properties.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 39

Page 40: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

SQL:Column TypeThe SQL:Column type uses the SQLColumn class as its scripting object.

The SQL:Column type contains the following properties.

n name

n typeName

n mandatory

n table

SQL:Database TypeThe SQL:Database type uses the SQLDatabase class as its scripting object.

The SQL:Database type contains the following properties.

n name

n type

n connectionURL

n sessionMode

n username

SQL:Table TypeThe SQL:Table type uses the SQLTable class as its scripting object.

The SQL:Table type contains the following properties.

n name

n database

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.

Using VMware vCenter Orchestrator Plug-Ins

40 VMware, Inc.

Page 41: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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.

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.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 41

Page 42: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Method Returns Description

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.

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.

ResultSetMetaData ClassThe ResultSetMetaData class contains the metadata of a ResultSet method.

The ResultSetMetaData class defines the following methods.

Method Returns Description

getColumnCount():number Number Returns the number of columns in theselected ResultSet.

getColumnName(number):string String Returns the name of the column atposition index (starting with one).

getTableName(number):string String Returns the table name to which thecolumn belongs.

SQLActiveRecord ClassThe SQLActiveRecord class contains a method that represents a table record.

The SQLActiveRecord class defines the following method.

Using VMware vCenter Orchestrator Plug-Ins

42 VMware, Inc.

Page 43: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Method Returns Description

getProperty(String):Object Object Returns the value of the given property.

SQLColumn ClassThe SQLColumn class represents a SQL table column.

The SQLColumn class defines the following attributes.

Attribute Returns Description

mandatory Boolean A mandatory column

name String The column name

table com.vmware.o11n.plugin.database.Table

The table to which the column belongs

typeId Integer The type ID

typeName String The type name

SQLDatabase ClassThe SQLDatabase class represents a SQL database connection.

The SQLDatabase class defines the following attributes.

Attribute Returns Description

connectionURL String The database connection URL

id String The database ID

name String The database name

password String The database password

sessionMode String The user session mode

type String The database type

username String The user name

The SQLDatabase class defines the following methods.

Method Returns Description

executeCustomQuery(String):int Integer Runs a non-read custom query on thedatabase.

getAllTableNames():String[] Array of Strings Returns a list of all of the tables in thedatabase.

getMappedTableNames():String[] Array of Strings Returns a list of all of the tables addedto the database.

getTables():SQLTable[] Array of SQL Tables Returns a list of tables in the database.

getUnmappedTableNames():String[]

Array of Strings Returns a list of tables that are not addedto the database.

readCustomQuery(String):ResultSet

ResultSet Runs a read custom query on thedatabase and returns the results in aResultSet.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 43

Page 44: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

SQLDatabaseManager ClassThe SQLDatabaseManager class provides CRUD operations for database objects.

The SQLDatabaseManager class defines the following methods.

Method Returns Description

addDatabase(SQLDatabase):SQLDatabase

Boolean Adds a database object to the SQL plug-in inventory.

addTablesToDatabase(SQLDatabase,String[]):SQLTable[]

Array of SQL Table Adds new tables to a database.

convertBooleanForPresentation(String):String

String Converts Boolean values to Yes or Nostrings.

generateCreateWorkflow(SQLTable,ch.dunes.model.workflow.WorkflowCategory,Boolean,SQLColumn[]):ch.dunes.model.workflow.Workflow

ch.dunes.model.workflow.Workflow

Generates a workflow that createsdatabase records.

generateDeleteWorkflow(SQLTable,h.dunes.model.workflow.WorkflowCategory,Boolean):ch.dunes.model.workflow.Workflow

ch.dunes.model.workflow.Workflow

Generates a workflow that deletes tablerecords.

generateReadWorkflow(SQLTable,ch.dunes.model.workflow.WorkflowCategory,Boolean):ch.dunes.model.workflow.Workflow

ch.dunes.model.workflow.Workflow

Generates a workflow that reads tablerecords.

generateUpdateWorkflow(SQLTable,ch.dunes.model.workflow.WorkflowCategory,Boolean,SQLColumn[]):ch.dunes.model.workflow.Workflow

ch.dunes.model.workflow.Workflow

Generates a workflow that updates atable record.

getConnectionUrl(String,String):String

String Returns a connection URL pattern for aparticular database type.

getDatabase(String):SQLDatabase SQLDatabase Returns database objects with aspecified name from the SQL plug-ininventory.

getDatabaseById(String):SQLDatabase

SQLDatabase Returns database objects with aspecified ID from the SQL plug-ininventory.

getDatabases():SQLDatabase[] Array of SQLDatabase Returns a list of database objects in theSQL plug-in inventory.

getSupportedDatabaseTypes():String[]

Array of strings Returns a list of supported databasetypes.

isValidNumberOrEmpty(Object):Boolean

Boolean Returns true if the object you passed isa valid number or null. Otherwisereturns false.

removeDatabase(SQLDatabase):SQLDatabase

SQLDatabase Removes a database object from theSQL plug-in inventory.

removeTableFromDatabase(SQLTable):SQLTable

SQLTable Removes a specified table from thedatabase.

Using VMware vCenter Orchestrator Plug-Ins

44 VMware, Inc.

Page 45: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Method Returns Description

updateDatabase(SQLDatabase):SQLDatabase

SQLDatabase Updates a specified database in the SQLplug-in inventory.

validateDatabase(SQLDatabase):Object

Object Validates the created database object incase the object can connect to the realdatabase.

SQLTable ClassThe SQLTable class represents a database table.

The SQLTable class defines the following attributes.

Attribute Returns Description

database com.vmware.o11n.plugin.database.Database

The database to which the table belongs.

name String The table name

The SQLTable class defines the following methods.

Method Returns Description

createRecord(Object,Boolean):SQLActiveRecord

SQLActiveRecord Creates a new active record withprimary fields.

deleteRecords(Object,Boolean):Integer

Integer Deletes a record by certain searchcriteria.

findUniqueRecord(Object[]):SQLActiveRecord

SQLActiveRecord Finds a record by certain search criteria.

readRecords(Object,Boolean):SQLActiveRecord[]

Array of SQLActiveRecord Reads records by certain search criteria.

updateRecord(SQLActiveRecord,Object):Integer

Integer Updates the record that matches theprimary key fields.

Running the SQL Sample WorkflowsYou can run the SQL plug-in workflows to perform JDBC operations such as generating a JDBC URL, testinga JDBC connection, and managing rows in JDBC tables. You can also run the SQL plug-in workflows to managedatabases and database tables, as well as to run SQL operations.

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

Prerequisites

Log 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.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 45

Page 46: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

NOTE If you use a Microsoft database, you might have to click Next and to provide the database instancename and database user 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.

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

Log 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 create a database.

Prerequisites

Log 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.

Using VMware vCenter Orchestrator Plug-Ins

46 VMware, Inc.

Page 47: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

4 Provide the required information, and click Next.

a Type a password to access the database.

b Type a database connection URL.

c Type a user name to access the database.

5 Type an SQL create statement.

An example syntax is:

CREATE TABLE "table_name"

("column1" "data_type_for_column1",

"column2" "data_type_for_column2")

6 Click Submit to run the workflow.

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

Prerequisites

Log 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, and click Next.

a Type a database connection URL.

b Type a user name to access the database.

c Type a password to access the database.

5 Type an SQL insert statement, and click Next.

An example syntax is:

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

VALUES ("value1", "value2")

6 Type the values to insert into the row.

7 Click Submit to run the workflow.

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

Prerequisites

Log 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.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 47

Page 48: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

4 Provide the required information, and click Next.

a Type a database connection URL.

b Type a user name to access the database.

c Type a password to access the database.

5 Type an SQL select statement.

An example syntax is:

SELECT * FROM "table_name"

6 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

Log 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, and click Next.

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.

5 Type an SQL delete statement.

An example syntax is:

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

6 Click Submit to run the workflow.

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

Prerequisites

Log 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 deleteall from table example workflow.

Using VMware vCenter Orchestrator Plug-Ins

48 VMware, Inc.

Page 49: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

4 Provide the required information, and click Next.

a Type a database connection URL.

b Type a user name to access the database.

c Type a password to access the database.

5 Type an SQL delete statement.

An example syntax is:

DELETE FROM "table_name"

6 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

Log 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, and click Next.

a Type a password to access the database.

b Type a database connection URL.

c Type a user name to access the database.

5 Type an SQL drop statement.

An example syntax is:

DROP TABLE "table_name"

6 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

Log 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 Full JDBCcycle example workflow.

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

Chapter 4 Using the SQL Plug-In

VMware, Inc. 49

Page 50: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

4 Provide the required information, and click Next..

a Type a database connection URL.

b Type a user name to access the database.

c Type a password to access the database.

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

6 Click Submit to run the workflow.

Using the SQL Plug-In Standard WorkflowsYou can use the SQL workflows to run SQL operations.

SQL Plug-In Workflow LibraryYou can run the SQL plug-in workflows to manage databases and database tables as well as to run SQLoperations.

You can access the database configuration workflows from Library > SQL > Configuration in theWorkflows view of the Orchestrator client.

Add a database Adds a database object to the plug-in's inventory.

Add tables to a database Adds database tables to a database in the plug-in's inventory.

Remove a database Removes a database object from the plug-in's inventory.

Remove a table from adatabase

Removes a database table from a database in the plug-in's inventory.

Update a database Updates the configuration of a database object in the plug-in's inventory.

Validate a database Validates a database in the plug-in's inventory.

You can access the SQL operations workflows from Library > SQL in the Workflows view of the Orchestratorclient.

Execute a custom queryon a database

Executes a custom query on a specified database and returns the number ofaffected rows. You can run the workflow to update, delete, insert, and writequeries

Generate CRUDworkflows for a table

Generates Create, Read, Update and Delete workflows for a particular table.

Read a custom queryfrom a database

Executes a custom query on a specified database and returns the result in anarray of properties. You can run the workflow to select and read queries.

Generate CRUD Workflows for a TableYou can run a workflow to generate Create, Read, Update, and Delete workflows for a particular table.

Prerequisites

n Verify that you are logged in to the Orchestrator client as an administrator.

n Verify that you have a connection to a database from the Inventory view.

Procedure

1 Click the Workflows view in the Orchestrator client.

Using VMware vCenter Orchestrator Plug-Ins

50 VMware, Inc.

Page 51: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

2 In the workflows hierarchical list, select Library > SQL and navigate to the Generate CRUD workflowsfor a table workflow.

3 Right-click the Generate CRUD workflows for a table workflow and select Start workflow.

4 Select a table for which to generate the workflows.

5 Select the workflow folder in which to generate the workflows.

6 Select whether to overwrite any existing workflows.

Option Description

Yes The generated workflows overwrite existing workflows with the same name.

No New workflows are not generated if workflows with the same name exist inthe folder.

7 (Optional) Select columns that should not be populated.

You cannot edit the selected columns with the generated CRUD workflows.

8 Click Submit to run the workflow.

After the workflow runs successfully, the CRUD workflows appear in the selected workflow folder.

What to do next

You can run the generated workflows on the selected database table.

Chapter 4 Using the SQL Plug-In

VMware, Inc. 51

Page 52: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

52 VMware, Inc.

Page 53: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 53

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

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

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, type the host to access with SSH through Orchestrator.

NOTE No username and password are required because Orchestrator uses the credentials of the currentlylogged-in user to run SSH commands. You must reproduce the accounts you want to work on SSH ontarget 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. 53

Page 54: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

54 VMware, Inc.

Page 55: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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. 55

Page 56: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

56 VMware, Inc.

Page 57: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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. 57

Page 58: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

58 VMware, Inc.

Page 59: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Prerequisites

n Configure the SSH plug-in in the Orchestrator configuration interface.

n Log 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 Configure the SSH plug-in in the Orchestrator configuration interface.

n Log 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 Configure the SSH plug-in in the Orchestrator configuration interface.

n Log in to the Orchestrator client as a user who can run SSH workflows.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 59

Page 60: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Configure the SSH plug-in in the Orchestrator configuration interface.

n Log 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 Type an SSH host name or IP address, and click Next.

5 Type an SSH command to run, and click Next.

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

6 Select Yes to use password authentication, and click Next.

NOTE The default option is to use key file authentication.

7 Type a user name, and click Next.

8 Type a password if the authentication method requires a password. Otherwise, type the path to the privatekey and type the passphrase for the private key.

9 Click Submit to run the workflow.

Copy a File from an SSH HostYou can run a workflow on 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 Configure the SSH plug-in in the Orchestrator configuration interface.

Using VMware vCenter Orchestrator Plug-Ins

60 VMware, Inc.

Page 61: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

n Log 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 get command workflow.

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

4 Provide the required information, and click Next.

a Type an SSH host name or IP address.

b Type the SSH authentication information.

5 Type the file information.

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

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

6 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 Configure the SSH plug-in in the Orchestrator configuration interface.

n Log 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, and click Next.

a Type an SSH host name or IP address.

b Type the SSH authentication information.

5 Type the file information.

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

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

6 Click Submit to run the workflow.

Chapter 5 Using the SSH Plug-In

VMware, Inc. 61

Page 62: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

62 VMware, Inc.

Page 63: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 63

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

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. 63

Page 64: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

64 VMware, Inc.

Page 65: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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. 65

Page 66: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

66 VMware, Inc.

Page 67: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Installing and Configuring VMware vCenter Orchestrator, Setting Server File System Access fromWorkflows and 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 Log 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. 67

Page 68: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Log 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 Log 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

68 VMware, Inc.

Page 69: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Log 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. 69

Page 70: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

70 VMware, Inc.

Page 71: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 71

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

n “Email Scripting Examples,” on page 72

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

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. 71

Page 72: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

72 VMware, Inc.

Page 73: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Configure the Mail plug-in in the Orchestrator configuration interface.

n Log 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. 73

Page 74: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 71.

Prerequisites

n Configure the Mail plug-in in the Orchestrator configuration interface.

n Log 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

74 VMware, Inc.

Page 75: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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. 75

Page 76: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 contents of a remote file.

isAvailable() : boolean Boolean Checks the socket to test whether it isavailable for use.

isConnected() : boolean Boolean Provides information about whetherthe client is currently connected to aserver.

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 to an FTP server.

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

putString(String,String) :Number

Number Adds 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

76 VMware, Inc.

Page 77: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 a POP3 server with the givenuser name and password. Beforeattempting to log in, you must connectto the server with the connect()method.

loginWithSecret(String,String,String):boolean

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

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

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

reset():Object Object Resets a POP3 session. This is useful forundoing 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. 77

Page 78: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

78 VMware, Inc.

Page 79: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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 Scripting API,” on page 79

n “Time Zone Codes,” on page 80

Enumeration Plug-In Scripting 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 80. Time zones

VMware, Inc. 79

Page 80: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

80 VMware, Inc.

Page 81: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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. 81

Page 82: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

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

82 VMware, Inc.

Page 83: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using the Workflow DocumentationPlug-In 10

You can use the Workflow Documentation plug-in to generate PDF documentation about a specific workflowor workflow category.

This chapter includes the following topics:

n “Workflow Documentation Plug-In Scripting API,” on page 83

n “Workflow Library for the Workflow Documentation Plug-In,” on page 83

n “Generate Workflow Documentation,” on page 84

Workflow Documentation Plug-In Scripting APIThe Workflow Documentation scripting API contains one class, with its respective methods. You can use theAPI to develop custom workflows.

WorkflowDocumentationService ClassThe WorkflowDocumentationService class is the main Workflow Documentation class.

The WorkflowDocumentationService class defines the following methods.

Method Returns Description

getWorkflowCategoryDocumentation

MimeAttachment Gets documentation about a workflowcategory.

getWorkflowDocumentation MimeAttachment Gets documentation about a workflow.

Workflow Library for the Workflow Documentation Plug-InWith the Workflow Documentation plug-in workflows you can generate PDF documentation about specificworkflows or workflow categories.

You can access these workflows from Library > Workflow documentation in the Workflows view of theOrchestrator client.

Get documentation forworkflow

Generates information about a workflow that you select.

Get documentation forworkflow category

Generates information about a workflow category that you select.

VMware, Inc. 83

Page 84: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Generate Workflow DocumentationYou can export documentation in PDF format about a workflow or a workflow folder that you select at anytime.

The exported document contains detailed information about the selected workflow or the workflows in thefolder. The information about each workflow includes name, version history of the workflow, attributes,parameter presentation, workflow schema, and workflow actions. In addition, the documentation alsoprovides the source code for the used actions.

Procedure

1 From the drop-down menu in the Orchestrator client, select Run or Design.

2 Click the Workflows view.

3 Navigate to the workflow or workflow folder for which you want to generate documentation and right-click it.

4 Select Generate documentation.

5 Browse to locate the folder in which to save the PDF file, provide a file name, and click Save.

The PDF file containing the information about the selected workflow, or the workflows in the folder, is savedon your system.

Using VMware vCenter Orchestrator Plug-Ins

84 VMware, Inc.

Page 85: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Index

Aadd a database 50add tables to a database 50adding a database 38adding tables to a database 38API Explorer, accessing 14audience 7

Bbasic host management workflows 23basic virtual machine workflows 28batch workflows 19

Cclone workflows 29cluster and compute resource workflows 19custom attributes workflows 21

Ddatabase plug-in, workflow library 50Database plug-in

scripting API 39usage 37

Database plug-in APIconnecting to a database 40Connection class 40database connection parameters 41JDBCConnection class 41PreparedStatement class 41ResultSet class 41ResultSetMetaData class 42SQL:ActiveRecord 39SQL:Column 40SQL:Database 40SQL:Table 40SQLActiveRecord class 42SQLColumn class 43SQLDatabase class 43SQLDatabaseManager class 44SQLTable class 45

Database plug-in sample workflows 45datacenter folder management folder 22datacenter workflows 21datastore and files workflows 22default plug-ins 12

device management workflows 31distributed virtual port group workflows 24distributed virtual switch workflows 25documentation 84

EEnumeration plug-in

Enums:MSTimeZone values 80scripting API 79usage 79

Ggenerate, workflow documentation 84generating CRUD workflows 50guest operation files workflows 20guest operation processes workflows 21

Hhost folder management workflows 22host management registration workflows 24

Iintroduction 11

JJDBC connection, testing 46JDBC dropping, testing 49JDBC entry deletion, testing 48JDBC full cycle, testing 49JDBC plug-in

scripting API 39usage 37

JDBC row insertion, testing 47JDBC row selection, testing 47JDBC sample workflows 45JDBC table creation, testing 46JDBC URL generator 45

Llinked clone workflows 29Linux customization clone workflows 30load balancing 71

MMail plug-in

sample workflows access 73

VMware, Inc. 85

Page 86: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

scripting API 72usage 71

Mail plug-in API, EmailMessage class 72Mail plug-in sample workflows 73Mail plug-in workflows, example interaction with

email 74move and migrate workflows 32

NNet plug-in

scripting API 75usage 75

Net plug-in APIFTPClient class 75POP3Client class 76POP3Message class 77TelnetClient class 78

networking workflows 24

OOrchestrator architecture 11overview of

Enumeration plug-in 12Mail plug-in 12Net plug-in 12overview of 12SQL plug-in 12SSH plug-in 12vCenter Server 5.1 plug-in 12vCO Library plug-in 12vCO Weboperator plug-in 12XML plug-in 12

PPDF 84plug-ins configuration

Mail plug-in 71SSH plug-in 53vCenter Server plug-in 17

power host management workflows 23power management workflows 33precompiled SQL statement 41

Rremove a database 50remove a table from a database 50resource pool workflows 26

Sscripting, email examples 72scripting API, Workflow Documentation plug-

in 83SFTP 60, 61

SMTP connection 71snapshot workflows 33SQL operations 50SQL plug-in

PreparedStatement class 41scripting API 39SQLActiveRecord class 42usage 37

SQL plug-in APIConnection class 40JDBCConnection class 41ResultSet class 41ResultSetMetaData class 42SQL:ActiveRecord 39SQL:ColumnType 40SQL:Database 40SQLColumn class 43SQLDatabase class 43SQLDatabaseManager class 44SQLTable class 45

SQL plug-in configuration 37SSH commands, running 60SSH file copy

SCP get command 60SCP put command 61

SSH plug-inscripting API 54usage 53

SSH plug-in APIKeyPairManager class 54managing private and public SSH keys 54SSH:File type 54SSH:Folder type 54SSH:RootFolder type 54SSH:SshConnection type 54SSHCommand class 55SSHFile class 56SSHFolder class 56SSHSession class 57

SSH plug-in sample workflows 58SSH workflows

changing a key pair passphrase 59generating a key pair 58registering a public key 59

standard virtual switch workflows 25storage DRS workflows 27storage workflows 26

Ttools clone workflows 30

Uupdate a database 50

Using VMware vCenter Orchestrator Plug-Ins

86 VMware, Inc.

Page 87: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

updated information 9updating a database 39

VvCenter Server 5.1 plug-in

Inventory 18library accessing 18scripting API 18usage 17workflow library 19workflow library access 18workflow library accessing 18

vCO Library plug-inusage 35workflows 35

virtual machine folder managementworkflows 23

VMware Tools workflows 34

Wwindows customization clone workflows 31workflow documentation 84workflow documentation plug-in 83Workflow Documentation plug-in

scripting API 83workflow library 83

Workflow Documentation plug-in API, SSHFolderclass 83

workflowsbasic host management 23basic virtual machine 28batch 19clone 29cluster and compute resource 19custom attributes 21database configuration 37datacenter 21datacenter folder management 22datastore and files 22device management 31distributed virtual port group 24distributed virtual switch 25guest operation files 20guest operation processes 21host folder management 22host management registration 24linked clone 29Linux customization clone 30move and migrate 32networking 24other 32power host management 23power management 33

resource pool 26snapshot 33standard virtual switch 25standard workflows 50storage 26Storage DRS 27tools clone 30virtual machine folder management 23VMware Tools 34windows customization clone 31

XXML

DOM 63E4X 63

XML plug-inscripting API 63usage 63

XML plug-in APIXMLDocument class 63XMLElement class 64XMLManager class 65XMLNamedNodeMap class 65XMLNode class 66XMLNodeList class 67

XML plug-in sample workflowscreating a simple XML document 67creating an address book 69finding an element 68modifying an XML document 68

Index

VMware, Inc. 87

Page 88: Using VMware vCenter Orchestrator Plug-Ins - vCenter ... · Using VMware vCenter Orchestrator Plug-Ins is updated with each release of the product or when necessary. This table provides

Using VMware vCenter Orchestrator Plug-Ins

88 VMware, Inc.