vRealize_Automation _7.x-Extending-Disk-of-vCenter-Template-Blueprint

November 15, 2017

vRealize Automation 7.x Extending disk of vCenter template blueprint


Upon provisioning, you need to extend the C drive of a virtual disk in vRealize Automation from a vCenter (vSphere) machine template blueprint.

Currently, machine blueprints which include disks created from a vCenter template cannot be modified by vRealize Automation.


I created a vRealize Automation event subscription to invoke a custom vRealize Orchestrator workflow to extend a vCenter (vSphere) machine template disk.


Creating a vRealize Automation blueprint with custom properties is very easy to configure.

When a virtual machine is provisioned, vRealize Automation’s Event Broker service will call an Orchestrator workflow to extend its C drive partition.

The “vRA_Extend-C_Drive-IntoGuest” workflow takes one input parameter called vmProperties of type Properties. Within its payload are two values of interest, vmUuid which represents our provisioned virtual machine and newSizeGb which carries the value of our user’s input from vRealize Automation for the disk size space increase.




The vRA payload element ingests the payload and passes on the VM’s UUID (vmUuid) to the following workflow element “findVcVmByUuid” which then takes our VM’s Admin UUID (vmUuid) from vRealize Automation, performs a lookup in vCenter and returns the VM’s sdk information in the form we want in type (VC:Virtual Machine) to pass to the last element in our wrapper workflow to finally extend the C drive.

Side note: any workflow element that excepts input of type VC:Virtual Machine can be inserted here to perform whatever you want vs increasing a C drive workflow.

Here are the workflow elements of the “vRA_Extend-C_Drive-IntoGuest” workflow and does the heavy lifting for us.

  • CMD-Extend-Hard_Disk_1
  • extendDisk
  • Copy file from vCO to guest
  • Run program in guest




It takes two inputs, vm and newSizeGb that are fed from the wrapper workflow from vRealize Automation.

ExtendDisk element does what it sounds like, it extends the virtual disk vmdk in vSphere/vCenter. It creates the virtual machine reconfigure spec and re-configures the VM.










It then copies over the scripts (extend.cmd and extend.txt) and runs them in the guest operating system. I’m using diskpart.exe which seems most reliable across most versions of Windows OS but, if you like to use PowerShell, use something like this:




The scripts used are very basic and easy to create but, for sake of ease, they are bundled in the workflow package as resources.






Event Subscription:

Run based on conditions

All of the following

Data > Machine > Machine Type  = Virtual Machine

Data > Lifecycle state > Lifecycle state name = VMPSMasterWorkflow32.MachineProvisioned

Data > Lifecycle state > State phase =POST

Data > Blueprint name = Your Blueprint name







Remember to publish your subscription





In the blueprint, I added two custom properties:

1) Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned

For its value, I used an asterisk * to pull in the entire payload from this property. You may wish to refine your property output to send only the values you are interested in (VM Admin UUID) vs. sending the entire payload to Orchestrator to process.

2) newSizeGb

I left its value empty to prompt users for input when requesting virtual machines from the this blueprint.






List of Workflows

  • vRA_Extend-C_Drive-IntoGuest
  • CMD-Extend-Hard_Disk_1
  • extendDisk
  • Copy file from vCO to guest
  • Run program in guest

List of Actions

  • findVcVmByUuid
  • vim3WaitTaskEnd

List of Resources

  • extend.cmd
  • extend.txt
  • extend.ps1

Workflow package

  • com.vra.extensibility.c-drive

Download details: Workflow package


Refer to VMware documentation:


Image showing changes to the VM from the vSphere client:







Rob Shaw – 11/14/2017

Comments are closed.