vRealize Orchestrator for beginners and not only (part 2/2).

If you were following my guide „vRealize Orchestrator for beginners and not only (part 1/2)” as well as other guides available over the Internet, you already have running environment.

Now, let’s connect vRealize Orchestrator to vCenter and deploy new workflow.

If you will be willing to follow this guide to the end, you should have running your first workflow that will create snapshot of the vm and schedule the next one to delete all vm snapshots for a given date.

You will see how easy it is and how much work has already been done by VMware to help you with this process.

First we need to login to Orchestrator with url: https://orchestrator/orchestration-ui. Please remember, you need to login using URL and not the IP address.

You should see Orchestrator dashboard similar to:

On the left we have Library -> Workflows tab on which we are going to concentrate.

If you select this link you should see lots of boxes with already created (and tested by VMware) workflows. On each, we should be able to do the following actions:

In Orchestrator 8.2 from this place we can schedule workflow, but also we can go into the details, run it straightaway or duplicate (you will do this a lot).

Let’s search for “add vcenter” workflow by filtering them like this:

Now you should able to easily find the following workflow:

Click the details link, we go through this workflow options:

In general tab, you will find the description of the workload. Do not ignore this tab, it is really important. You should keep track on version (as you would probably do the update/rewrite of your workload), tags and description – this is your minimal set you need to upgrade.

And in general, like everywhere, keep you naming clear and understandable for you AND the others. Common standard in Orchestrator is to variables in Camel convention – you just simply need to keep described names without spaces and words beginning with capital letters. Like this: thisIsYourVariable.

Variables can change during workflow runs.

Inputs/Outputs cannot change during workflow runs. It is more like constant in “c” –

#define myVariable 10. This value will workflow as when start and will return when ends.

This is the workflow flow. So there in the graphical way you can see all the controls workflow will go thru. If you double click on any of them on the right description and detailed information including the scripting code.

Ok, so lets run this workflow and connect our Orchestrator to the vCenter instance. Click the link run on the top and fill all the required fields:

Run and observer what will happen. If everything goes fine, then the page should fill up with green confirmations.

Check the existing snapshot workflows and how to operate with 2 of them:

In workflow tab filter for snapshot like this:

You should be able to find the “Create snapshot” and “Remote all snapshots” workflow.

Let’s run the create snapshot workflow.

So as you can see, this run nice schema where you can set parameters (inputs in Orchestrator terminology).

Please fill it and run. Check on the vCenter if snapshot creation was successful.

Than go into the activity -> “workflow runs” in the Orchestrator and search for the workflow running information.

You should be able to the workflow running time and (maybe the most important) tab variables with all running information. This can save you a lot of time in the case of future debugging.

Additionally, you have all the historical workflow information, which is not to be underestimated.

Do the same step with “delete all snapshot” workflow.

Check if you are familiar with all tabs and at least you understand them a little. Most should be understandable.

Creating our own workflow based on what we know:

Back to the workflow tab and select “new workflow”

Our schema will look like this:

Just from the right panel drag and drop the following elements on the diagram to have similar schema as me:

  • Workflow element
  • Decision
  • Scriptable task

Select the “workflow element”, on the right panel with details should be visible.

Set the following parameters:

Most of them should fill automatically.

Save the current status and select scriptable task. Configure it in the following way:

var workflowToLaunch = Server.getWorkflowWithId("BD8080808080808080808080808080800FC180800122528313869552e41805bb1");
if (workflowToLaunch == null) {
	throw "Workflow not found";
}

var workflowParameters = new Properties();
workflowParameters.put("vm",vm);
workflowParameters.put("__taskName", "Orchestrator scheduled snapshot remove");
workflowParameters.put("__taskDescription", "Remove all snapshots for vm: "+vm.name);
scheduledTask = workflowToLaunch.schedule(workflowParameters, deleteSnapsotScheduleDate);

Workflow id can be checked on the “delete all snapshot” workflow:

Just copy and pass this ID into your code.

Check if your variables looks like this:

Remember, variables is the running parameter and in this case false means that we want to do the snapshosts without memory always. Workflow will never ask for this parameter.

Next check if Inputs/Outputs in your new workflow presenting like this:

Next change the input form. It is yours invention but in my case it looks like this:

Remember that this form can be visible in the vSphere client. So it is worth to spent some time on this.

Next let’s run yours new workflow:

In my case workflow looks completed successfully and this is the result:

If you go to the activity -> scheduled tab you should be able to see scheduled task with the system name:

And after the specified time snapshot will be deleted.

Conclusion

I hope I could interested you with the vRealize Orchestator. Even if you are not interested in using vRealize Automation, orchestrator with vCenter is a fantasting complement.

You can do much more with orchestrator than just vCenter.

Additionally, you will have history of your workflow with all parameters it was running. You have control on everything from one place. With the guarantee that the workflows will work or will be resumed even after orchestrator (or other component) restart.

If there is something incomprehensible, please let me know in comments. I will be happy to correct the description or explain something more to you in details.

——

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Linux
Migrate WordPress site to another hosting service.

IntroductionThis article details the migration of WordPress site (exactly this site you are now on) from one service provider to Amazon Lightsail. There might be various reason to do that (mine is outlined below) but in general I hope to share the message that especially with WordPress, migration can be …

VMware
VMware Workstation and Fusion can be installed and use for free (even for the enterprise)

For a while now, the VMware Workstation (and Fusion for MacOS) can be used without any additional fee for Personal use. That was a great Broadcom news and nice gesture from that software vendor. Recently Broadcom announced that the software will be available for all, even the commercial sector. This …

Linux
Salt, VMware implementation – part 1, introduction

As every IT administrator knows, the infrastructure (meaning storages, compute, VMware virtualisation stack) is just a fundaments to run various operating systems (OS) and finally (containerized) application. Therefore, installation of (let’s call it) infrastructure in the datacenter (SDDC), in that sense is just the beginning of the adventure. No wonder, …