Automating vcloud Director with OnCommand Workflow Automation Pirate Pack for vcloud v1.0 Jeremy Goodrum, NetApp February 2013 Abstract The purpose of this document is to guide administrators through the process of setting up VMware s vcloud Director 5.1 data source for OnCommand Workflow Automation 2.0. This document is neither a guide to using vcloud Director nor to building automation with Workflow Automation.
TABLE OF CONTENTS 1 Pirate Pack for VMware vcloud Director v1.0... 3 1.1 Pre-requisites for this solution... 3 1.2 Workflow Automation components included in the Pirate Pack for vcloud v1.0... 3 2 Installation and configuration of VMware PowerCLI 5.1... 5 2.1 Installation of PowerCLI 5.1... 5 2.2 Configuration of PowerCLI 5.1... 7 2.3 Known Issue PowerCLI 5.1 build 1012425... 10 3 Loading the Pirate Pack into OnCommand Workflow Automation... 11 Version History... 12 LIST OF FIGURES Figure 2-1) Error: PowerCLI cannot execute scripts... 7 Figure 2-2-1) Connect to vcloud via PowerCLI... 8 Figure 2-3-2) Enter vcloud admin credentials into PowerCLI... 9 Figure 2-4-3) Accept SSL certificate for vcloud Director... 10 2 Pirate Pack for vcloud v1.0
1 Pirate Pack for VMware vcloud Director v1.0 The Pirate Pack for vcloud Director v1.0 has been released as a free, community supported package of workflows. This package was built to support OnCommand Workflow Automation (WFA) 2.0. The workflows and Data Source have been tested against VMware s vcloud Director 5.1 and OnCommand Workflow Automation 2.0 Note This solution set is not officially supported by NetApp technical support. For help or issues, please use the NetApp OnCommand Workflow Automation community site 1.1 Pre-requisites for this solution The installation of this solution set requires that certain products and applications have previously been installed. Please ensure that the following solutions have been deployed and configured: 1) OnCommand Workflow Automation 2.0 2) OnCommand Workflow Automation Unified Manager data source 3) OnCommand Workflow Automation vcenter Server data source 4) VMware vcloud Director 5.1 5) VMware vsphere vcenter Server 5.1 6) An account with System level permissions in vcloud Director. Typically this will be administrator@system but could be a delegated account. The account should have full system permissions to ensure access to all providers and organizations. 7) VMware PowerCLI 5.1 (The configuration of PowerCLI is covered in Section #2) 1.2 Workflow Automation components included in the Pirate Pack for vcloud v1.0 Workflows: Add a vapp from Catalog to existing vapp Clone a new vcloud vapp based on a Catalog Item Clone a new vcloud vapp based on existing vapp Move Entire vapp to a new Storage Profile Move vapp Virtual Machine to a new Storage Profile Power Management - vapp Finders Find all Virtual Machines in a specific vapp 3 Pirate Pack for vcloud v1.0
Filters vcloud organization by name virtual machines in a specific vapp virtual machine by name in vapp vcloud vapp by name find vcloud storage profile by name in vcloud vcloud vdc by name Commands Add a VM to a vcloud vapp Create a vapp based on vapp Template Create a vapp based on vapp Change vapp Virtual Machine Storage Profile No-Op vcloud Power Off vapp Power On vapp Restart vapp Data Source vcloud Director v1.6 Database Schema Name vcloud Dictionary Entries vcloud_admin_user vcloud_catalog vcloud_catalogitem vcloud_organization vcloud_organization_user vcloud_vm vcloud_vm_net vcloud_vapp vcloud_vapptemplate vcloud_vdc vcloud_vdc_edge vcloud_vdc_net vcloud_vdc_profile 4 Pirate Pack for vcloud v1.0
2 Installation and configuration of VMware PowerCLI 5.1 Many of the commands used in this solution pack are based on the PowerShell commands available in VMware s PowerCLI toolkit. The installation of this package should be done on the OnCommand Workflow Automation server. By the end of this section, you should have VMware s PowerCLI5.1 toolkit installed. Note Find out more about VMware s PowerCLI Toolkit and download your copy: http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli 2.1 Installation of PowerCLI 5.1 Start by double clicking on the installer. Notice that there will likely be a warning about execution of unsigned or remote signed scripts. This will be changed in the next set of steps. 5 Pirate Pack for vcloud v1.0
When selecting components for installation, be sure to install the vcloud Director PowerCLI modules. Finish the installation and go to the desktop of the WFA Server 6 Pirate Pack for vcloud v1.0
2.2 Configuration of PowerCLI 5.1 Open the VMware vsphere PowerCLI shortcut on the WFA Server desktop. When starting the PowerCLI for the first time, the process will likely error out due to issues with the Execution Policy. Steps to resolve restricted execution policy: 1) Verify the ExecutionPolicy value by running command Get-ExecutionPolicy 2) By default, the ExecutionPolicy value is Restricted 3) Change the default value to RemoteSigned ; Set-ExecutionPolicy ExecutionPolicy RemoteSigned 4) Confirm the warning and close the window Figure 2-1) Error: PowerCLI cannot execute scripts 7 Pirate Pack for vcloud v1.0
Steps to resolve SSL certificate warnings 1) Open VMware vsphere PowerCLI shortcut on the WFA Server desktop 2) Connect to the vcloud Server- connect-ciserver Server <vcloud server> - Credential (Get-Credential) 3) Enter the credentials that WFA will use. Do not use the @system label 4) Accept the certificate for all users Screenshot of steps Figure 2-2-1) Connect to vcloud via PowerCLI 8 Pirate Pack for vcloud v1.0
Figure 2-3-2) Enter vcloud admin credentials into PowerCLI 9 Pirate Pack for vcloud v1.0
Figure 2-4-3) Accept SSL certificate for vcloud Director 2.3 Known Issue PowerCLI 5.1 build 1012425 Pirate Pack for vcloud Director workflows fail with an error: The term 'Get-PowerCLIVersion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. How to correct the issue 1) Navigate to the following directory path on the WFA server "C:\Program Files (x86)\vmware\infrastructure\vsphere PowerCLI\Scripts\" 2) Edit the file named - Initialize-PowerCLIEnvironment.ps1 3) Remove line # 9 - "$version = Get-PowerCLIVersion". This command will never run and fails WFA every time. 4) Save the file as a new name in the same path (the original is going to be read-only) 5) Replace the original file with the new file. 10 Pirate Pack for vcloud v1.0
3 Loading the Pirate Pack into OnCommand Workflow Automation Once the PowerCLI configuration is complete and all of the pre-requisites have been satisfied, the next step will be to import the Pirate Pack for vcloud Director into OnCommand Workflow Automation. 1) Using a web browser, open the Workflow Automation portal 2) Select Tools > Import 3) Navigate to the DAR file in the directory in which the Pirate Pack was exported 4) Import all objects After importing, a new data source is required 5) Once the objects have been imported, select the Execution tab 6) Choose Data Sources and right click in the middle of the first row. 7) Select New and fill out the new data source wizard 8) Pick the data source type of vcloud Director v1.6 9) Enter the username of vcloud account that WFA will use. The user account should be system level and requires the @system definition 10) After setting the frequency of data collection, hit Save The cache will need to be reset the first time. 11) Right Click the newly created data source and choose edit 12) Select vcloud at the bottom and click the Reset Scheme button 13) Hit Yes to close and then click Save 14) Right click on the data source and acquire now Setup the vcloud credentials 15) Select the Credentials section 16) Right click and select New 17) Choose type OTHER and enter the IP or Hostname 18) The username for execution should not include the @system identifier 11 Pirate Pack for vcloud v1.0
Version History Version Date Document Version History Version 1.0 February 2013 Initial write-up NetApp provides no representations or warranties regarding the accuracy, reliability, or serviceability of any information or recommendations provided in this publication, or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS, and the use of this information or the implementation of any recommendations or techniques herein is a customer s responsibility and depends on the customer s ability to evaluate and integrate them into the customer s operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document. 2013 NetApp, Inc. All rights reserved. No portions of this document may be reproduced without prior written consent of NetApp, Inc. Specifications are subject to change without notice. NetApp, the NetApp logo, Go further, faster, xxx, and xxx are trademarks or registered trademarks of NetApp, Inc. in the United States and/or other countries. <<Insert third-party trademark notices here.>> All 12 Pirate Pack for vcloud other brands v1.0 or products are trademarks or registered trademarks of their respective holders and should be treated as such.