Book Image

VMware vRealize Orchestrator Cookbook - Second Edition

By : Daniel Langenhan
Book Image

VMware vRealize Orchestrator Cookbook - Second Edition

By: Daniel Langenhan

Overview of this book

VMware vRealize Orchestrator is a powerful automation tool designed for system administrators and IT operations staff who are planning to streamline their tasks and are waiting to integrate the functions with third-party operations software. This book is an update to VMware vRealize Orchestrator Cookbook and is blend of numerous recipes on vRealize Orchestrator 7. This book starts with installing and configuring vRealize Orchestrator. We will demonstrate how to upgrade from previous versions to vRealize Orchestrator 7. You will be taught all about orchestrator plugins and how to use and develop various plugins that have been enhanced in Orchestrator 7. Throughout this book, you will explore the new features of Orchestrator 7, such as the introduction of the control center, along with its uses. You will also come to understand visual programming, how to integrate base plugins into workflows, and how to automate VMware. You will also get to know how to troubleshoot vRealize Orchestrator. By the end of this book, you will be able to get the most out of your Orchestrator installation, and will be able to develop complex workflows and create your own highly integrated automations of vRealize environments.
Table of Contents (19 chapters)
VMware vRealize Orchestrator Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Turning strings into objects


In this recipe, we will take a quick look at how to turn a string into an Orchestrator object (such as VC:VirtualMachine). This technique is rather important when you use REST to start workflows.

Getting ready

We only need the Orchestrator Client with the right to create a workflow.

How to do it...

In this example, we turn a string into VC:VirtualMachine:

  1. Create a workflow with a string input (vmString) and a VC:VirtualMachine output (vmObject).

  2. Add a scriptable task and connect the in- and output parameter.

  3. In the script, enter the following code:

          query = "xpath:name='" + vmString + "'"; 
          vms=Server.findAllForType("VC:VirtualMachine", query); 
          vmObject=vms[0]; 
    
  4. Run the workflow and enter a Virtual Machine name.

  5. Check the output and logs.

How it works...

The find function looks for all elements of a given type and can be limited using a search function. It's very important to write the correct type and the search string.

The next important...