VMware vCenter Orchestrator - 6.0 User Manual

Using the vCenter Orchestrator Plug-In
for vCloud Automation Center 6.2
vCenter Orchestrator 6.0.0
vCloud Automation Center 6.2.0
vRealize Automation 6.2.0
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-001681-00
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
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:
docfeedback@vmware.com
Copyright © 2012–2014 VMware, Inc. All rights reserved. Copyright and trademark information.
VMware, Inc.
3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com
2 VMware, Inc.

Contents

Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 5
Introduction to the VMware vCenter Orchestrator Plug-In for
1
vCloud Automation Center 7
Role of vCenter Orchestrator with the vCloud Automation Center Plug-In 7
Installing the vCloud Automation Center Plug-In 8
vCloud Automation Center Plug-In Functional Prerequisites 8
Install the vCloud Automation Center Plug-In On an External vCenter Orchestrator Server 8
Configuring the vCloud Automation Center Plug-In 11
2
Configuration Workflows 11
Add a vCloud Automation Center Host 12
Add an IaaS Host 13
Using the vCloud Automation Center Plug-In Workflows 15
3
Using the vCloud Automation Center Plug-In Inventory 15
Using the vCloud Automation Center Plug-In Administration Workflows 15
Using the vCloud Automation Center Plug-In Infrastructure Administration Workflows 19
Create a vCloud Automation Center Model Entity 21
Read a vCloud Automation Center Model Entity 22
Using the vCloud Automation Center Plug-In Requests Workflows 22
Using the vCloud Automation Center Plug-In Sample Workflows 22
Access the vCloud Automation Center Plug-In API 23
Example vCloud Automation Center Plug-In Scripts 25
4
CRUD Infrastructure Administration Tasks Example Scripts 25
Finding vCloud Automation Center Entities Example Scripts 29
Get a Resource Provisioned by vCloud Automation Center Example Script 30
Common Tasks Example Scripts 32
Transfer Content Between vCloud Automation Center Hosts Example Script 34
Index 37
VMware, Inc. 3
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
4 VMware, Inc.

Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2

Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 provides information and instructions about configuring and using the VMware® vCenter Orchestrator plug-in for VMware vCloud Automation Center 6.2.
Intended Audience
The information in Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 is written for experienced users who are familiar with virtual machine technology, with Orchestrator workflow development, and with VMware vCloud Automation Center.
For more information about Orchestrator, see
http://www.vmware.com/support/pubs/orchestrator_pubs.html.
For more information about vCloud Automation Center, see
http://www.vmware.com/support/pubs/vcac-pubs.html.
VMware Technical Publications Glossary
VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions of terms as they are used in VMware technical documentation, go to
http://www.vmware.com/support/pubs.
VMware, Inc.
5
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
6 VMware, Inc.
Introduction to the VMware vCenter Orchestrator Plug-In for
vCloud Automation Center 1
The VMware vCenter Orchestrator plug-in for vCloud Automation Center allows interaction between vCenter Orchestrator and vCloud Automation Center.
You can use the vCloud Automation Center plug-in to create and run workflows for the following vCloud Automation Center functions:
Service management
n
Catalog item and resource management and requesting
n
Advanced Services custom resource and blueprint management
n
Entitlement configuration
n
Approval policy configuration
n
Work item interactions
n
vSphere and vCloud Director virtual machine provisioning and post-provisioning actions
n
Create, read, update, and delete (CRUD) operations on the vCloud Automation Center IaaS model
n
This chapter includes the following topics:
“Role of vCenter Orchestrator with the vCloud Automation Center Plug-In,” on page 7
n
“Installing the vCloud Automation Center Plug-In,” on page 8
n

Role of vCenter Orchestrator with the vCloud Automation Center Plug-In

You use the Orchestrator client to run and create workflows and access the plug-in API. You can use either the embedded vCenter Orchestrator instance in your vCloud Automation Center installation, or an external vCenter Orchestrator server.
vCenter Orchestrator powers the vCloud Automation Center plug-in. Orchestrator is a development and process-automation platform that provides a library of extensible workflows to manage the vCenter infrastructure and other technologies.
Orchestrator allows integration with management and administration solutions through its open plug-in architecture.
VMware, Inc.
7
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2

Installing the vCloud Automation Center Plug-In

The vCloud Automation Center plug-in is installed on the embedded vCenter Orchestrator instance in your vCloud Automation Center installation. You can use the configuration interface of an external vCenter Orchestrator server to install the vCloud Automation Center plug-in.

vCloud Automation Center Plug-In Functional Prerequisites

To install and use the vCloud Automation Center plug-in, your system must meet certain functional prerequisites.
vCloud Automation Center
You must have access to a vCloud Automation Center server. Version 6.2 of the plug-in works with vCloud Automation Center 6.2.
For information about setting up vCloud Automation Center, see vCloud Automation Center Installation and Configuration.
vCenter Orchestrator Server
Version 6.2 of the plug-in works with vCenter Orchestrator 6.0.0.
For information about setting up Orchestrator, see Installing and Configuring VMware vCenter Orchestrator.
Other Prerequisites
For full plug-in functionality, you must uninstall Web Distributed Authoring and Versioning (WebDAV) from your Microsoft Web Server (IIS) role services.

Install the vCloud Automation Center Plug-In On an External vCenter Orchestrator Server

