You are previewing VMware vRealize Orchestrator Cookbook.
O'Reilly logo
VMware vRealize Orchestrator Cookbook

Book Description

Master the configuration, programming, and interaction of plugins with Orchestrator to efficiently automate your VMware infrastructure

In Detail

Through this practical guide, you will gain an understanding of VMware vRealize Orchestrator and its role in the vSphere architecture and automation. You will learn about Orchestrator clusters as well as vRealize Automation integration. A full introduction to using the visual programming tools without needing any additional infrastructure is aimed at beginners with limited resources. This is followed by an extensive look at how to integrate the base plugins into your workflows, such as e-mail, AMQP, SNMP, and so on. We will also look at how to use the Orchestrator API to trigger workflows from other programs.

Through this book you will be able to get the most out of your Orchestrator installation, and develop complex workflows and create your own highly integrated automations of vCenter, vCloud, and vRealize environments.

What You Will Learn

  • Install, configure, and optimize Orchestrator installations (Windows, Appliance as well as vRA integrated)

  • Explore all the visual programming elements without the need for additional infrastructure

  • Work with plugins such as SSH, mail, SQL, PowerShell, AD, SOAP, SNMP, AMQP, and REST

  • Discover how to create VMware automation

  • Get to grips with user management, synchronization, and packaging applications

  • Understand policies and resources

  • Work more efficiently with distributed Orchestrator environments

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. VMware vRealize Orchestrator Cookbook
      1. Table of Contents
      2. VMware vRealize Orchestrator Cookbook
      3. Credits
      4. Foreword
      5. About the Author
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
          3. Instant updates on new Packt books
      8. Preface
        1. Best approaches to reading this book
        2. What this book covers
        3. What you need for this book
        4. Who this book is for
          1. Example workflows
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. Installing and Configuring Orchestrator
        1. Introduction
          1. Orchestrator and vRealize Automation (vRA)
          2. Appliance or Windows install?
          3. Orchestrator and vCenter/vRA on the same server?
        2. Getting Orchestrator running in 5 minutes (or less)
          1. Getting ready
          2. How to do it...
            1. vCenter-integrated Orchestrator
            2. vRealize Automation-integrated Orchestrator
          3. How it works...
          4. There's more...
          5. See also
        3. Deploying the Orchestrator appliance
          1. Getting ready
          2. How to do it...
            1. Download
            2. Deploy
            3. Let's go…
          3. How it works...
          4. There's more...
          5. See also
        4. Installing Orchestrator on Windows
          1. Getting ready
          2. How to do it...
            1. Install
            2. Starting and configuring the Orchestrator service
            3. Accessing the vCenter Orchestrator home page
          3. How it works...
        5. Two ways to configure Orchestrator
          1. Getting ready
          2. How to do it...
            1. Using the Orchestrator Configuration tool
              1. Windows or vCenter-integrated Orchestrator
              2. vRA-integrated Orchestrator
              3. Accessing the Orchestrator Configuration tool
            2. Using the workflow method
            3. Base-configuring Orchestrator
          3. How it works...
            1. The future of the Configuration tool
            2. Working with errors in the workflow method
          4. There's more...
        6. Important Orchestrator base configurations
          1. Getting ready
          2. How to do it...
            1. Configuring the network
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
            2. Importing SSL certificates
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
            3. Licensing
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
            4. Creating a Server Package Signing certificate
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
          3. How it works...
          4. See also
        7. Configuring Orchestrator with an external LDAP or Active Directory
          1. Getting ready
          2. How to do it...
            1. Creating an Orchestrator Admin group and user
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
          3. How it works...
          4. There's more...
            1. Test login
            2. Common LDAP errors
          5. See also
        8. Integrating Orchestrator into SSO and vSphere Web Client
          1. Getting ready
          2. How to do it...
            1. Registering Orchestrator with SSO
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
            2. Configuring the vCenter Server plugin
              1. Using the Orchestrator Configuration tool
              2. Using the workflow
            3. Configuring the connection between vCenter Server and Orchestrator
          3. How it works...
          4. See also
        9. Configuring an external database
          1. Getting ready
          2. How to do it...
            1. Database information
            2. Using the Orchestrator Configuration tool
            3. Using the workflow
          3. How it works...
            1. Sizing
            2. Database roles
          4. There's more...
            1. Microsoft SQL
            2. Oracle
      10. 2. Optimizing Orchestrator Configuration
        1. Introduction
          1. Service accounts
          2. Ports and firewalls
        2. Plugin basics
          1. Getting ready
          2. How to do it...
            1. Obtaining plugins
            2. General plugin authentication
            3. Installing plugins
            4. Configuring plugins
          3. How it works...
          4. There's more...
            1. Shared session versus session per user
            2. Resetting the plugins
          5. See also
        3. Tuning the appliance
          1. Getting ready
          2. How to do it...
            1. Open the Orchestrator appliance admin area
            2. Change the IP and hostname
            3. Setting the time (NTP)
            4. Turning SSH access to Orchestrator on and off
            5. Using SSH to connect to the Orchestrator appliance operation system
            6. Switching off unneeded services
            7. Root account expires
          3. How it works...
          4. There's more...
            1. Accessing the local LDAP
            2. Accessing the local database
          5. See also
        4. Tuning Java
          1. Getting ready
          2. How to do it...
            1. Windows
            2. Linux
          3. How it works...
        5. Backup and recovery
          1. Getting ready
          2. How to do it...
            1. Backup
            2. Restore
          3. How it works...
            1. Database
          4. See also
        6. Creating an Orchestrator cluster
          1. Getting ready
          2. How to do it...
            1. Configuring the database
              1. SQL Server
              2. Oracle server
            2. Configuring the first Orchestrator server
            3. Configuring the second Orchestrator server
            4. Starting the cluster
          3. How it works...
            1. Making changes to the cluster
          4. There's more...
          5. See also
        7. Configuring the Orchestrator Service SSL certificate
          1. Getting ready
          2. How to do it...
            1. Back up and remove the default certificates
            2. Create a self-signed certificate
            3. Using a CA-signed certificate
          3. How it works...
            1. Default, self-signed, or CA-signed?
            2. What is this "Dunes" business in Orchestrator?
          4. See also
        8. Configuring e-mail
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Redirecting Orchestrator Syslog to an external Syslog server
          1. Getting ready
          2. How to do it...
            1. Install VMware vSphere Syslog Collector
            2. Working with VMware vSphere Syslog Collector
            3. Redirecting Orchestrator for Syslog
          3. How it works...
            1. Log roll
          4. There's more...
          5. See also
        10. Configuring the Kerberos authentication
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        11. Configuring access to the local filesystem
          1. Getting ready
          2. How to do it...
            1. Fast and easy
            2. Configuring access
          3. How it works...
          4. There's more…
            1. Orchestrator appliance (Linux)
            2. Windows
          5. See also
        12. Updating Orchestrator
          1. Getting ready
          2. How to do it...
            1. Windows update
            2. Appliance update
          3. How it works...
      11. 3. Visual Programming
        1. Introduction
          1. How this chapter works
            1. The example package
          2. JavaScript (the very basics)
          3. Working with the Orchestrator Client
            1. The icons for this chapter
            2. Working with the schema
            3. Gotcha
          4. Working with variables
            1. Variables in the general section
            2. Variables in the input section
            3. Variables in the output section
            4. Variable types
            5. Building arrays
        2. Workflow basics
          1. Getting ready
          2. How to do it...
            1. Creating a new workflow
            2. Adding an attribute
            3. Adding an input parameter
            4. Add an output parameter
            5. Adding a scripting element
          3. How it works...
            1. Exiting a workflow
            2. Validation
            3. Assigning a workflow variable
            4. Re-run a workflow
          4. See also
        3. Version control
          1. Getting ready
          2. How to do it...
            1. Showing differences between versions
            2. Reverting to an older version
          3. How it works...
          4. See also
        4. Working with logs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Error handling in workflows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Ignore errors
            2. New in vRO 6.0 – default error handler
          5. See also
        6. Resuming failed workflows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Using the workflow debugging function
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Working with decisions
          1. Getting ready
          2. How to do it...
            1. Basic decision
            2. Custom decisions
            3. Decision activity
          3. How it works...
            1. JavaScript – if and else
          4. There's more...
            1. Switch case in the schema
            2. New in vRO 6.0 – Switch element
            3. JavaScript – switch
          5. See also
        9. Working with loops
          1. Getting ready
          2. How to do it...
            1. The decision loop
            2. The For each loop
          3. How it works...
            1. Types of decision loops
            2. Foreach and arrays
            3. JavaScript
          4. There's more...
          5. See also
        10. Working with presentations
          1. Getting ready
          2. How to do it...
            1. Preparation
            2. Description
            3. In-parameter properties
            4. Steps and groups
            5. Hide input values
            6. Basic linking
          3. How it works...
            1. Plugin-specific properties
              1. select value as
              2. Show in inventory
              3. Specify a root object to be shown in the chooser
              4. Authorized only
          4. There's more...
          5. See also
        11. Working with configurations
          1. Getting ready
          2. How to do it...
            1. Creating a configuration
            2. Using a configuration in a workflow
          3. How it works...
          4. There's more...
          5. See also
        12. Working with actions
          1. Getting ready
          2. How to do it...
            1. Creating a new action
            2. Implementing an action into a workflow
          3. How it works...
          4. See also
        13. Linking actions in presentations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        14. Waiting tasks
          1. Getting ready
          2. How to do it...
            1. Creating help task
            2. Using the Sleep task
            3. Waiting for a date
          3. How it works...
          4. There's more...
            1. JavaScript – wait
            2. JavaScript – working with dates
          5. See also
        15. Sending and waiting for custom events
          1. Getting ready
          2. How to do it...
            1. Receiving a custom event
            2. Sending a custom event
            3. Trying it out
          3. How it works...
          4. There's more...
          5. See also
        16. Using asynchronous workflows
          1. Getting ready
          2. How to do it...
            1. The first example
            2. The second example
          3. How it works...
          4. There's more...
          5. See also
        17. Working with user interactions
          1. Getting ready
          2. How to do it...
            1. Creating the workflow
            2. Answering the user interaction
          3. How it works...
          4. There's more...
            1. Answering using vRealize Automation
          5. See also
        18. Changing credentials
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      12. 4. Working with Plugins
        1. Introduction
          1. How this chapter works
          2. Advanced JavaScript
            1. The try, catch, and finally functions
            2. The function command
            3. Variable type – Properties
        2. Working with the API
          1. Getting ready
          2. How to do it...
            1. Searching for items in the API
            2. Programming help from the API
          3. How it works...
          4. See also
        3. Working with mails
          1. Getting ready
          2. How to do it...
            1. Configuring the mail connection
            2. Sending e-mails
            3. Receiving e-mails
          3. How it works...
            1. Working with attachments
          4. There's more...
          5. See also
        4. File operations
          1. Getting ready
          2. How to do it...
            1. Writing a file
            2. Reading a file
            3. Getting information on files
            4. Creating, renaming, and deleting a file or directory
          3. How it works...
            1. Executing scripts
          4. There's more...
          5. See also
        5. Working with SSH
          1. Getting ready
          2. How to do it...
            1. Using SSH
            2. Using SSL key authentication
            3. Using SCP
          3. How it works...
            1. Key pairing
          4. See also
        6. Working with XML
          1. Getting ready
          2. How to do it...
            1. Creating an XML document
            2. Parsing XML structures
          3. How it works...
          4. There's more...
          5. See also
        7. Working with SQL
          1. Getting ready
          2. How to do it...
            1. Creating a JDBC connection URL
            2. Connecting to and disconnecting from a database using JDBC
            3. Executing a SQL statement using JDBC
            4. SQL queries using JDBC
          3. How it works...
            1. The difference between the prepare and create statements
          4. There's more...
            1. The SQL object
            2. Creating a new database in the appliance's PostgreSQL
          5. See also
        8. Working with PowerShell
          1. Getting ready
          2. How to do it...
            1. Preparing the Windows host with WinRM
            2. Adding a PowerShell host
            3. Using Kerberos authentication
            4. Executing a script
              1. Calling a script that is stored on the PowerShell host
              2. Sending a script to be executed to the PowerShell host
            5. Generating an action and workflow from a script
          3. How it works...
            1. Workflow TLC
            2. Basic versus Kerberos authentication
            3. PowerShell output to XML
          4. See also
        9. Working with SOAP
          1. Getting ready
          2. How to do it...
            1. Adding a new SOAP client
            2. Generating a new SOAP workflow
          3. How it works...
          4. See also
        10. Working with REST
          1. Getting ready
          2. How to do it...
            1. Connecting to a REST host
            2. Using GET
            3. Using POST
            4. Creating a workflow from a REST operation
          3. How it works...
            1. Authentications
            2. Working with the results of a REST request
          4. There's more…
          5. See also
        11. Working with Active Directory
          1. Getting ready
          2. How to do it...
            1. Preparing AD for SSL
            2. Registering AD with Orchestrator
            3. Working with AD
          3. How it works...
          4. See also
        12. Working with SNMP
          1. Getting ready
          2. How to do it...
            1. Configuring SNMP devices
            2. Sending a GET query to an ESXi host
            3. Configuring a vCenter alarm to send an SNMP message
            4. Receiving an SNMP message from vCenter
            5. Using policies to trap SNMP messages
          3. How it works...
            1. OID and MIB
            2. Working with SNMP return data
            3. SNMP – port 162 versus port 4000
          4. There's more...
            1. Configuring SNMP for vCenter
            2. Configuring ESXi servers for SNMP
          5. See also
        13. Working with AMQP
          1. Getting ready
          2. How to do it...
            1. Adding an AMQP host
            2. Defining exchanges, queues, and binds
            3. Sending messages
            4. Receiving messages
            5. Subscribing to a queue
            6. Using a policy as trigger
          3. How it works...
          4. There's more...
            1. Installing RabbitMQ
          5. See also
      13. 5. Basic Orchestrator Operations
        1. Introduction
          1. The Orchestrator icons
          2. More about workflows
            1. The workflow ID
            2. Server restart behavior
            3. The workflow icon
            4. User permissions
        2. Basic Orchestrator operations for Orchestrator elements
          1. Getting ready
          2. How to do it...
            1. Duplicate
            2. Move
            3. Delete
          3. How it works...
        3. Changing elements in a workflow
          1. Getting ready
          2. How to do it...
            1. Changing the parameters of workflows and actions
            2. Renaming and moving actions
          3. How it works...
        4. Undelete workflows and actions
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Importing and exporting Orchestrator elements
          1. Getting ready
          2. How to do it...
            1. Export an object
            2. Import an element
          3. How it works...
          4. See also
        6. Synchronize Orchestrator elements between Orchestrator servers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Working with packages
          1. Getting ready
          2. How to do it...
            1. Create a new package
            2. Export a package
            3. Import a package
            4. Deleting a package
          3. How it works...
            1. Export and import options
          4. There's more...
          5. See also
        8. User management
          1. Getting ready
          2. How to do it...
            1. Adding users to the Orchestrator Administrator group
            2. Giving nonadministrative users access to Orchestrator
            3. Configuring access to Orchestrator elements
          3. How it works...
            1. Right inheritance
            2. The login format
            3. Access right
          4. There's more...
            1. Changing the Orchestrator Administrator group
            2. Typical error messages
            3. Disabling nonadministrative access to Orchestrator
        9. User preferences
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. General
            2. Workflow
            3. Inventory
            4. Script editor
        10. Scheduling workflows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Workflow auto documentation
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Orchestrator and vSphere Web Client
          1. Getting ready
          2. How to do it…
            1. Configure workflows for the Web Client
            2. Writing workflows for web integration
          3. How it works...
          4. There's more...
          5. See also
      14. 6. Advanced Operations
        1. Introduction
          1. WebViews
          2. Authorizations
        2. Accessing the Orchestrator API via REST
          1. Getting ready
          2. How to do it...
            1. Establishing a connection
            2. Getting information
            3. Running a workflow
          3. How it works...
          4. See also
        3. Working with resources
          1. Getting ready
          2. How to do it...
            1. Adding resources manually
            2. Using resources in workflows
            3. Creating a new resource element
            4. Updating a resource
          3. How it works...
          4. There's more...
            1. Accessing resources directly
            2. Saving and loading resources
          5. See also
        4. Working with tags
          1. Getting ready
          2. How to do it...
            1. Tagging a workflow
            2. Viewing all tags in a workflow
            3. Finding workflows by tags
          3. How it works...
          4. There's more...
        5. Working with locks
          1. Getting ready
          2. How to do it...
            1. Locking workflows
            2. Unlocking workflows
          3. How it works...
          4. There's more...
          5. See also
        6. Language packs (localization)
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Working with policies
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Policy Templates
            2. Triggers
            3. The event variable
          4. See also
        8. Managing remote Orchestrator
          1. Getting ready
          2. How to do it...
            1. Adding an Orchestrator server
            2. Creating proxy workflows
            3. Deploying packages to remote Orchestrator
          3. How it works...
          4. See also
      15. 7. Working with VMware Infrastructure
        1. Introduction
          1. vSphere automation
            1. The vCenter MoRef
            2. The vim3WaitTaskEnd action
            3. Other vCenter wait actions
          2. vRealize Automation (vRA)
            1. Installation
            2. The vRA Orchestrator plugin
            3. vRA-integrated Orchestrator
            4. Dynamic Types or XaaS
            5. Read more…
        2. Unmounting all the CD-ROMs of all VMs in a cluster
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Provisioning a VM from a template
          1. Getting ready
          2. How to do it…
            1. Creating a configuration
            2. Creating the base workflow
          3. How it works…
          4. There's more...
          5. See also
        4. An approval process for VM provisioning
          1. Getting ready
          2. How to do it…
            1. Creating a configuration element
            2. Creating a workflow
            3. Improving with the presentation
          3. How it works…
          4. See also
        5. Working with the vCenter API (to change a VM's HA settings)
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Standard vSwitch and Distributed Switch ports
          1. Getting ready
          2. How to do it…
            1. Create an action
            2. Creating the workflow
            3. Make it work with presentation
          3. How it works…
          4. See also
        7. Executing a program inside a VM
          1. Getting ready
          2. How to do it…
            1. Create a wait workflow
            2. Create an installation workflow
            3. An example run
          3. How it works…
          4. There's more…
          5. See also
        8. Configuring a vRA instance in Orchestrator
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Configuring an external Orchestrator in vRA
          1. Getting ready
          2. How to do it…
            1. Building and configuring an external Orchestrator
            2. Configuring vRA
            3. Tuning vRA
          3. How it works…
          4. There's more…
        10. Adding an Orchestrator endpoint
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Integrating Orchestrator workflows in vRA
          1. Getting ready
          2. How to do it…
            1. Activate the advanced services tab
            2. Adding a service blueprint
            3. Publishing and adding the workflow to the catalog
          3. How it works…
          4. There's more…
        12. Managing AD users with vRA
          1. Getting ready
          2. How to do it…
            1. Creating a custom resource
            2. Creating the service blueprint
            3. Creating a resource action
            4. Conducting a test run
          3. How it works…
      16. Index