Reader small image

You're reading from  VMware vRealize Orchestrator Cookbook. - Second Edition

Product typeBook
Published inNov 2016
PublisherPackt
ISBN-139781786462787
Edition2nd Edition
Right arrow
Author (1)
Daniel Langenhan
Daniel Langenhan
author image
Daniel Langenhan

Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
Read more about Daniel Langenhan

Right arrow

Chapter 8. Better Workflows and Optimized Working

This chapter discusses how you can improve your workflows as well as optimize your work much more. We will be looking at the following recipes:

  • Working with resources

  • Working with configurations

  • Working with Orchestrator tags

  • Using the Locking System

  • Language packs (localization)

  • Working with policies

Introduction


Here, we are going to explore how to optimize your workflows and how to make your workload easier.

Configurations come in handy when you have multiple workflows that need the same inputs. For instance, you have multiple workflows that send e-mails. Instead of having all needed mail settings stored in each workflow, you can put them in a configuration and have them stored centrally. This makes it easier for you when you need to change a setting, such as updating a password.

Another example is that you have one workflow that you use in two environments, like development and production. You design and upkeep one workflow instead of two just by duplicating it, and then storing the different variables in a configuration.

A resource is basically a file that is stored in Orchestrator and can be used within a workflow. A typical example is the language packs, which are basically text files stored as resources. Another example for resources is to store information in them such as the configurations...

Working with resources


In this recipe, we will work with resources. We will see how we can integrate files with Orchestrator and use them in workflows and for other purposes, such as storing configuration information.

Getting ready

We need a functional Orchestrator. We also need a text file in a directory that Orchestrator can access. To create such a text file, you could use the example workflow 09.02.1 Write a File. Also see the recipe File operations in Chapter 9Essential Plugins.

How to do it...

This recipe contains multiple parts, each dealing with different aspects of resources.

Adding resources manually

Let's start by adding a resource to Orchestrator manually:

  1. Switch Orchestrator to Design mode.

  2. Click on Resources (the white page with a blue symbol on it).

  3. Create a new folder where you can store your resources by right-clicking the root in the tree and selecting New folder.

  4. Right-click on the new folder and select Import resources.

  5. Select a file such as an image or text file from your local...

Working with configurations


In this recipe, we will see how configurations can improve our design. Configurations are like global variables that are centrally defined and can be used by all workflows.

Getting ready

We just need a working Orchestrator, and you will need the rights to create new workflows and run them. We will work with the Orchestrator Client.

We will use the example workflow 05.05 Workflow Presentation to test the configuration.

How to do it...

We will split the recipe in two sections, creating and using a configuration.

Creating a configuration

  1. Using the Orchestrator Client in Design mode, click on Configurations (the white paper with a gear icon).

  2. Right-click on the root and create a new folder. Give the folder a name. It's always a good idea to use new folders.

  3. Right-click on the new folder and select New element. Give the new element a name. The new configuration opens up in edit mode. Click on Attributes.

  4. Now, we can create new variables as we used to in a normal workflow. Create...

Working with Orchestrator tags


Let's explore the tagging of workflows. Tagging introduces the same kind of tagging you're familiar with from vCenter server. Tagging allows you to add tags to Orchestrator objects and search for them.

Getting ready

We need some elements such as a workflow or action we can tag.

How to do it...

Tagging involves the following procedures.

Tagging an element (manual)

Let's start by tagging a workflow manually.

  1. Open a workflow for editing.

  2. Go to the General tab and click on the [Type here to add a tag...].

  3. Type a tag name such as glbTest and then press Enter.

  4. Next, we are adding a tag with a value. Enter another tag such as author, then press Ctrl + S and then enter the value for the tag, such as Daniel.

  5. Click on Save and close.

Tagging a workflow (workflow)

You can tag a workflow using a workflow.

  1. Start the workflow by navigating to Library | Tagging | Tag workflow.

  2. Select the workflow you would like to tag.

  3. Enter a tag and a value.

  4. Select whether you would like this tag to be...

Using the Locking System


Here we will have a look at the Locking System. We will learn how to lock and unlock objects using locks. Locks are used to make sure objects are only used by one owner.

Getting ready

The Locking System doesn't need anything, as it itself is just virtual.

How to do it...

There are three phases to locking: locking, checking and unlocking.

Create a lock

We will now create a lock:

  1. Create a new workflow and add a scriptable task.

  2. Add the following variables as input:

    Name

    Type

    Section

    Use

    object

    String

    IN

    Any string

    owner

    String

    IN

    Any string

  3. Enter the following script:

    LockingSystem.lockAndWait(object ,owner); 
    
  4. Add the workflow Display all Locks at the end.

  5. Save and run the workflow. Enter as object any string, such as Test and as owner or any other string such as Goofy.

  6. Check the logs.

Check for lock

We will now check if an object is locked:

  1. Create a new workflow and add a scriptable task.

  2. Add the following variables as input:

    Language packs (localization)


    This recipe will look into the possibility of creating localized language packs for workflows. Localization enables users to see workflow presentations in their local language.

    Getting ready

    We just need an Orchestrator and the ability to edit text files. Additionally, you might want to know a foreign language (or use Google Translate).

    How to do it...

    We will now create a language pack for the example workflow 00.00 BasicWorkflow:

    1. Navigate to the workflow you want to create localization on.

    2. Right-click on the workflow and navigate to Localization | create localization resources.

    3. Navigate to the Orchestrator resources. You will notice that new ResourceElementCategory folders have been created along with ResourceElements for English, Japanese, French, German, and Korean:

    4. Right-click on the workflow again, navigate to Localization | export localization bundle, and save it onto a local file.

    5. Switch to your local filesystem and unzip the localization bundle.

    6. Edit one of...

    Working with policies


    In this recipe, we will look into policies. We will learn how to create and use policies to react automatically to events that occur outside Orchestrator.

    Getting ready

    For this recipe, we need something that we can monitor for events. We have a look at policies with the recipes Working with SNMP and Working with AMQP in Chapter 10, Built-in Plugins.

    In this example, we will monitor objects in the vCenter server.

    How to do it...

    We will create a simple policy that will monitor a VM by performing the following steps:

    1. In the Orchestrator Client, switch to the Run mode and click on Policies.

    2. Click on Create a new Policy (the icon that looks like a scroll with a plus sign).

    3. After you give the policy a name, you will find a new policy in the policy list. Right-click the policy you have created and select Edit (the pencil icon):

    4. In the General tab under Startup, choose whether the policy should be started with the Orchestrator service or not. This is used when Orchestrator is powered...

    lock icon
    The rest of the chapter is locked
    You have been reading a chapter from
    VMware vRealize Orchestrator Cookbook. - Second Edition
    Published in: Nov 2016Publisher: PacktISBN-13: 9781786462787
    Register for a free Packt account to unlock a world of extra content!
    A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
    undefined
    Unlock this book and the full library FREE for 7 days
    Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
    Renews at €14.99/month. Cancel anytime

    Author (1)

    author image
    Daniel Langenhan

    Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
    Read more about Daniel Langenhan

    Name

    Type

    Section...