You can install the plug-in on an external vCenter Orchestrator server by using the Orchestrator configuration interface.
Prerequisites
Download the .vmoapp file that contains the plug-in.
n
Log in to the Orchestrator configuration interface at http://orchestrator_server:8283.
n
Procedure
1 On the General tab, click Install Application.
2 Upload the vCloud Automation Center plug-in.
a Click the magnifying glass icon.
b Select the .vmoapp file to install.
c Click Open.
d Click Install.
A message appears after successful installation. The vCloud Automation Center plug-in is installed without a tab in the Orchestrator configuration interface.
3 On the Startup Options tab, click Restart service to complete the plug-in installation.
8 VMware, Inc.
Chapter 1 Introduction to the VMware vCenter Orchestrator Plug-In for vCloud Automation Center
What to do next
Configure the vCloud Automation Center plug-in.
VMware, Inc. 9
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
10 VMware, Inc.
Configuring the
vCloud Automation Center Plug-In 2
You add vCloud Automation Center hosts and IaaS hosts to configure the plug-in.

Configuration Workflows

You can use the workflows in the Configuration workflow categories to manage vCloud Automation Center hosts.
vCloud Automation Center Hosts
You can access these workflows from the Workflows view of the Orchestrator client, in the Configuration subdirectory of the plug-in library.
Workflow Name Description
Add a vCAC host Adds a vCloud Automation Center host to the plug-in inventory. For tenant management
and administration tasks, you can use the Inventory view to run workflows on each tenant. To use the full function of the plug-in for a tenant, create a dedicated vCloud Automation Center host for each tenant.
Add a vCAC host using component registry
Add the IaaS host of a vCAC host
Remove a vCAC host Removes a vCloud Automation Center host from the plug-in inventory.
Update a vCAC host Updates a vCloud Automation Center host in the plug-in inventory.
Validate a vCAC host Validates the vCloud Automation Center host and the connection to it.
Adds a vCloud Automation Center host to the plug-in inventory with a Per User Session connection. You must be logged in to the Orchestrator client with the credentials of the vCloud Automation Center system administrator.
To use this function with an external vCenter Orchestrator server, you must register the Orchestrator server in the vCloud Automation Center component registry. To do this registration, you must run the Register vCO in vCAC Component Registry workflow and restart the Orchestrator server.
Adds the IaaS host of the selected vCloud Automation Center host to the plug-in inventory.
NOTE If your vCenter Orchestrator server is registered in the vCloud Automation Center component registry, a vCloud Automation Center host with the name Default is automatically added. The Default host is using Per User Session connection to the default tenant. The embedded Orchestrator server in the vCloud Automation Center installation is registered in the vCloud Automation Center component registry by default.
vCloud Automation Center IaaS Hosts
You can access these workflows from the Workflows view of the Orchestrator client, in the Infrastructure Administration > Configuration subdirectory of the plug-in library.
VMware, Inc.
11
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
The embedded Orchestrator server in the vCloud Automation Center installation is registered in the vCloud Automation Center component registry by default.
Workflow Name Description
Add an IaaS host Adds a vCloud Automation Center IaaS host to the plug-in inventory. This workflow is
functionally the same as Add the IaaS host of a vCAC host, but does not require a vCloud Automation Center host.
Remove an IaaS host Removes a vCloud Automation Center IaaS host from the plug-in inventory.
Update an IaaS host Updates a vCloud Automation Center IaaS host in the plug-in inventory.
Validate an IaaS host Validates the vCloud Automation Center IaaS host and the connection to it.

Add a vCloud Automation Center Host

You can run a workflow to a vCloud Automation Center host and configure the host connection parameters.
Procedure
1 From the drop-down menu in the Orchestrator client, select Run or Design.
2 Click the Workflows view.
3 Select Library > vCloud Automation Center > Configuration.
4 Right-click the Add a vCAC host workflow and select Start workflow.
5 Enter a unique name for the host in the Host Name text box.
6 Enter the URL address of the host in the Host URL text box.
For example: https://hostname.
7 (Optional) Enter the name of the tenant in the Tenant text box.
To use the full functionality of the plug-in for a tenant, create a dedicated vCloud Automation Center host for each tenant.
8 Select whether to install the SSL certificates automatically without user confirmation.
9 (Optional) To configure the length of time vCenter Orchestrator waits for a connection or response from
vCloud Automation Center, enter timeout intervals in the Connection timeout (seconds) and Operation timeout (seconds) text boxes.
10 Select the type of connection to the host from the Session mode drop-down menu.
Option Actions
Shared Session
Per User Session
Enter the credentials for a vCloud Automation Center user in the Authentication username and Authentication password text boxes.
Connect by using the credentials of the user that is currently logged in. You must be logged in to the Orchestrator client with the credentials of the vCloud Automation Center system administrator.
To use this option with an external vCenter Orchestrator server, you must run the Register vCO in vCAC Component Registry workflow and restart the Orchestrator server.
11 Click Submit.
What to do next
Add a vCloud Automation Center Infrastructure Administration host.
12 VMware, Inc.
Chapter 2 Configuring the vCloud Automation Center Plug-In

Add an IaaS Host

