Automating the beast.. vrealize workflows

Okay so for years now I have played with vmware, vcloud and powercli. I always wanted to spend some time with orchestrator or vrealize as it is now known but never had the chance to dive in… That has changed of late and I have been having great fun building up some simple automation and learning javascript along the way.

Over the next few days I am doing to try and detail what I have done for everybody out there, they are rather simple workflows but very effective at reducing the time spent on your first level calls.

What will be covered.

  • Simple virtual machine build blueprint
  • Modify CPU (up or down whilst checking for hotplug)
  • Modify Memory (up or down whilst checking for hotplug)
  • Extend Disk
  • Rename Virtual Machine
  • Snapshot Virtual machine (with date to delete, asking for confirmation and an extend option)
  • Snapshot Report
  • Virtual Machine Detail Report

Simple virtual machine workflow and lessons learnt.

Originally I was trying to cram everything into the one workflow, operating system, datacenter design, tier 1 disk, tier 2 disk and on and on.. But quite frankly the workflow became unwieldy and complicated for the end users.. see screenshot below. Now it looks simple enough but the end user ended up with two pages of questions for the one workflow. Another approach to make it both easier and simpler for the end user needed to be found.


So I decided to break it down to what we actually needed. In our environment we have three flavours* at the time of writing this. Microsoft 2012 R2, Redhat 7, Centos 7 and three datacenters. Therefore it is actually an easier approach to use the vcac blueprint style and show a OS-Datacenter model.

*flavours, being the main server OS built. Everything else is considered and exception and manual intervention at this stage is conducted.

  • Datacenter1-Windows 2012 R2
  • Datacenter1-Redhat 7 x64
  • Datacenter1-Centos 7 x64

Defaults to the datacenter, alllow automatically picking the host, datastore, cluster, OS, and due to pxe builds the starting vlan.

The end user is presented with one quick fill screen asking for the following.

  1. Virtual Machine Name
  2. Memory Size GB
  3. Cpu Number
  4. Size of Disk 1
  5. Size of Disk 2 (optional)
  6. Size of Disk 3 (optional)

Virtual machine name is converted to lowercase automatically, memory size in GB has a maximum set, cpu number has a maximum set.

The script at the beginning connects to Active Directory and grabs the users first name, last name and email address for a personal touch. Also means the user does not have to fiddle around putting in their contact details. And we end up with a very simple workflow, although it seems simple looking at the schema..


The main issue is that you will use the inbuilt workflow ‘Create Custom Virtual Machine’.. This calls on the actions;

  • createVirtualEthernetCardDvNetworkConfigSpec
    • not being vmxnet 3.. grrr
  • As well as only one choice of datastore
    • Now this is not normally an issue with auto-tiering SAN but in some workplaces SAN admins still prefer to run a manual tiering system.

I will continue on these and add some audio but here are some teasers..


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s