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:
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.25
Introduction to the VMware vCenter Orchestrator Plug-In for
1
vCloud Automation Center7
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-In11
2
Configuration Workflows 11
Add a vCloud Automation Center Host 12
Add an IaaS Host 13
Using the vCloud Automation Center Plug-In Workflows15
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 Scripts25
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
Index37
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.
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 Center1
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 andConfiguration.
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
1On the General tab, click Install Application.
2Upload the vCloud Automation Center plug-in.
aClick the magnifying glass icon.
bSelect the .vmoapp file to install.
cClick Open.
dClick Install.
A message appears after successful installation. The vCloud Automation Center plug-in is installed
without a tab in the Orchestrator configuration interface.
3On 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-In2
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 NameDescription
Add a vCAC hostAdds 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 hostRemoves a vCloud Automation Center host from the plug-in inventory.
Update a vCAC hostUpdates a vCloud Automation Center host in the plug-in inventory.
Validate a vCAC hostValidates 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 NameDescription
Add an IaaS hostAdds 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 hostRemoves a vCloud Automation Center IaaS host from the plug-in inventory.
Update an IaaS hostUpdates 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
1From the drop-down menu in the Orchestrator client, select Run or Design.
2Click the Workflows view.
3Select Library > vCloud Automation Center > Configuration.
4Right-click the Add a vCAC host workflow and select Start workflow.
5Enter a unique name for the host in the Host Name text box.
6Enter 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.
8Select 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.
OptionActions
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
1From the drop-down menu in the Orchestrator client, select Run or Design.
2Click the Workflows view.
3Select Library > vCloud Automation Center > Configuration.
4Right-click Add the IaaS host of a vCAC host and select Start workflow.
5Select the vCloud Automation Center host for which you want to configure an IaaS host from the vCAC
host drop-down menu.
6Click Next.
7Enter a unique name for the host in the Host Name text box.
8Enter 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.
OptionActions
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 Workflows3
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 3‑1. Approval Policies
WorkflowDescription
Activate an approval policyActivates an approval policy. After you activate an
Add an approval levelAdds an always required approval level to an approval.
Copy an approval policyCopies an approval policy.
Create an approval policyCreates a draft approval policy with no levels or approvers.
Deactivate an approval policyDeactivates an approval policy. You can also delete all
Delete an approval policyDeletes 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 3‑2. ASD Custom Resources
WorkflowDescription
Create custom resourceCreates a custom resource.
Delete custom resourceRemoves 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 3‑3. ASD Resource Actions
WorkflowDescription
Clone resource actionCreates a copy of an existing resource action.
Create resource actionCreates a resource action.
Delete resource actionDeletes a resource action.
Publish resource actionPublishes a resource action.
Unpublish resource actionUnpublishes a resource action.
You can use the workflows in the ASD Service Blueprints subdirectory to create and manage Advanced
Services service blueprints.
Table 3‑4. ASD Service Blueprints
WorkflowDescription
Clone a service blueprintCreates a copy of a service blueprint.
Create a service blueprintCreates a service blueprint.
Delete a service blueprintDeletes a service blueprint.
Publish a service blueprintPublishes a service blueprint.
Unpublish a service blueprintUnpublishes 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 3‑5. Business Groups
WorkflowDescription
Add a custom propertyAdds a custom property to a business group.
Create a business groupCreates a business group.
Delete a business groupDeletes a business group.
Delete a custom propertyRemoves a custom property from a business group.
Update a business groupUpdates details for a business group, such as default
machine prefix, active directory containers, and user roles.
Update a custom propertyUpdates a custom property for a business group.
You can use the workflows in the Catalog Items subdirectory to manage catalog items.
Table 3‑6. Catalog Items
WorkflowDescription
Activate a catalog itemActivates 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 serviceAssigns 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 itemDeactivates 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 3‑7. Content
WorkflowDescription
Export contentExport Advanced Services components as a
vCenter Orchestrator resource bundle.
Import content
Transfer contentTransfer Advanced Services components between
Validate contentEnsures 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 3‑8. Entitlements
WorkflowDescription
Activate an entitlementActivates an entitlement.
Assign catalog items to an entitlementAssigns 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 3‑8. Entitlements (Continued)
WorkflowDescription
Assign resource actions to an entitlementAssigns one or more resource actions to an entitlement.
Assign immediate actions to an entitlementAssigns one or more immediate actions to an entitlement.
Assign services to an entitlementAssigns one or more services to an entitlement. You can
Assign users and groups to an entitlementAssigns one or more users or groups to an entitlement.
Create an entitlementCreates an entitlement.
Deactivate an entitlementDeactivates an entitlement.
You can use the workflows in the Services subdirectory to manage services.
Table 3‑9. Services
WorkflowDescription
Activate a serviceActivates a service.
Assign catalog items to a serviceAssigns one or more catalog items to a service.
Copy a serviceCopies a service.
Create a serviceCreates a service.
Deactivate a serviceDeactivates a service.
Delete a serviceDeletes 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 3‑10. Tenants
WorkflowDescription
Add administratorsAdds one or more tenant administrators and infrastructure
administrators to a tenant.
Add an identity store to a tenantAdds 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 hostAdds 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 tenantCreates a tenant. You must select the
vCloud Automation Center host added with the system
administrator credentials.
Delete an identity store from a tenantDeletes 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 hostDeletes 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 tenantDeletes a tenant.
18 VMware, Inc.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows
Table 3‑10. Tenants (Continued)
WorkflowDescription
Remove administratorsRemoves one or more tenant administrators and
infrastructure administrators from a tenant.
Update an identity store for a tenantUpdates 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 hostUpdates 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 tenantUpdates 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 3‑11. Infrastructure Administration
Workflow NameDescription
Await virtual machine state changeAwaits a state change for a set of virtual machines. If all
Create a vCAC model entityCreates and persists an entity for a specified
Delete a vCAC model entityDeletes a specified vCloud Automation Center model
Invoke a post-provisioning actionInvokes 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 filterReads a list of vCloud Automation Center entities by using
Read a vCAC entity by system queryReads a list of vCloud Automation Center entities by using
Read a vCAC model entityReads a vCloud Automation Center model entity by its ID.
Update a vCAC model entityUpdates 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 vCloudAutomation 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 3‑12. Extensibility
Workflow NameDescription
Install vCO customizationInstalls an Orchestrator customization including
customized state change workflow stubs and Orchestrator
menu operation workflows.
Uninstall vCO customizationUninstalls an Orchestrator customization including
customized state change workflow stubs and Orchestrator
menu operation workflows.
Unregister Virtual MachineRemoves a virtual machine from the
Assign a menu operation to a blueprint and its virtual
machines
Assign a menu operation to virtual machinesUpdates a vCloud Automation Center model entity by its
Assign a state change workflow to a blueprint and its
virtual machines
Customize a menu operationUpdates 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
1From the drop-down menu in the Orchestrator client, select Run or Design.
2Click the Workflows view.
3Select Library > vCloud Automation Center > Infrastructure Administration.
4Right-click the Create a vCAC model entity workflow and select Start workflow.
5Select a vCloud Automation Center host.
6Enter the name of the model in the Model name text box.
7Enter 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.
8Click 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
1From the drop-down menu in the Orchestrator client, select Run or Design.
2Click the Workflows view.
3Select Library > vCloud Automation Center > Infrastructure Administration.
4Right-click Read a vCAC model entity and select Start workflow.
5Select a vCloud Automation Center host.
6Enter the name of the model in the Model name text box.
7Enter 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.
8Click 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.
WorkflowDescription
Cancel a work itemCancels an active work item. You can use this workflow only if you are a system
administrator.
Complete a work itemCompletes a work item.
Request a catalog itemRequests a catalog item for the user running the workflow.
Request a catalog item on behalf of
a user
Request a resource actionRequests 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 requestWaits for a catalog item request to complete.
Wait for resource action requestWaits for a resource action request to complete.
Wait for work itemWaits 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 NameDescription
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 tenantCreates 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 itemsReturns 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
1Log in to the Orchestrator client as an administrator.
2Select Tools > API Explorer.
3Double-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 Scripts4
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 vCenterOrchestrator.
Example: Create a vCloud Automation Center Model Entity
This example script performs the following actions:
1Defines the model name and the entity set name.
2Defines the properties of the host prefix.
3Saves the host prefix entity.
4Defines the properties of the provisioning group.
5Defines the provisioning group as a link.
6Saves 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 4‑1. Input Variables
VariableType
hostvCAC: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:
1Gets the host ID from the provided entity.
2Gets the model name from the provided entity.
3Gets the entity set name from the provided entity.
4Gets the entity ID from the provided entity.
5Defines a set of properties that will be updated.
6Starts the action responsible for updating the entity.
26 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 4‑2. Input Variables
VariableType
entityvCAC: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:
1Defines the model name and the entity set name.
2Defines the blueprint ID with a property object.
3Reads the entity.
Table 4‑3. Input Variables
VariableType
hostvCAC: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:
1Gets the host ID from the provided entity.
2Gets the model name from the provided entity.
3Gets the entity set name from the provided entity.
4Gets the entity ID from the provided entity.
VMware, Inc. 27
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
5Starts the action responsible for deleting the entity.
Table 4‑4. Input Variables
VariableType
entityvCAC: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:
1Defines the model name and the entity set name.
2Defines the properties by which the entities are filtered.
3Reads a list of entities.
Table 4‑5. Input Variables
VariableType
hostvCAC: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:
1Defines the model name and the entity set name.
2Defines 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.
3Reads a list of entities.
28 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 4‑6. Input Variables
VariableType
hostvCAC: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 vCenterOrchestrator.
Example: Find Catalog Resources Filtered by Name
Table 4‑7. Input Variables
VariableType
hostvCAC: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
aGets the Consumer Resource service and invokes the get method passing as a Pageable parameter
an instance of the vCACCAFEPageOdataRequest object.
bCreates 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:
1Gets the Consumer Resource service and invokes the get method passing as a Pageable parameter an
instance of the vCACCAFEPageOdataRequest object.
2Creates 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 vCenterOrchestrator.
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 4‑8. Input Variables
VariableType
vcacHostvCACCAFE:VCACHost
iaasHostvCAC: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);
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 vCenterOrchestrator.
Example: Create a vCloud Automation Center Advanced Service Blueprint
This example script performs the following actions:
1Sets the vCenter Orchestrator workflow used to build the service blueprint.
2Generates the content for the service blueprint based on the workflow.
3Creates the service blueprint entity.
4Publishes the service blueprint.
Table 4‑9. Input Variables
VariableType
hostvCACCAFE: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:
1Gets the approval policy type.
2Sets the user and group whose approval is required.
3Sets the approval levels.
32 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
4Defines the pre-provisioning approval phase.
5Defines the post-provisioning approval phase.
6Defines the approval policy specifications such as name, description, and type.
7Creates the approval policy.
8Publishes the approval policy. Once an approval policy is published, it becomes read-only.
Table 4‑10. Input Variables
VariableType
hostvCACCAFE: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);
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 vCenterOrchestrator.
Example: Transfer Content from One vCloud Automation Center Host to
Another vCloud Automation Center Host
This example script performs the following actions:
1Defines the source host that is based on a tenant administrator role.
2Exports the content of the source host.
3Defines the target host that is based on a tenant administrator role.
4Imports the content to the target source.
34 VMware, Inc.
Chapter 4 Example vCloud Automation Center Plug-In Scripts
Table 4‑11. Input Variables
VariableType
sourceHoststring
targetHoststring
var CONTENT_MANAGEMENT_SERVICE = "com.vmware.csp.core.content.service.api";
var content;