You can run a workflow to add the IaaS host of a vCloud Automation Center host and configure the connection parameters.
Procedure
1 From the drop-down menu in the Orchestrator client, select Run or Design.
2 Click the Workflows view.
3 Select Library > vCloud Automation Center > Configuration.
4 Right-click Add the IaaS host of a vCAC host and select Start workflow.
5 Select the vCloud Automation Center host for which you want to configure an IaaS host from the vCAC
host drop-down menu.
6 Click Next.
7 Enter a unique name for the host in the Host Name text box.
8 Enter the URL of the machine on which your Model Manager is installed.
For example: https://model_manager_machine.com.
9 (Optional) To configure the length of time vCenter Orchestrator waits for a connection or response from
vCloud Automation Center, enter timeout intervals in the Connection timeout (seconds) and Operation timeout (seconds) text boxes.
10 Click Next.
11 Select the type of connection to the host from the Session mode drop-down menu.
Option Actions
Shared Session
Per User Session
In the Authentication username and Authentication password text boxes, enter credentials for a vCloud Automation Center user who has administrative rights to the machine where the IaaS Model Manager is installed.
Connect by using the credentials of the user that is currently logged in. You must be logged in to the Orchestrator client with the credentials of a vCloud Automation Center user who has administrative rights to the machine where the IaaS Model Manager is installed.
12 Click Next.
13 Enter the name of the Workstation machine and the NetBIOS domain name.
14 Click Submit.
VMware, Inc. 13
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
14 VMware, Inc.
Using the vCloud Automation Center
Plug-In Workflows 3
The vCloud Automation Center plug-in workflow library contains workflows that you can use for common tasks such as interacting with the catalog, managing infrastructure, and creating tenants and services.
You can use custom HTTP headers, such as the vCloud Automation Center specific headers Tasks and Identity, and apply them in the CRUD, provisioning, and post-provisioning workflows.
This chapter includes the following topics:
“Using the vCloud Automation Center Plug-In Inventory,” on page 15
n
“Using the vCloud Automation Center Plug-In Administration Workflows,” on page 15
n
“Using the vCloud Automation Center Plug-In Infrastructure Administration Workflows,” on
n
page 19
“Using the vCloud Automation Center Plug-In Requests Workflows,” on page 22
n
“Using the vCloud Automation Center Plug-In Sample Workflows,” on page 22
n
“Access the vCloud Automation Center Plug-In API,” on page 23
n

Using the vCloud Automation Center Plug-In Inventory

You can use the Inventory view to run workflows on vCloud Automation Center objects.
To display the workflows that are available for an inventory object, navigate to Tools > User preferences > Inventory and select the Use contextual menu in inventory check box. After the option is enabled, when you right-click an object in the Orchestrator inventory, all available workflows for the object are displayed.

Using the vCloud Automation Center Plug-In Administration Workflows

You can use the administration workflows to manage vCloud Automation Center services, tenants, approval policies, entitlements, business groups, catalog items, and Advanced Services components.
You can find these workflows on the Workflows view of the Orchestrator client, in the Administration subdirectory of the plug-in library.
You can use the workflows in the Approval Policies subdirectory to create and manage approval policies.
VMware, Inc.
15
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
Table 31. Approval Policies
Workflow Description
Activate an approval policy Activates an approval policy. After you activate an
Add an approval level Adds an always required approval level to an approval.
Copy an approval policy Copies an approval policy.
Create an approval policy Creates a draft approval policy with no levels or approvers.
Deactivate an approval policy Deactivates an approval policy. You can also delete all
Delete an approval policy Deletes an approval policy that is in draft state. Active
You can use the workflows in the ASD Custom Resources subdirectory to create and delete Advanced Services custom resources.
Table 32. ASD Custom Resources
Workflow Description
Create custom resource Creates a custom resource.
Delete custom resource Removes a custom resource.
approval policy, it becomes read-only.
You must select specific users and groups for the approvers.
Run the Add an approval level workflow to create approval levels and designate approvers for your policy.
existing entitlements associated with the approval policy.
approval policies are read-only.
You can use the workflows in the ASD Resource Actions subdirectory to create and manage Advanced Services resource actions.
Table 33. ASD Resource Actions
Workflow Description
Clone resource action Creates a copy of an existing resource action.
Create resource action Creates a resource action.
Delete resource action Deletes a resource action.
Publish resource action Publishes a resource action.
Unpublish resource action Unpublishes a resource action.
You can use the workflows in the ASD Service Blueprints subdirectory to create and manage Advanced Services service blueprints.
Table 34. ASD Service Blueprints
Workflow Description
Clone a service blueprint Creates a copy of a service blueprint.
Create a service blueprint Creates a service blueprint.
Delete a service blueprint Deletes a service blueprint.
Publish a service blueprint Publishes a service blueprint.
Unpublish a service blueprint Unpublishes a service blueprint.
You can use the workflows in the Business Groups subdirectory to create and manage business groups.
16 VMware, Inc.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows
Table 35. Business Groups
Workflow Description
Add a custom property Adds a custom property to a business group.
Create a business group Creates a business group.
Delete a business group Deletes a business group.
Delete a custom property Removes a custom property from a business group.
Update a business group Updates details for a business group, such as default
machine prefix, active directory containers, and user roles.
Update a custom property Updates a custom property for a business group.
You can use the workflows in the Catalog Items subdirectory to manage catalog items.
Table 36. Catalog Items
Workflow Description
Activate a catalog item Activates a catalog item. You must activate and assign a
catalog item to a service before users can request it.
Assign a catalog item to a service Assigns a catalog item to a service. You must activate and
assign a catalog item to a service before users can request it.
Deactivate a catalog item Deactivates a catalog item and removes it from the service
catalog so that users cannot request it.
You can use the workflows in the Content subdirectory to manage Advanced Services custom resources, service blueprints, resource mappings, and resource actions.
Table 37. Content
Workflow Description
Export content Export Advanced Services components as a
vCenter Orchestrator resource bundle.
Import content
Transfer content Transfer Advanced Services components between
Validate content Ensures that all workflows required for imported
Import Advanced Services components from a .zip file. You can also use the Import content workflow to transfer workflows from a .package file to a separate vCenter Orchestrator associated with your vCloud Automation Center.
For example, if you are running an external vCenter Orchestrator and an embedded vCenter Orchestrator, and both are configured for the same vCloud Automation Center host, you can run the import content workflow from the external vCenter Orchestrator to install workflows on the embedded instance.
vCloud Automation Center tenants.
Advanced Services components exist.
You can use the workflows in the Entitlements subdirectory to create and manage entitlements.
Table 38. Entitlements
Workflow Description
Activate an entitlement Activates an entitlement.
Assign catalog items to an entitlement Assigns one or more catalog items to an entitlement. You
can also use this workflow to assign an approval policy.
VMware, Inc. 17
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
Table 38. Entitlements (Continued)
Workflow Description
Assign resource actions to an entitlement Assigns one or more resource actions to an entitlement.
Assign immediate actions to an entitlement Assigns one or more immediate actions to an entitlement.
Assign services to an entitlement Assigns one or more services to an entitlement. You can
Assign users and groups to an entitlement Assigns one or more users or groups to an entitlement.
Create an entitlement Creates an entitlement.
Deactivate an entitlement Deactivates an entitlement.
You can use the workflows in the Services subdirectory to manage services.
Table 39. Services
Workflow Description
Activate a service Activates a service.
Assign catalog items to a service Assigns one or more catalog items to a service.
Copy a service Copies a service.
Create a service Creates a service.
Deactivate a service Deactivates a service.
Delete a service Deletes a service.
You can also use this workflow to assign an approval policy.
The immediate actions do not create requests.
also use this workflow to assign an approval policy.
You can use the workflows in the Tenants subdirectory to create and manage tenants.
Table 310. Tenants
Workflow Description
Add administrators Adds one or more tenant administrators and infrastructure
administrators to a tenant.
Add an identity store to a tenant Adds an identity store to a tenant of a
vCloud Automation Center host. You can run this workflow only if you are a system administrator configuring a tenant.
Add an identity store to a vCAC host Adds an identity store to a tenant that is configured as a
vCloud Automation Center host. You can run this workflow only if you are a tenant administrator configuring an identity store for your tenant.
Create a tenant Creates a tenant. You must select the
vCloud Automation Center host added with the system administrator credentials.
Delete an identity store from a tenant Deletes an identity store from a tenant of a
vCloud Automation Center host. You can run this workflow only if you are a system administrator configuring a tenant.
Delete an identity store from a vCAC host Deletes an identity store from a tenant that is configured as
a vCloud Automation Center host. You can run this workflow only if you are a tenant administrator configuring identity stores for your tenant.
Delete a tenant Deletes a tenant.
18 VMware, Inc.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows
Table 310. Tenants (Continued)
Workflow Description
Remove administrators Removes one or more tenant administrators and
infrastructure administrators from a tenant.
Update an identity store for a tenant Updates an existing identity store for a tenant of a
vCloud Automation Center host. You can run this workflow only if you are a system administrator configuring a tenant.
Update an identity store for a vCAC host Updates an identity store for a tenant that is configured as
a vCloud Automation Center host. You can run this workflow only if you are a tenant administrator configuring identity stores for your tenant.
Update a tenant Updates the name, description, and contact email address
of an existing tenant.

