Using Orchestrator though the vSphere Web Client

In this recipe, we further explore the Orchestrator integration into vSphere Web Client. You will learn how to run Orchestrator workflows using vSphere Web Client as well as how to configure workflows so that they work with it.

Getting ready

You find the base information on how to integrate Orchestrator into the vSphere Web Client in the recipe Connecting to vCenter in Chapter 1, Installing and Configuring Orchestrator.

For this recipe, we need Orchestrator integrated into vSphere Web Client.

How to do it...

This recipe is made up of two parts, the configuration and the passing along of information between the Web Client and Orchestrator.

Configure workflows for the vSphere Web Client

We now configure workflows for use with the vSphere Web Client:

  1. Open the vSphere Web Client in a web browser.
  2. Log in to vCenter with a user that is a member of the Orchestrator admin group that you configured in vSphere authentication (see recipe Configuring an external Authentication in Chapter 1, Installing and Configuring Orchestrator).
  3. Click on vRealize Orchestrator and wait until the Web Client has finished loading all information. You should now see at least one Orchestrator server registered.
  4. Click on Manage and then on Context Actions. You can now see all the workflows that have been configured for use with the right-click menu from vSphere Web Client. If you can't see Manage, you need to use a user that is part of the Orchestrator admin group:

    Configure workflows for the vSphere Web Client

  5. To configure a new workflow for use with the vSphere Web Client, click on Add (the green plus).
  6. Select a workflow from the list of available workflows (choose the workflow Library | vCenter | Virtual Machine Management | Basic | Rename virtual machine, as this workflow can be used without extra configuration) and click on Add.
  7. Select the type of vSphere object this workflow should be available to (such as a VM).
  8. Multi selection lets you choose not only one but multiple instances of the same vSphere object, for example, not only one VM but multiple VMs. For this to work, you also have to make sure that the workflow has an in-parameter of the Array of [any vCenterobject] type.
  9. Click on OK:

    Configure workflows for the vSphere Web Client

Run workflows

To run workflows, a vCenter user must have at least the view and execute right in Orchestrator; see recipe User management in this chapter.

If you just configured the new workflow you need to re-log in:

  1. To run the Rename Virtual Machine workflow from our example, navigate in the vSphere Web Client to a VM.
  2. Right-click on the VM, and navigate to All vRealize Orchestrator Actions | Rename Virtual Machine.
  3. Enter a new name for the VM and click on Submit:

    Run workflows

Writing workflows for web integration

When running a workflow from the Web Client, you might want to pass some information to the workflow in Orchestrator, for instance, the vSphere object you are running the workflow on:

  1. Open the workflow you want to use with the Orchestrator Client in edit mode.
  2. Make sure that you have a workflow in-parameter of the type you want to associate with in the vSphere Web Client, for example, VC:VirtualMachine. If you plan to use the Multi selection option, make sure that you use an Array of VC:VirtualMachine.
  3. In Presentation, assign the Show in Inventory property to the workflow in-parameter. If this property is assigned to more than one in-parameter, only one parameter at a time is used. For example, if you have an in-parameter for a VM and for a cluster, both have the Show in Inventory property assigned to them. When starting the workflow from a VM, the VM ID will be used and the cluster ID will not be transferred to the workflow. When starting the workflow from a cluster, the cluster ID will be used and the VM ID will be ignored.
  4. Save the workflow.

Passing information along

In case you want to use a workflow such as run a SSH command. You will find that you will need to still add a hostname, even if you assign it to a VM. To solve this, follow these steps:

  1. Make a copy of the workflow Library | SSH | Run a SSH Command
  2. Move the input parameter hostNameOrIP to attribute (right-click and select Move as Attribute)
  3. Add an input parameter called VM of type VC:VirtualMachine
  4. Add a scriptable task with the input of VM and output of hostNamOrIP
  5. Add the following code:
  6. hostNameOrIP=VM.guest.hostName;
  7. This little modification will make sure that you can now run the workflow on a VM without entering a hostname.
  8. Also, see the example workflow 07.04.5 Run SSH command (Web Client).

How it works...

The vSphere integration of Orchestrator into the vSphere Web Client allows you to easily use workflows that you have created.

You can also start all the workflows from the vSphere Web Client by clicking on vRealize Orchestrator | Inventory Trees | Workflows. The Orchestrator workflow tree you know from Orchestrator Client will appear and you can select and then start the workflow.

It's also possible to schedule workflows; just click on the workflow that you would like to run and then click on the right window onto Schedule workflow. This works the same as in Orchestrator Client. You can monitor all scheduled workflows by clicking on vRealize Orchestrator | Inventor List | Scheduled workflows.

The last and most important thing is that you can also interact with workflows that are waiting for interaction. Just click on vRealize Orchestrator| Inventor List | Waiting for interaction to see all workflows that are currently waiting for interaction.

You can see all the workflows that are and have been running on vRealize Orchestrator | vRO Servers | [your server] | Monitor. Here, you can also Cancel and Answer workflows. The workflows you see here are all the Orchestrator workflow runs, not only the ones run via the vSphere Web Client.

Orchestrator presentation properties in vSphere Web Client

The Orchestrator presentation properties that you have set up will be working in vSphere Web Client with an exception; hiding a page.

Check out the example workflow 07.05.01 Presentations test to test this.

There's more...

As you need to define Context Actions (right-click on the menu), it is rather important that you are able to back up or restore these settings.

By clicking on vCenter Orchestrator | Manage | Context Actions, you can use the export action (the white paper icon with the blue right arrow) to export all current settings into an XML file. Using import (the white paper icon with the green left arrow), you can import these settings into Web Client again. Please note that the export contains the workflow ID, so make sure that the workflows on another Orchestrator server have the same ID (see the Synchronize Orchestrator element between Orchestrator Servers recipe in Chapter 3, Distributed Design and the Working with packages recipe in Chapter 4, Programming Skills).

See also

  • Recipe Connecting to vCenter in Chapter 1, Installing and Configuring Orchestrator
  • Recipe Working with user interaction in Chapter 6, Advanced Programming
  • Recipe Workflow presentations in Chapter 5, Visual Programming
  • Recipe Language packs (localization) in Chapter 8, Better Workflows and Optimized Working

The example workflows 07.04.5 Run SSH command (Web Client) and 12.05.01 Presentation Test.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset