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.
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.
Contents Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.
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.
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.
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.
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.
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.
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.
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.
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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 Table 3‑1. Approval Policies Workflow Description Activate an approval policy Activates an approval policy. After you activate an approval policy, it becomes read-only. Add an approval level Adds an always required approval level to an approval. You must select specific users and groups for the approvers. Copy an approval policy Copies an approval policy.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows Table 3‑5. 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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 Table 3‑8. Entitlements (Continued) Workflow Description Assign resource actions to an entitlement Assigns one or more resource actions to an entitlement. You can also use this workflow to assign an approval policy. Assign immediate actions to an entitlement Assigns one or more immediate actions to an entitlement. The immediate actions do not create requests.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows Table 3‑10. 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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 Table 3‑11. Infrastructure Administration Workflow Name Description Await virtual machine state change Awaits a state change for a set of virtual machines. If all 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.
Chapter 3 Using the vCloud Automation Center Plug-In Workflows Table 3‑12. 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.
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.
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.
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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 Table 4‑1. 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.
Chapter 4 Example vCloud Automation Center Plug-In Scripts Table 4‑2. Input Variables Variable Type entity vCAC:Entity updatedDescription String var var var var var hostId = entity.hostId; modelName = entity.modelName; entitySetName = entity.entitySetName; entityIdString = entity.keyString; links = null; var headers = null; var updateProperties = new Properties(); updateProperties.put("UserNameDescription", updatedDescription); //Update the user description System.getModule("com.vmware.library.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 5 Starts the action responsible for deleting the entity. Table 4‑4. Input Variables Variable Type entity vCAC:Entity var var var var hostId = entity.hostId; modelName = entity.modelName; entitySetName = entity.entitySetName; entityKeyString = entity.keyString; var headers = null; //Delete the entity System.getModule("com.vmware.library.vcac") .
Chapter 4 Example vCloud Automation Center Plug-In Scripts Table 4‑6. Input Variables Variable Type host vCAC:VcacHost var var var var var var modelName = 'ManagementModelEntities.svc'; entitySetName = 'VirtualMachines'; filter = "VirtualMachineState eq 'Off' and IsComponent eq true"; orderBy = 'VirtualMachineName asc'; top = 10; { skip = 0;, var headers = null; var select = null; var entities = vCACEntityManager readModelEntitiesBySystemQuery(host.
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.
Chapter 4 Example vCloud Automation Center Plug-In Scripts n providerRef - identifies the catalog provider which corresponds directly to a service registered in thevCloud Automation Center component registry For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter Orchestrator.
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.
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 4‑10. Input Variables Variable Type host vCACCAFE:VCACHost // Get the type of approval policy by ID var typeService = host.
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.
Chapter 4 Example vCloud Automation Center Plug-In Scripts Table 4‑11. 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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 36 VMware, Inc.
Index A V adding a vCloud Automation Center model entity 21 API access 23 audience 5 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 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 W workflow library 15, 25
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2 38 VMware, Inc.