Using the vCloud Automation Center Plug-In Infrastructure Administration Workflows

You can use the infrastructure administration workflows to provision virtual machines and run basic or CRUD operations. You use the extensibility package to customize vCloud Automation Center with the ability to call vCenter Orchestrator workflows either as part of the provisioning process, or by using custom operation menus.
You can find the infrastructure administration workflows on the Workflows view of the Orchestrator client, in the Infrastructure Administration subdirectory of the plug-in library.
You can use the infrastructure administration workflows to provision virtual machines and run basic or CRUD operations.
VMware, Inc. 19
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
Table 311. Infrastructure Administration
Workflow Name Description
Await virtual machine state change Awaits a state change for a set of virtual machines. If all
Create a vCAC model entity Creates and persists an entity for a specified
Delete a vCAC model entity Deletes a specified vCloud Automation Center model
Invoke a post-provisioning action Invokes a specified post-provisioning action on a virtual
Provision a virtual machine from a blueprint (Deprecated) This workflow is deprecated. You must user either the
Read a vCAC entity by custom filter Reads a list of vCloud Automation Center entities by using
Read a vCAC entity by system query Reads a list of vCloud Automation Center entities by using
Read a vCAC model entity Reads a vCloud Automation Center model entity by its ID.
Update a vCAC model entity Updates a vCloud Automation Center model entity by its
virtual machines are in the success state, a trigger is called and the workflow ends successfully. If any of the specified virtual machines gets into the fail state, or does not exist, the workflow fails. You must enter the success and fail states selecting from the following options:
n
Requested
n
AwaitingApproval
n
RegisterMachine
n
BuildingMachine
n
AddingDisks
n
MachineProvisioned
n
MachineActivated
n
InstallTools (VMware only)
n
On
n
Off
n
TurningOn
n
TurningOff
n
ShuttingDown
n
Suspending
n
Resetting
n
Rebooting
n
Expired
n
DeactivateMachine
n
UnprovisionMachine
n
Disposing
n
Finalized
vCloud Automation Center model.
entity.
machine.
Request a catalog item workflow, or the Request a catalog item on behalf of a user workflow. See Using the vCloud Automation Center Plug-In Requests Workflows.
a custom filter. If you do not specify a filter, all entities are returned as a result.
OData system filters. The system filters apply to the OData URI convention.
ID.
You use the workflows in the Extensibility subdirectory to customize vCloud Automation Center with the ability to call vCenter Orchestrator workflows either as part of the provisioning process, or by custom operation menus.
20 VMware, Inc.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows
Table 312. Extensibility
Workflow Name Description
Install vCO customization Installs an Orchestrator customization including
customized state change workflow stubs and Orchestrator menu operation workflows.
Uninstall vCO customization Uninstalls an Orchestrator customization including
customized state change workflow stubs and Orchestrator menu operation workflows.
Import vCAC Virtual Machine (deprecated Register vCAC Virtual Machine)
Import vCenter Virtual Machine (deprecated Register vCenter Virtual Machine)
Unregister Virtual Machine Removes a virtual machine from the
Assign a menu operation to a blueprint and its virtual machines
Assign a menu operation to virtual machines Updates a vCloud Automation Center model entity by its
Assign a state change workflow to a blueprint and its virtual machines
Customize a menu operation Updates a vCloud Automation Center operation menu.
Remove a menu operation from a blueprint and its virtual machines
Remove a state change workflow from a blueprint and its virtual machines
Imports a vCloud Automation Center virtual machine, maps it to a blueprint, and adds it to the catalog.
Imports a vSphere virtual machine, maps it to a blueprint, and adds it to the catalog.
vCloud Automation Center inventory.
Adds or updates a menu operation on virtual machines.
ID.
Adds or updates a state change workflow on several blueprints and their virtual machines.
Removes a menu operation from a blueprint and its virtual machines.
Removes a state change workflow from a blueprint and its virtual machines.

