Using the vCenter Orchestrator Plug-In for vCloud Automation ...
Using the vCenter Orchestrator Plug-In for vCloud Automation ...
Using the vCenter Orchestrator Plug-In for vCloud Automation ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong><br />
<strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
<strong>vCenter</strong> <strong>Orchestrator</strong> 5.1<br />
This document supports <strong>the</strong> version of each product listed and<br />
supports all subsequent versions until <strong>the</strong> document is replaced<br />
by a new edition. To check <strong>for</strong> more recent editions of this<br />
document, see http://www.vmware.com/support/pubs.<br />
EN-001079-00
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
You can find <strong>the</strong> most up-to-date technical documentation on <strong>the</strong> VMware Web site at:<br />
http://www.vmware.com/support/<br />
The VMware Web site also provides <strong>the</strong> latest product updates.<br />
If you have comments about this documentation, submit your feedback to:<br />
docfeedback@vmware.com<br />
Copyright © 2012 VMware, <strong>In</strong>c. All rights reserved. This product is protected by U.S. and international copyright and intellectual<br />
property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents.<br />
VMware is a registered trademark or trademark of VMware, <strong>In</strong>c. in <strong>the</strong> United States and/or o<strong>the</strong>r jurisdictions. All o<strong>the</strong>r marks<br />
and names mentioned herein may be trademarks of <strong>the</strong>ir respective companies.<br />
VMware, <strong>In</strong>c.<br />
3401 Hillview Ave.<br />
Palo Alto, CA 94304<br />
www.vmware.com<br />
2 VMware, <strong>In</strong>c.
Contents<br />
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1 5<br />
1 <strong>In</strong>troduction to <strong>the</strong> VMware <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong><br />
<strong>vCloud</strong> <strong>Automation</strong> Center 7<br />
Role of <strong>vCenter</strong> <strong>Orchestrator</strong> with <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> 7<br />
<strong>In</strong>stalling <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> 7<br />
<strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> Functional Prerequisites 7<br />
<strong>In</strong>stall <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> 8<br />
2 <strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> 9<br />
Configuring <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> 9<br />
Configuration Workflows 9<br />
<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> Standard Workflows 10<br />
<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> <strong>In</strong>ventory 12<br />
Access <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> API 12<br />
Examples of Scripts <strong>for</strong> CRUD <strong>vCloud</strong> <strong>Automation</strong> Center Tasks 12<br />
<strong>In</strong>dex 17<br />
VMware, <strong>In</strong>c. 3
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
4 VMware, <strong>In</strong>c.
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong><br />
<strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1 provides in<strong>for</strong>mation and instructions<br />
about configuring and using <strong>the</strong> VMware ® <strong>vCenter</strong> <strong>Orchestrator</strong> plug-in <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1.<br />
<strong>In</strong>tended Audience<br />
This book is intended <strong>for</strong> anyone who is installing and configuring <strong>the</strong> plug-in, using <strong>the</strong> API of <strong>the</strong> plug-in,<br />
and using <strong>the</strong> workflow library. The in<strong>for</strong>mation in <strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong><br />
<strong>vCloud</strong> <strong>Automation</strong> Center 5.1 is written <strong>for</strong> experienced users who are familiar with virtual machine technology,<br />
with <strong>Orchestrator</strong> workflow development, and with <strong>vCloud</strong> <strong>Automation</strong> Center.<br />
For more in<strong>for</strong>mation about <strong>Orchestrator</strong>, see<br />
http://www.vmware.com/support/pubs/orchestrator_pubs.html.<br />
For more in<strong>for</strong>mation about <strong>vCloud</strong> <strong>Automation</strong> Center, see<br />
http://www.vmware.com/support/pubs/vcac-pubs.html.<br />
VMware, <strong>In</strong>c. 5
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
6 VMware, <strong>In</strong>c.
<strong>In</strong>troduction to <strong>the</strong> VMware <strong>vCenter</strong><br />
<strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong><br />
<strong>vCloud</strong> <strong>Automation</strong> Center 1<br />
The <strong>vCloud</strong> <strong>Automation</strong> Center plug-in (VMware <strong>vCenter</strong> <strong>Orchestrator</strong> plug-in <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong><br />
Center) allows interaction between <strong>vCenter</strong> <strong>Orchestrator</strong> and <strong>vCloud</strong> <strong>Automation</strong> Center.<br />
You can use <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in to provision virtual machines, take post-provision actions,<br />
and run Create, Read, Update, and Delete (CRUD) operations on <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center model.<br />
This chapter includes <strong>the</strong> following topics:<br />
n “Role of <strong>vCenter</strong> <strong>Orchestrator</strong> with <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong>,” on page 7<br />
n “<strong>In</strong>stalling <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong>,” on page 7<br />
Role of <strong>vCenter</strong> <strong>Orchestrator</strong> with <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<br />
<strong>In</strong><br />
You must use <strong>the</strong> <strong>Orchestrator</strong> configuration interface to install <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in. You<br />
use <strong>the</strong> <strong>Orchestrator</strong> client to run and create workflows and access <strong>the</strong> plug-in API.<br />
The <strong>vCloud</strong> <strong>Automation</strong> Center plug-in is powered by <strong>vCenter</strong> <strong>Orchestrator</strong>. <strong>Orchestrator</strong> is a development<br />
and process-automation plat<strong>for</strong>m that provides a library of extensible workflows to manage <strong>the</strong> VMware<br />
<strong>vCenter</strong> infrastructure and o<strong>the</strong>r technologies.<br />
<strong>Orchestrator</strong> allows integration with management and administration solutions through its open plug-in<br />
architecture.<br />
<strong>In</strong>stalling <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
You must use <strong>the</strong> <strong>Orchestrator</strong> configuration interface to install <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in.<br />
<strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> Functional Prerequisites<br />
To be able to install and use <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in, your system must meet certain functional<br />
prerequisites.<br />
<strong>vCenter</strong> <strong>Orchestrator</strong><br />
Verify that you have a running instance of <strong>Orchestrator</strong>. You can log in to <strong>the</strong> <strong>Orchestrator</strong> configuration<br />
interface at http://orchestrator_server:8283. Version 5.1 of <strong>the</strong> plug-in works with <strong>vCenter</strong> <strong>Orchestrator</strong> 5.1.<br />
For in<strong>for</strong>mation about setting up <strong>Orchestrator</strong>, see <strong>In</strong>stalling and Configuring VMware <strong>vCenter</strong> <strong>Orchestrator</strong>.<br />
VMware, <strong>In</strong>c. 7
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
<strong>vCloud</strong> <strong>Automation</strong> Center<br />
Verify that you have access to a <strong>vCloud</strong> <strong>Automation</strong> Center server. Version 5.1 of <strong>the</strong> plug-in works with<br />
<strong>vCloud</strong> <strong>Automation</strong> Center 4.5 and 5.1.<br />
For in<strong>for</strong>mation about setting up <strong>vCloud</strong> <strong>Automation</strong> Center, see <strong>vCloud</strong> <strong>Automation</strong> Center <strong>In</strong>stallation Guide.<br />
<strong>In</strong>stall <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
To be able to use <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in, you must download <strong>the</strong> .vmoapp file containing <strong>the</strong><br />
plug-in and install it by using <strong>the</strong> <strong>Orchestrator</strong> configuration interface.<br />
Prerequisites<br />
Verify that you are logged in to <strong>the</strong> <strong>Orchestrator</strong> configuration interface at http://orchestrator_server:8283.<br />
Procedure<br />
1 On <strong>the</strong> General tab, click <strong>In</strong>stall Application.<br />
2 Upload <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in.<br />
a Click <strong>the</strong> magnifying glass icon.<br />
b Select <strong>the</strong> .vmoapp file to install.<br />
c Click Open.<br />
d Click <strong>In</strong>stall.<br />
A message appears after successful installation. The <strong>vCloud</strong> <strong>Automation</strong> Center plug-in is installed<br />
without a tab in <strong>the</strong> <strong>Orchestrator</strong> configuration interface.<br />
3 On <strong>the</strong> Startup Options tab, click Restart service to complete <strong>the</strong> plug-in installation.<br />
8 VMware, <strong>In</strong>c.
<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 2<br />
<strong>Plug</strong>-<strong>In</strong><br />
The <strong>vCloud</strong> <strong>Automation</strong> Center plug-in workflow library contains workflows that you can use to provision<br />
virtual machines and take post-provision actions.<br />
You can use <strong>the</strong> scripting API of <strong>the</strong> plug-in to develop custom workflows. You can use custom HTTP headers,<br />
such as <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center specific headers Tasks and Identity, and apply <strong>the</strong>m in <strong>the</strong> CRUD,<br />
provisioning, and post-provisioning workflows.<br />
This chapter includes <strong>the</strong> following topics:<br />
n “Configuring <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong>,” on page 9<br />
n “<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> <strong>In</strong>ventory,” on page 12<br />
n “Access <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> API,” on page 12<br />
n “Examples of Scripts <strong>for</strong> CRUD <strong>vCloud</strong> <strong>Automation</strong> Center Tasks,” on page 12<br />
Configuring <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
You must use <strong>the</strong> <strong>Orchestrator</strong> client to configure <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in.<br />
Configuration Workflows<br />
You can use <strong>the</strong> workflows in <strong>the</strong> Configuration workflow category to manage <strong>vCloud</strong> <strong>Automation</strong> Center<br />
hosts.<br />
You can access <strong>the</strong>se workflows from Library > <strong>vCloud</strong> <strong>Automation</strong> Center > Configuration in <strong>the</strong><br />
Workflows view of <strong>the</strong> <strong>Orchestrator</strong> client.<br />
Workflow Name Description<br />
Add a vCAC host Adds a <strong>vCloud</strong> <strong>Automation</strong> Center host to <strong>the</strong> plug-in's inventory.<br />
Manage SSL certificates Verifies a host URL, and if required, shows a user interaction message <strong>for</strong> SSL certificates user<br />
approval.<br />
Remove a vCAC host Removes a <strong>vCloud</strong> <strong>Automation</strong> Center host from <strong>the</strong> plug-in's inventory.<br />
Update a vCAC host Updates a <strong>vCloud</strong> <strong>Automation</strong> Center host in <strong>the</strong> plug-in's inventory.<br />
Validate a vCAC host Validates <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center host and <strong>the</strong> connection to it.<br />
VMware, <strong>In</strong>c. 9
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
Add a <strong>vCloud</strong> <strong>Automation</strong> Center Host<br />
You can run a workflow to add a <strong>vCloud</strong> <strong>Automation</strong> Center host and configure <strong>the</strong> host connection<br />
parameters.<br />
Prerequisites<br />
Verify that you have <strong>the</strong> permissions to per<strong>for</strong>m this task.<br />
Procedure<br />
1 From <strong>the</strong> drop-down menu in <strong>the</strong> <strong>Orchestrator</strong> client, select Run or Design.<br />
2 Click <strong>the</strong> Workflows view.<br />
3 <strong>In</strong> <strong>the</strong> hierarchical list of workflows, select Library > <strong>vCloud</strong> <strong>Automation</strong> Center > Configuration and<br />
navigate to <strong>the</strong> Add a vCAC host workflow.<br />
4 Right-click <strong>the</strong> Add a vCAC host workflow and select Start workflow.<br />
5 <strong>In</strong> <strong>the</strong> Name text box, type a unique name <strong>for</strong> <strong>the</strong> host.<br />
6 <strong>In</strong> <strong>the</strong> Host text box, type <strong>the</strong> address of <strong>the</strong> host.<br />
7 (Optional) <strong>In</strong> <strong>the</strong> Connection timeout (seconds) and Operation timeout (secounds) text boxes, type <strong>the</strong><br />
timeout interval.<br />
8 Click Next.<br />
9 Select a host au<strong>the</strong>ntication type and click Next.<br />
Option Description<br />
Basic Provides basic access au<strong>the</strong>ntication.<br />
Select <strong>the</strong> session mode.<br />
n If you select Shared Session, provide credentials <strong>for</strong> <strong>the</strong> shared session.<br />
n If you select Per User Session, <strong>the</strong> <strong>Orchestrator</strong> client retrieves<br />
credentials from <strong>the</strong> user who is logged in.<br />
NTLM Provides NT LAN Manager (NTLM) access au<strong>the</strong>ntication within <strong>the</strong><br />
Window Security Support Provider (SSPI) framework.<br />
10 Click Submit to run <strong>the</strong> workflow.<br />
Select <strong>the</strong> session mode.<br />
n If you select Shared Session, provide credentials <strong>for</strong> <strong>the</strong> shared session.<br />
n If you select Per User Session, <strong>the</strong> <strong>Orchestrator</strong> client retrieves<br />
credentials from <strong>the</strong> user who is logged in.<br />
Provide <strong>the</strong> NTLM settings.<br />
11 Repeat steps 4-10 <strong>for</strong> each <strong>vCloud</strong> <strong>Automation</strong> Center host.<br />
<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> Standard Workflows<br />
You can use <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center workflows to provision virtual machines and to run basic or CRUD<br />
operations.<br />
You can access <strong>the</strong>se workflows from Library > <strong>vCloud</strong> <strong>Automation</strong> Center in <strong>the</strong> Workflows view of <strong>the</strong><br />
<strong>Orchestrator</strong> client.<br />
10 VMware, <strong>In</strong>c.
Workflow Name Description<br />
Create a vCAC model entity Creates and persists an entity <strong>for</strong> a specified <strong>vCloud</strong> <strong>Automation</strong> Center<br />
model.<br />
Delete a vCAC model entity Deletes a specified <strong>vCloud</strong> <strong>Automation</strong> Center model entity.<br />
<strong>In</strong>voke a post-provisioning action <strong>In</strong>vokes a specified post-provisioning action on a given virtual machine.<br />
Provision a virtual machine from a<br />
blueprint<br />
Provisions a virtual machine from a <strong>vCloud</strong> <strong>Automation</strong> Center blueprint.<br />
Read a vCAC entity by custom filter Reads a list of <strong>vCloud</strong> <strong>Automation</strong> Center entities by using a custom filter. If<br />
you do not specify a filter, all entities are returned as a result.<br />
Read a vCAC model entity Reads a <strong>vCloud</strong> <strong>Automation</strong> Center model entity by its ID.<br />
Update a vCAC model entity Updates a <strong>vCloud</strong> <strong>Automation</strong> Center model entity by its ID.<br />
Create a <strong>vCloud</strong> <strong>Automation</strong> Center Model Entity<br />
You can run a workflow to create simple and complex <strong>vCloud</strong> <strong>Automation</strong> Center entities, such as a <strong>vCloud</strong><br />
<strong>Automation</strong> Center Blueprint reference to a ProvisioningGroup.<br />
Prerequisites<br />
Verify that you have <strong>the</strong> permissions to per<strong>for</strong>m this task.<br />
Procedure<br />
1 From <strong>the</strong> drop-down menu in <strong>the</strong> <strong>Orchestrator</strong> client, select Run or Design.<br />
2 Click <strong>the</strong> Workflows view.<br />
3 <strong>In</strong> <strong>the</strong> hierarchical list of workflows, select Library > <strong>vCloud</strong> <strong>Automation</strong> Center and navigate to <strong>the</strong><br />
Create a vCAC model entity workflow.<br />
4 Right-click <strong>the</strong> Create a vCAC model entity workflow and select Start workflow.<br />
5 Select a <strong>vCloud</strong> <strong>Automation</strong> Center host.<br />
6 <strong>In</strong> <strong>the</strong> Model name text box, type <strong>the</strong> name of <strong>the</strong> model.<br />
7 <strong>In</strong> <strong>the</strong> Entity set name text box, type <strong>the</strong> name of <strong>the</strong> entity set.<br />
The Simple properties, Links to complex properties, and HTTP headers properties are set by using<br />
scripting or REST API.<br />
8 Click Submit to run <strong>the</strong> workflow.<br />
Read a <strong>vCloud</strong> <strong>Automation</strong> Center Model Entity<br />
You can run a workflow to read <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center model entity.<br />
Prerequisites<br />
Verify that you have <strong>the</strong> permissions to per<strong>for</strong>m this task.<br />
Procedure<br />
1 From <strong>the</strong> drop-down menu in <strong>the</strong> <strong>Orchestrator</strong> client, select Run or Design.<br />
2 Click <strong>the</strong> Workflows view.<br />
3 <strong>In</strong> <strong>the</strong> hierarchical list of workflows, select Library > <strong>vCloud</strong> <strong>Automation</strong> Center and navigate to <strong>the</strong> Read<br />
a vCAC model entity workflow.<br />
4 Right-click <strong>the</strong> Read a vCAC model entity workflow and select Start workflow.<br />
Chapter 2 <strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
VMware, <strong>In</strong>c. 11
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
5 Select a <strong>vCloud</strong> <strong>Automation</strong> Center host.<br />
6 <strong>In</strong> <strong>the</strong> Model name text box, type <strong>the</strong> model name.<br />
7 <strong>In</strong> <strong>the</strong> Entity set name text box, type <strong>the</strong> entity set name.<br />
The HTTP headers property is set by using scripting or REST API.<br />
8 Click Submit to run <strong>the</strong> workflow.<br />
<strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> <strong>In</strong>ventory<br />
You can use <strong>the</strong> <strong>In</strong>ventory view to run workflows on <strong>vCloud</strong> <strong>Automation</strong> Center objects.<br />
You can enable <strong>the</strong> Use contextual menu in inventory option to display <strong>the</strong> workflows that are available <strong>for</strong><br />
an inventory object. After <strong>the</strong> option is enabled, when you right-click an object in <strong>the</strong> <strong>Orchestrator</strong> inventory,<br />
all available workflows <strong>for</strong> <strong>the</strong> object are displayed.<br />
Access <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong> API<br />
<strong>Orchestrator</strong> provides an API Explorer to allow you to search <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center plug-in API and<br />
see <strong>the</strong> documentation <strong>for</strong> JavaScript objects that you can use in scripted elements.<br />
Procedure<br />
1 Log in to <strong>the</strong> <strong>Orchestrator</strong> client as an administrator.<br />
2 Select Tools > API Explorer.<br />
3 To expand <strong>the</strong> hierarchical list of <strong>vCloud</strong> <strong>Automation</strong> Center plug-in API objects, double-click <strong>the</strong><br />
vCAC module in <strong>the</strong> left pane.<br />
What to do next<br />
You can copy code from API elements and paste it into scripting boxes. For more in<strong>for</strong>mation about API<br />
scripting, see Developing with VMware <strong>vCenter</strong> <strong>Orchestrator</strong>.<br />
Examples of Scripts <strong>for</strong> CRUD <strong>vCloud</strong> <strong>Automation</strong> Center Tasks<br />
You can cut, paste, and edit <strong>the</strong> JavaScript examples to write scripts <strong>for</strong> CRUD <strong>vCloud</strong> <strong>Automation</strong> Center<br />
tasks.<br />
For more in<strong>for</strong>mation about scripting, see Developing with VMware <strong>vCenter</strong> <strong>Orchestrator</strong>.<br />
Example: Create a <strong>vCloud</strong> <strong>Automation</strong> Center model entity<br />
This example script per<strong>for</strong>ms <strong>the</strong> following actions.<br />
1 Defines <strong>the</strong> model name and <strong>the</strong> entity set name.<br />
2 Defines <strong>the</strong> properties of <strong>the</strong> host prefix.<br />
3 Saves <strong>the</strong> host prefix entity.<br />
4 Defines <strong>the</strong> properties of <strong>the</strong> provisioning group.<br />
5 Defines <strong>the</strong> provisioning group as a link.<br />
6 Saves <strong>the</strong> provisioning group entity, by linking it with <strong>the</strong> host name prefix.<br />
12 VMware, <strong>In</strong>c.
Table 2-1. <strong>In</strong>put Variables<br />
Variable Type<br />
host vCAC:VcacHost<br />
var modelName = 'ManagementModelEntities.svc';<br />
var entitySetName = 'HostNamePrefixes';<br />
var links = null;<br />
var headers = null;<br />
//Create properties <strong>for</strong> prefix entity<br />
var prefix<strong>In</strong>putProperties = {<br />
};<br />
MachinePrefix:'test-prefix',<br />
NextMachineNo:1,<br />
MachineNumberLength:3<br />
//Save <strong>the</strong> prefix<br />
var prefixEntity = vCACEntityManager<br />
.createModelEntity(host.id, modelName, entitySetName, prefix<strong>In</strong>putProperties, links, headers);<br />
entitySetName = 'ProvisioningGroups';<br />
//Create properties <strong>for</strong> <strong>the</strong> provisioning group entity<br />
inputProperties = {<br />
GroupName:'TestGroupName',<br />
GroupDescription:'This group was generated with a vCO workflow',<br />
AdministratorEmail:'test@test.com',<br />
AdContainer:'AD',<br />
IsTestGroup:false,<br />
Flags:2,<br />
GroupType:1};<br />
//Add a reference to <strong>the</strong> newly created prefix entity<br />
links = {<br />
HostNamePrefix:prefixEntity<br />
};<br />
//Save <strong>the</strong> provisioning group<br />
var entity = vCACEntityManager<br />
createModelEntity(host.id, modelName, entitySetName, inputProperties, links, headers);<br />
Example: Update a <strong>vCloud</strong> <strong>Automation</strong> Center model entity<br />
This example script per<strong>for</strong>ms <strong>the</strong> following actions.<br />
1 Gets <strong>the</strong> host id from <strong>the</strong> provided entity.<br />
2 Gets <strong>the</strong> model name from <strong>the</strong> provided entity.<br />
3 Gets <strong>the</strong> entity set name from <strong>the</strong> provided entity.<br />
4 Gets <strong>the</strong> entity id from <strong>the</strong> provided entity.<br />
5 Defines a set of properties that will be updated.<br />
6 <strong>In</strong>vokes <strong>the</strong> action responsible <strong>for</strong> updating <strong>the</strong> entity.<br />
Chapter 2 <strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
VMware, <strong>In</strong>c. 13
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
Table 2-2. <strong>In</strong>put Variables<br />
Variable Type<br />
entity vCAC:Entity<br />
updatedDescription String<br />
var hostId = entity.hostId;<br />
var modelName = entity.modelName;<br />
var entitySetName = entity.entitySetName;<br />
var entityIdString = entity.keyString;<br />
var links = null;<br />
var headers = null;<br />
var updateProperties = new Properties();<br />
updateProperties.put("UserNameDescription", updatedDescription);<br />
//Update <strong>the</strong> user description<br />
System.getModule("com.vmware.library.vcac")<br />
.updateVCACEntity(hostId, modelName, entitySetName, entityIdString, updateProperties, links,<br />
headers);<br />
Example: Read a <strong>vCloud</strong> <strong>Automation</strong> Center model entity<br />
This example script per<strong>for</strong>ms <strong>the</strong> following actions.<br />
1 Defines <strong>the</strong> model name and <strong>the</strong> entity set name.<br />
2 Defines <strong>the</strong> blueprint ID with a property object.<br />
3 Reads <strong>the</strong> entity.<br />
Table 2-3. <strong>In</strong>put Variables<br />
Variable Type<br />
host vCAC:VcacHost<br />
blueprintID String<br />
var modelName = 'ManagementModelEntities.svc';<br />
var entitySetName = 'VirtualMachineTemplates';<br />
var links = null;<br />
var headers = null;<br />
//Create properties <strong>for</strong> <strong>the</strong> prefix entity<br />
var blueprintId = {<br />
};<br />
VirtualMachineTemplateID:blueprintId,<br />
//Read <strong>the</strong> blueprint<br />
var entity = vCACEntityManager<br />
.readModelEntity(host.id, modelName, entitySetName, blueprintId, headers);<br />
Example: Delete a <strong>vCloud</strong> <strong>Automation</strong> Center model entity<br />
This example script per<strong>for</strong>ms <strong>the</strong> following actions.<br />
1 Gets <strong>the</strong> host ID from <strong>the</strong> provided entity.<br />
2 Gets <strong>the</strong> model name from <strong>the</strong> provided entity.<br />
3 Gets <strong>the</strong> entity set name from <strong>the</strong> provided entity.<br />
4 Gets <strong>the</strong> entity id from <strong>the</strong> provided entity.<br />
14 VMware, <strong>In</strong>c.
5 <strong>In</strong>vokes <strong>the</strong> action responsible <strong>for</strong> deleting <strong>the</strong> entity.<br />
Table 2-4. <strong>In</strong>put Variables<br />
Variable Type<br />
entity vCAC:Entity<br />
var hostId = entity.hostId;<br />
var modelName = entity.modelName;<br />
var entitySetName = entity.entitySetName;<br />
var entityKeyString = entity.keyString;<br />
var headers = null;<br />
//Delete <strong>the</strong> entity<br />
System.getModule("com.vmware.library.vcac")<br />
.deleteVCACEntity(hostId, modelName, entitySetName, entityKeyString, headers);<br />
Example: Read a <strong>vCloud</strong> <strong>Automation</strong> Center entity by custom filter<br />
This example script per<strong>for</strong>ms <strong>the</strong> following actions.<br />
1 Defines <strong>the</strong> model name and <strong>the</strong> entity set name.<br />
2 Defines <strong>the</strong> properties by which <strong>the</strong> entities are filtered.<br />
3 Reads a list of entities.<br />
Table 2-5. <strong>In</strong>put Variables<br />
Variable Type<br />
host vCAC:VcacHost<br />
templateName String<br />
var modelName = 'ManagementModelEntities.svc';<br />
var entitySetName = 'VirtualMachineTemplates';<br />
var headers = null;<br />
//Create properties <strong>for</strong> prefix entity<br />
var properties = {<br />
};<br />
VirtualMachineTemplateName:templateName,<br />
//Read a list of entities<br />
var entities = vCACEntityManager<br />
Chapter 2 <strong>Using</strong> <strong>the</strong> <strong>vCloud</strong> <strong>Automation</strong> Center <strong>Plug</strong>-<strong>In</strong><br />
.readModelEntitiesByCustomFilter(host.id, modelName, entitySetName, properties, headers);<br />
VMware, <strong>In</strong>c. 15
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
16 VMware, <strong>In</strong>c.
<strong>In</strong>dex<br />
A<br />
adding a <strong>vCloud</strong> <strong>Automation</strong> Center host 10<br />
adding a <strong>vCloud</strong> <strong>Automation</strong> Center model<br />
entity 11<br />
API access 12<br />
audience 5<br />
C<br />
configuration 9<br />
F<br />
functional prerequisites 7<br />
H<br />
host<br />
configure 9<br />
manage 9<br />
I<br />
installation 7<br />
installation process 8<br />
introduction, <strong>vCloud</strong> <strong>Automation</strong> Center plugin<br />
7<br />
<strong>In</strong>ventory 12<br />
O<br />
<strong>Orchestrator</strong> 7<br />
R<br />
reading a <strong>vCloud</strong> <strong>Automation</strong> Center model<br />
entity 11<br />
registering a <strong>vCloud</strong> <strong>Automation</strong> Center host 10<br />
S<br />
scriptable task elements 12<br />
scripting 12<br />
V<br />
<strong>vCloud</strong> <strong>Automation</strong> Center host<br />
adding 10<br />
registering 10<br />
<strong>vCloud</strong> <strong>Automation</strong> Center model entity<br />
adding 11<br />
reading 11<br />
W<br />
workflow library 9<br />
workflows<br />
configuration 9<br />
CRUD 10<br />
model entity 10<br />
standard workflows 10<br />
VMware, <strong>In</strong>c. 17
<strong>Using</strong> <strong>the</strong> <strong>vCenter</strong> <strong>Orchestrator</strong> <strong>Plug</strong>-<strong>In</strong> <strong>for</strong> <strong>vCloud</strong> <strong>Automation</strong> Center 5.1<br />
18 VMware, <strong>In</strong>c.