vRealize Orchestrator

Using Regex in vRealize Orchestrator - extracting useful information from a VM name

Recently I had a customer wanting to identify if a VM of theirs was in Production, Test, or Development based on the VM’s name. Luckily, all of their VMs are named using a naming standard of “{customer}{P|T|D}{application}{server-role}”, giving a generic VM name like “custpdc1” or “cust-t-sql2”. They’re just getting started on their journey with vRealize Orchestrator, and wanted to use it to perform this function. Easy enough, what do we need?

Retrieve vCenter as an SdkConnection from vCloud Director in vRealize Orchestrator

I’ve been working on some more automation lately for vCloud Director using vRealize Orchestrator. One of my use cases was to retrieve the SDK Connection scripting object for the linked vCenter Server. My starting point was an Org vDC, and from there I wanted to get the backing vCenter Server. Let’s start by getting the Provider vDC vCloud Reference object from the Org vDC scripting object (orgVDC): var providerRef = orgVDC.

vRO 7.5 Upgrade/Migration - Failed to validate the source vRealize Orchestrator database.

I’ve got a standalone vRealize Orchestrator 7.4 instance in my test environment and with the release of vRealize Orchestrator 7.5 I wanted to run through the upgrade. If you haven’t noticed already, it’s a migration to a new appliance not an in-place upgrade. This means the new vRO instance will need to connect to the existing vRO appliance and pull all of the data. When I tried doing my migration/upgrade, I got the following error message during the validation phase:

Sending VM keystrokes using vRealize Orchestrator

Last year the legendary William Lam (Virtually Ghetto) posted a handy Powershell script that can use the vSphere 6.5 API’s to send keyboard key strokes to a VM (https://www.virtuallyghetto.com/2017/09/automating-vm-keystrokes-using-the-vsphere-api-powercli.html). I recently had a need for this feature but in vRealize Orchestrator and in Javascript instead of Powershell so I’ve re-written it in Javascript. I’ve included 2 additional script blocks that you can place into Scriptable Tasks or Actions too.

VclAbstractObjectValue - Unable to serialize object

I’ve been working on some automation that will create metadata against objects in vCloud Director using vRealize Orchestrator. If you’ve ever had to do this before you’ll know how painful it can be to get your head around all of the objects/transformations you need to make before you can even set the metadata to the object. First you take the metadata value (in this case a string) and create a new VclMetadataStringValue object.

Enumerate vRO Workflow Inputs into a JSON object

Just this week I had to create a JSON object that contained all of the workflow input parameters and their respective values. While I can’t guarantee this is the best way to do it, it definitely works. I’ve tried to keep the comments succinct so if you have any questions please ask. Code // Get all input parameters for the parent workflow var inParamsArray = workflow.rootWorkflow.inParameters; // Get all input parameters for the current workflow to search through later var paramFinder = workflow.