Create a vCloud Automation Center Model Entity

You can run a workflow to create a simple or complex vCloud Automation Center entity, such as a blueprint reference to a business group.
Procedure
1 From the drop-down menu in the Orchestrator client, select Run or Design.
2 Click the Workflows view.
3 Select Library > vCloud Automation Center > Infrastructure Administration.
4 Right-click the Create a vCAC model entity workflow and select Start workflow.
5 Select a vCloud Automation Center host.
6 Enter the name of the model in the Model name text box.
7 Enter the name of the entity set, in the Entity set name text box.
You use scripting or a REST API to set the Simple properties, Links to complex properties, and HTTP headers properties.
8 Click Submit to run the workflow.
VMware, Inc. 21
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2

Read a vCloud Automation Center Model Entity

You can run a workflow to read a vCloud Automation Center model entity.
Procedure
1 From the drop-down menu in the Orchestrator client, select Run or Design.
2 Click the Workflows view.
3 Select Library > vCloud Automation Center > Infrastructure Administration.
4 Right-click Read a vCAC model entity and select Start workflow.
5 Select a vCloud Automation Center host.
6 Enter the name of the model in the Model name text box.
7 Enter the name of the entity set, in the Entity set name text box.
You use scripting or a REST API to set the HTTP headers property.
8 Click Submit to run the workflow.

Using the vCloud Automation Center Plug-In Requests Workflows

You can use the requests workflows to request catalog items and resource actions, and to complete or cancel work items.
You can access these workflows from the Workflows view of the Orchestrator client, in the Requests subdirectory of the plug-in library.
Workflow Description
Cancel a work item Cancels an active work item. You can use this workflow only if you are a system
administrator.
Complete a work item Completes a work item.
Request a catalog item Requests a catalog item for the user running the workflow.
Request a catalog item on behalf of a user
Request a resource action Requests a resource action for a catalog item owned by the user running the
Request a resource action on behalf of a user
Wait for catalog item request Waits for a catalog item request to complete.
Wait for resource action request Waits for a resource action request to complete.
Wait for work item Waits for a work item to complete.
Sends a request for a catalog item on behalf of a user. You can use this workflow only for catalog items entitled to both you and the user on behalf of whom you are sending the request.
workflow.
Sends a request for a resource action on behalf of a user. You can use this workflow only for resource actions entitled to both you and the user on behalf of whom you are sending the request.

Using the vCloud Automation Center Plug-In Sample Workflows

You can use the sample workflows as examples, or as starting points for creating your own custom workflows.
You can find these workflows on the Workflows view of the Orchestrator client, in the Sample subdirectory of the plug-in library.
22 VMware, Inc.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows
Workflow Name Description
Create a permission Provides a sample script that interacts with the authorization client and permission service to
create a new permission in vCloud Automation Center.
Create a tenant Creates a tenant with the same vCAC host and Identity Store configuration as the default tenant.
To run this workflow, select the vCAC host added with system administrator credentials. You can change the Identity Store settings before running the workflow.
List catalog items Returns a list of catalog items for the selected tenant.

Access the vCloud Automation Center Plug-In API

Orchestrator provides an API Explorer to allow you to search the vCloud Automation Center plug-in API and see the documentation for JavaScript objects that you can use in scripted elements.
For updated vCloud Automation Center API documentation, see
https://www.vmware.com/support/pubs/vcac-pubs.html.
Procedure
1 Log in to the Orchestrator client as an administrator.
2 Select Tools > API Explorer.
3 Double-click the vCAC and VCACCAFE modules in the left pane to expand the hierarchical list of
vCloud Automation Center plug-in API objects.
What to do next
You can copy code from API elements and paste it into scripting boxes. For more information about API scripting, see Developing with VMware vCenter Orchestrator.
VMware, Inc. 23
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
24 VMware, Inc.
Example vCloud Automation Center
Plug-In Scripts 4
You can cut, paste, and edit the JavaScript examples provided to develop your own custom scripts for automating vCloud Automation Center tasks.
This chapter includes the following topics:
“CRUD Infrastructure Administration Tasks Example Scripts,” on page 25
n
“Finding vCloud Automation Center Entities Example Scripts,” on page 29
n
“Get a Resource Provisioned by vCloud Automation Center Example Script,” on page 30
n
“Common Tasks Example Scripts,” on page 32
n
“Transfer Content Between vCloud Automation Center Hosts Example Script,” on page 34
n

CRUD Infrastructure Administration Tasks Example Scripts

