This article is based on using the HTML-based user interface that was introduced with vRealize Orchestrator version 7.5 and which is the only available client in version 8. If you are running an older version and would like to use the instructions for the older Java-based client then you can find those instruction here.
Instructions to install vRealize Orchestrator version 8 can be found in the on-line documentation. vRealize Orchestrator is a standard component in a vRealize Automation version 8 appliance so if you already have vRA installed then you don't have to install vRealize Orchestrator separately.
The instructions on this page start after you have logged in to your vRealize Orchestrator web based user interface.
Create a connection between vRealize Orchestator and vCenter Server
A new installation of vRealize Orchestrator will not be connected automatically to your vCenter Server. To verify if your vRealize Orchestartor server can access the vCenter inventory select Inventory from the menu on the left. If you can browse through your inventory then the connection has been made. If not follow the instructions below to make the connection.
If the connection to your vCenter Server was not made yet follow these instructions first. Otherwise you can start creating your first workflow.
From the menu on the left select Workflows and search for Add a vCenter. This will find the workflow with the full name of Add a vCenter Server instance. Run that workflow.
Specify the address information for your vCenter Server. For your convenience, especially when using self-signed certificates enable the checkbox for ignoring certificate warnings.
Switch to the Set the connection properties tab and disable the checkbox which will allow to use one account (for example email@example.com) for all vRealize Orchestrator workflow executions.
Click Run (not in the screenshot) to add the vCenter server connection. Verify as described at the beginning of this article if you can browse though the vCenter inventory.
Create a vRealize Orchestrator workflow
From the panel on the left select Workflows and click New Workflow.
For the name I have in this example used My Workflow. When creating workflows in production it is important to select a meaningful name.
To build the workflow on the graphical design canvas click the Schema tab. Next drag a Workflow element from the panel on the left to the design canvas in between the start and end icon. Notice that the blue arrow in between the start and end element will highlight in bold when dropping the element. This indicates that you can drop the element in that place.
On the right side in the Workflow element details pane enter a name for this element: Stop the VM.
When necessary scroll down and enter the name of the workflow you want to add in the Workflow field. If you start typing shut down guest you will see the needed workflow in the popup list. Select the workflow named Shut down guest OS and wait from the list.
A blue-colored message bar shows up at the top of the middle panel that allows you to automatically promote the necessary parameters for this workflow element. For the purpose of these instructions I will not use that feature so close the message bar.
In the panel at the right with the workflow element details scroll down to the Inputs section. You can see that the workflow element requires an input variable named vm of the type VC:VirtualMachine. This is a reference to the virtual machine object in your vCenter inventory. Click the Select variable field and select Create New.
Create a new Input Parameter. The suggested name of vm makes sense because this will match what is needed for the workflow element. When creating larger, more complex workflows with multiple virtual machine inputs a different naming convention might be necessary.
Add another Worklfow element to the canvas. Drop it on the blue arrow between the previously added element and the end element.
Modify the name of the element into Change RAM. In the Workflow search field enter Change RAM. This will find the workflow in your inventory that is available by default and changes the memory of a virtual machine to a new value.
Because there already is a vm input parameter in your workflow this new element automatically uses that as the necessary input (for which vm doe you want to change the memory). Click the Select variable field and select Create New.
Add a new input parameter named memory. Change the default type of string to number.
Add a third Workflow element to the design canvas between the Change RAM element and the end element.
Name the new Workflow element Start the VM. In the Worlflow search field enter Start virtua. While typing the workflow list will show the needed workflow named Start virtual machine and wait.
For this element the vm input parameter is also automatically mapped to the input parameter of your workflow. The host parameter is optional, when not using this parameter the vm will start on the host where it is already registered.
Save the workflow. You have now created a simple workflow that does a shutdown, configures a new amount of RAM and starts the VM again. Run the workflow to test it's functionality.
Open the workflow for editing. If you look at the Inputs/Outputs tab you will be able to verify that the two input parameters we have defined are there.
To understand how these inputs are being used let's have a look at the following diagram:
The vm input parameter from the workflow is used as input for each of the workflow elements in your workflow. This is because each element needs it. Which vm to stop, which vm to modify and which vm to start. In this case it's the same vm but each workflow element always needs to receive it's inputs and you as the workflow developer will have to take care of that.
The memory input is only necessary to be sent to the Change RAM element because that's where we configure the new amount of RAM.
You are going to modify the workflow now to not just configure an amount of RAM but to add an amount of memory to the virtual machines current memory count.
For this we need a new workflow variable to store our RAM calculations. Let's look at the following diagram:
Name the new scripting element Calculate RAM. Add two new parameters to this element. CLick the plus-sign and select vm for input and secondly memory.
Next create a new output parameter for this element. Click the plus icon and select Create New.
Choose to create a new variable named newMemory. Change the type to number.
Add this scripting line to the Scripting tab of the scripting element:
newMemory = vm.config.hadrware.MemoryMb + memory;
Select the Change RAM element and change the input from using memory as input to using newMemory as input.
The inputs for the Change RAM element should now look like in the following screen shot.
If you take a look at the Variables tab you can verify that the necessary variable that we require to store the result of Calculate RAM has been added to your workflow.
You can now save and run the workflow. If you now select a vm and specify an amount of RAM that amount of memory will be added to the existing memory count for your virtual machine.
Please enter a valid email!
Please enter a valid email!