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.
2 Pirate Pack for vCloud – v1.0
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
3 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
4 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
5 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.
6 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
7 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
8 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
10 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.
11 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
12 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 other brands or products are trademarks or registered trademarks of their respective holders and should be treated as such.
Top Related