You can cut, paste, and edit the JavaScript examples to write scripts for CRUD vCloud Automation Center tasks.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
Example: Create a vCloud Automation Center Model Entity
This example script performs the following actions:
1 Defines the model name and the entity set name.
2 Defines the properties of the host prefix.
3 Saves the host prefix entity.
4 Defines the properties of the provisioning group.
5 Defines the provisioning group as a link.
6 Saves the provisioning group entity, by linking it with the host name prefix.
VMware, Inc.
25
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
Table 41. Input Variables
Variable Type
host vCAC:VcacHost
var modelName = 'ManagementModelEntities.svc'; var entitySetName = 'HostNamePrefixes'; var links = null; var headers = null; //Create properties for prefix entity var prefixInputProperties = { MachinePrefix:'test-prefix', NextMachineNo:1, MachineNumberLength:3 }; //Save the prefix var prefixEntity = vCACEntityManager .createModelEntity(host.id, modelName, entitySetName, prefixInputProperties, links, headers); entitySetName = 'ProvisioningGroups'; //Create properties for the provisioning group entity inputProperties = { GroupName:'TestGroupName', GroupDescription:'This group was generated with a vCO workflow', AdministratorEmail:'test@test.com', AdContainer:'AD', IsTestGroup:false, Flags:2, GroupType:1}; //Add a reference to the newly created prefix entity links = { HostNamePrefix:prefixEntity }; //Save the provisioning group var entity = vCACEntityManager.createModelEntity(host.id, modelName, entitySetName, inputProperties, links, headers);
Example: Update a vCloud Automation Center Model Entity
This example script performs the following actions:
1 Gets the host ID from the provided entity.
2 Gets the model name from the provided entity.
3 Gets the entity set name from the provided entity.
4 Gets the entity ID from the provided entity.
5 Defines a set of properties that will be updated.
6 Starts the action responsible for updating the entity.
26 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 42. Input Variables
Variable Type
entity vCAC:Entity
updatedDescription
var hostId = entity.hostId; var modelName = entity.modelName; var entitySetName = entity.entitySetName; var entityIdString = entity.keyString; var links = null; var headers = null; var updateProperties = new Properties(); updateProperties.put("UserNameDescription", updatedDescription); //Update the user description System.getModule("com.vmware.library.vcac") .updateVCACEntity(hostId, modelName, entitySetName, entityIdString, updateProperties, links, headers);
String
Example: Read a vCloud Automation Center Model Entity
This example script performs the following actions:
1 Defines the model name and the entity set name.
2 Defines the blueprint ID with a property object.
3 Reads the entity.
Table 43. Input Variables
Variable Type
host vCAC:VcacHost
blueprintID
var modelName = 'ManagementModelEntities.svc'; var entitySetName = 'VirtualMachineTemplates'; var links = null; var headers = null; //Create properties for the prefix entity var blueprintId = { VirtualMachineTemplateID:blueprintId, }; //Read the blueprint var entity = vCACEntityManager .readModelEntity(host.id, modelName, entitySetName, blueprintId, headers);
String
Example: Delete a vCloud Automation Center Model Entity
This example script performs the following actions:
1 Gets the host ID from the provided entity.
2 Gets the model name from the provided entity.
3 Gets the entity set name from the provided entity.
4 Gets the entity ID from the provided entity.
VMware, Inc. 27
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
5 Starts the action responsible for deleting the entity.
Table 44. Input Variables
Variable Type
entity vCAC:Entity
var hostId = entity.hostId; var modelName = entity.modelName; var entitySetName = entity.entitySetName; var entityKeyString = entity.keyString; var headers = null; //Delete the entity System.getModule("com.vmware.library.vcac") .deleteVCACEntity(hostId, modelName, entitySetName, entityKeyString, headers);
Example: Read a vCloud Automation Center Entity by Custom Filter
This example script performs the following actions:
1 Defines the model name and the entity set name.
2 Defines the properties by which the entities are filtered.
3 Reads a list of entities.
Table 45. Input Variables
Variable Type
host vCAC:VcacHost
templateName
var modelName = 'ManagementModelEntities.svc'; var entitySetName = 'VirtualMachineTemplates'; var headers = null; //Create properties for prefix entity var properties = { VirtualMachineTemplateName:templateName, }; //Read a list of entities var entities = vCACEntityManager .readModelEntitiesByCustomFilter(host.id, modelName, entitySetName, properties, headers);
String
Example: Read a vCloud Automation Center Entity by System Query
This example script performs the following actions:
1 Defines the model name and the entity set name.
2 Defines the system queries by which the entities are filtered and selects the top ten results of all virtual
machines, filtered by the machine state and component flag.
3 Reads a list of entities.
28 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 46. Input Variables
Variable Type
host vCAC:VcacHost
var modelName = 'ManagementModelEntities.svc'; var entitySetName = 'VirtualMachines'; var filter = "VirtualMachineState eq 'Off' and IsComponent eq true"; var orderBy = 'VirtualMachineName asc'; var top = 10; { var skip = 0;, var headers = null; var select = null; var entities = vCACEntityManager readModelEntitiesBySystemQuery(host.id, modelName, entitySetName, filter, orderBy, select, top, skip, headers);

Finding vCloud Automation Center Entities Example Scripts

You can cut, paste, and edit the JavaScript examples to write scripts for finding vCloud Automation Center entities by using the vCACCAFEEntitiesFinder scripting utility object.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
Example: Find Catalog Resources Filtered by Name
Table 47. Input Variables
Variable Type
host vCAC:VcacHost
You can use one the following examples:
This example script gets all catalog resources for the target host matching the query of
n
name_of_the_resource by name and description.
var items = vCACCAFEEntitiesFinder.findCatalogResources(host, "name_of_the_resource");
This example script performs the following actions:
n
a Gets the Consumer Resource service and invokes the get method passing as a Pageable parameter
an instance of the vCACCAFEPageOdataRequest object.
b Creates the vCACCAFEPageOdataRequest object by providing an OData query as a single filter of the
name attribute matching the name_of_the_resource string.
var service = host.createCatalogClient().getCatalogConsumerResourceService();
var filter = new Array(); filter[0] = vCACCAFEFilterParam.equal("name", vCACCAFEFilterParam.string("name_of_the_resource")); var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
VMware, Inc. 29
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
Example: Find Catalog Resources Filtered by Owner
This example script performs the following actions:
1 Gets the Consumer Resource service and invokes the get method passing as a Pageable parameter an
instance of the vCACCAFEPageOdataRequest object.
2 Creates the vCACCAFEPageOdataRequest object by providing an OData query as a single filter of the
owner/ref attribute matching the user@domain.com string.
The owners/ref attribute is a composition based on the internal structure and fields of the catalog resources. The vCACCAFECatalogResource entity has the owners attribute, which is a collection of
vCACCAFECatalogPrincipal entities. The vCACCAFECatalogPrincipal entity has the ref property, which is
a string representation of the principal id of the user.
var filter = new Array(); filter[0] = vCACCAFEFilterParam.substringOf("owners/ref", vCACCAFEFilterParam.string("user@domain.com")); var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
Example: Find Catalog Resources Filtered by Name and Owner
This example script combines the OData queries from the previous two examples into a single one condition by using the vCACCAFEFilterParam.and(array of conditions) logic operator.
var conditions = new Array(); conditions[0] = vCACCAFEFilterParam.equal("name", vCACCAFEFilterParam.string("name_of_the_resource_here")); conditions[1] = vCACCAFEFilterParam.substringOf("owners/ref", vCACCAFEFilterParam.string("user@domain.com"));
var filter = new Array(); filter[0] = vCACCAFEFilterParam.and(conditions); var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
You can define other conditions by using different logic operators such as
vCACCAFEFilterParam.group(array of parameters), vCACCAFEFilterParam.not(parameter), vCACCAFEFilterParam.startsWith(id, string), vCACCAFEFilterParam.endsWith(id, string), vCACCAFEFilterParam.greaterThan(id, number), vCACCAFEFilterParam.lessThan(id, number), and so on.

Get a Resource Provisioned by vCloud Automation Center Example Script

You can cut, paste, and edit the JavaScript example to write scripts for retrieving the actual entities of vCloud Automation Center provisioned resources.
The CatalogResource type represents the provisioned resources in vCloud Automation Center. This type has an attribute of ProviderBinding type which represents the relation between the catalog resource and its provider with the following attributes:
bindingId - represents the identifier of the entity which is unique for the provider
n
30 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
providerRef - identifies the catalog provider which corresponds directly to a service registered in
n
thevCloud Automation Center component registry
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
Example: Get a Virtual Machine Provisioned as a vCloud Automation Center Catalog Resource
This example uses a vCloud Automation Center host and its IaaS host as input parameters and, for a provided resource id, returns the corresponding IaaS virtual machine. The scripting code takes only catalog resources of Virtual Machine type that are provisioned by the iaas-service provider.
Table 48. Input Variables
Variable Type
vcacHost vCACCAFE:VCACHost
iaasHost vCAC:VCACHost
// Id of the catalog resource (or vCACCAFECatalogResource_instance.getId()) var resourceId = "c222629c-6f90-4458-8c92-8ece0ba06173";
var resource = vCACCAFEEntitiesFinder.getCatalogResource(vcacHost, resourceId);
var resourceType = resource.getResourceTypeRef().getLabel(); System.log("resource type: " + resourceType);
var providerBinding = resource.getProviderBinding();
var bindingId = providerBinding.getBindingId(); System.log("provider binding id: " + bindingId);
var provider = providerBinding.getProviderRef(); System.log("provider id: " + provider.getId()); System.log("provider name: " + provider.getLabel());
if ((resourceType == "Virtual Machine") && (provider.getLabel() == "iaas-service")) { System.log("It is an IaaS VM!");
// IaaS virtual machine var vm = Server.findForType("vCAC:VirtualMachine", bindingId); System.log("IaaS VM id: " + vm.virtualMachineID); System.log("IaaS VM name: " + vm.displayName);
// IaaS Entity var entity = System.getModule("com.vmware.library.vcac").getVirtualMachineEntityFromId(iaasHost, bindingId); System.log("IaaS entity id: " + entity.keyString); }
VMware, Inc. 31
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2

Common Tasks Example Scripts

You can cut, paste, and edit the JavaScript examples, or use them as samples to help you learn to develop your own scripts for common vCloud Automation Center tasks.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
Example: Create a vCloud Automation Center Advanced Service Blueprint
This example script performs the following actions:
1 Sets the vCenter Orchestrator workflow used to build the service blueprint.
2 Generates the content for the service blueprint based on the workflow.
3 Creates the service blueprint entity.
4 Publishes the service blueprint.
Table 49. Input Variables
Variable Type
host vCACCAFE:VCACHost
//ID of the workflow used to create the service blueprint var workflowId = "44e42047-2fa0-4e4a-ba0c-12086540b28b";
var name = "MyBlueprint" var description = "Blueprint description"; var workflowClient = host.createAdvancedDesignerClient().getAdvancedDesignerWorkflowService();
//Generate a service blueprint based on the workflow ID var blueprint = workflowClient.generateServiceBlueprintByWorkflowId(workflowId); blueprint.setTenant(host.tenant); blueprint.setName(name); blueprint.setDescription(description);
//Create the service blueprint var blueprintService = host.createAdvancedDesignerClient().getAdvancedDesignerServiceBlueprintService(); var uri = blueprintService.createServiceBlueprint(host.tenant , blueprint);
//Publish the service blueprint var createdBlueprint = blueprintService.getServiceBlueprintByUri(uri); blueprintService.updateServiceBlueprintStatus(host.tenant, createdBlueprint.getId(), vCACCAFEDesignerPublishStatus.PUBLISHED);
Example: Create a vCloud Automation Center Approval Policy
This example script performs the following actions:
1 Gets the approval policy type.
2 Sets the user and group whose approval is required.
3 Sets the approval levels.
32 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
4 Defines the pre-provisioning approval phase.
5 Defines the post-provisioning approval phase.
6 Defines the approval policy specifications such as name, description, and type.
7 Creates the approval policy.
8 Publishes the approval policy. Once an approval policy is published, it becomes read-only.
Table 410. Input Variables
Variable Type
host vCACCAFE:VCACHost
// Get the type of approval policy by ID var typeService = host.createApprovalClient().getApprovalApprovalPolicyTypeService(); var type = typeService.getApprovalPolicyType("com.vmware.cafe.catalog.request");
// Set the user and group required to complete the approval var user = new vCACCAFEApprovalPrincipal(); user.setValue("user@domain.com"); user.setType(vCACCAFEApprovalPrincipalType.USER);
var group = new vCACCAFEApprovalPrincipal(); group.setValue("group@domain.com"); group.setType(vCACCAFEApprovalPrincipalType.GROUP);
// Set the level of the approval var level = new vCACCAFEApprovalLevel(); level.setName("IT Approval Level"); level.setDescription("IT Approval Level description"); level.setApprovalMode(vCACCAFEApprovalMode.ALL); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(level, "getApprovers", user); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(level, "getApprovers", group); level.setLevelNumber(1);
// Set pre-provisioning phase type and the phase of the approval var phase1Type = new vCACCAFEApprovalPhaseType(); phase1Type.setId("com.vmware.cafe.catalog.request.pre"); phase1Type.setName("Pre-Provisioning type"); phase1Type.setDescription("Pre-Provisioning type description"); phase1Type.setPhaseOrder(1);
var phase1 = new vCACCAFEPhase(); phase1.setName("Pre-Provisioning"); phase1.setDescription("Pre provisioning phase"); phase1.setPhasetype(phase1Type); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(phase1, "getLevels", level);
// Set post-provisioning phase type and the phase of the approval var phase2Type = new vCACCAFEApprovalPhaseType(); phase2Type.setId("com.vmware.cafe.catalog.request.post"); phase2Type.setName("Post-Provisioning type");
VMware, Inc. 33
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
phase2Type.setDescription("Post-Provisioning type description"); phase2Type.setPhaseOrder(1);
var phase2 = new vCACCAFEPhase(); phase2.setName("Post-Provisioning"); phase2.setDescription("Post provisioning phase"); phase2.setPhasetype(phase2Type); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(phase2, "getLevels", level);
// Create the approval policy specifications var spec = new vCACCAFEApprovalPolicy(); spec.setName("New Policy"); spec.setDescription("New Policy description"); spec.setPolicyType(type); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(spec, "getPhases", phase1); System.getModule("com.vmware.library.vcaccafe.util").addElementToList(spec, "getPhases", phase2);
// Create the approval policy var approvalPolicyService = host.createApprovalClient().getApprovalApprovalPolicyService(); var approvalPolicy = approvalPolicyService.createPolicy(spec);
// Publish the approval policy approvalPolicy.setState(vCACCAFEApprovalPolicyState.PUBLISHED); approvalPolicy = approvalPolicyService.update(approvalPolicy); System.log("New approval policy id: " + approvalPolicy.getId());

Transfer Content Between vCloud Automation Center Hosts Example Script

You can cut, paste, and edit the JavaScript example to write scripts for content transfer between vCloud Automation Center hosts by using the Content service.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
Example: Transfer Content from One vCloud Automation Center Host to Another vCloud Automation Center Host
This example script performs the following actions:
1 Defines the source host that is based on a tenant administrator role.
2 Exports the content of the source host.
3 Defines the target host that is based on a tenant administrator role.
4 Imports the content to the target source.
34 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 411. Input Variables
Variable Type
sourceHost string
targetHost string
var CONTENT_MANAGEMENT_SERVICE = "com.vmware.csp.core.content.service.api"; var content;
System.log("Source host: " + sourceHost.url); System.log("Source tenant: " + sourceHost.tenant);
var contentClientExport = sourceHost.createRestClient(CONTENT_MANAGEMENT_SERVICE); System.log("Exporting..."); content = contentClientExport.getFile("content"); System.log("Export successful");
System.log("Target host: " + targetHost.url); System.log("Target tenant: " + targetHost.tenant);
var contentClientImport = targetHost.createRestClient(CONTENT_MANAGEMENT_SERVICE); System.log("Importing..."); contentClientImport.postFile("content", content); System.log("Import successful");
VMware, Inc. 35
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
36 VMware, Inc.

Index

A
adding a vCloud Automation Center model
entity 21 API access 23 audience 5
E
example 29, 30, 34
F
finding catalog resources 29 functional prerequisites 8
G
getting a provisioned virtual machine 30
H
host
configuring 11 managing 11
I
IaaS host, configuring 13 installing
external vCenter Orchestrator server 8 vCloud Automation Center plug-in 8
Inventory 15
V
vCloud Automation Center host, configuring 12 vCloud Automation Center plug-in
configuring 11 installing 8 installing in external vCenter Orchestrator
server 8
introduction 7
vCloud Automation Center model entity
adding 21 reading 22
W
workflow library 15, 25 workflows
configuring 11 CRUD 15, 19, 22 extensibility workflows 19 IaaS 19 model entity 15, 19, 22 requests workflows 22 standard workflows 15, 19, 22
O
Orchestrator 7
R
reading a vCloud Automation Center model
entity 22
S
script for content transfer between vCAC
hosts 34 scriptable task elements 25, 32 scripting 25, 32
U
using the vCACCAFEEntitiesFinder object 29
VMware, Inc. 37
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
38 VMware, Inc.
Loading...