Automating vRA IaaS Blueprint creation with vRO


In some situations it might be very convenient to be able to automatically create vRA (vCAC) Iaas blueprints. However, since the IaaS part of vRA uses an OData API doing so is not a trivial task. OData is basically just a representation of the IaaS database. So there is no logic in front of it and thus no way to tell the API: “Create a blueprint for this VM please”. Previsously I talked a bit about the vCAC API. In this post I’ll get more practical and explain the steps involved when automating vRA IaaS blurptint creation with vRO.


All objects in the IaaS OData API are called entities. It doesn’t matter if it is a blueprint, a host or a build profile, everything is an entity. So in order to create a new blueprint we have to create a new entity. Which is done with the following line of code:

the createModelEntiy method  needs a couple of input parameters. The first one is easy, it’s the id of the vCACServer. This is the IaaS server object in vRO not the vCACCAFE host. You can just configure this server as an input of the workflow.

The second parameter is always “ManagementModelEntities.svc” and the third one is basically the table name of where the entity should end up. In the case of a blueprint entity it’s always “VirtualMachineTemplates” because that’s the table where the blueprints live.

Now for the tricky part: the parameter and links values.


The parameters for the entity are basically the properties of the object. The trick is figuring out which properties to use. There are a couple of methods. You could create a simple workflow that just dumps all the properties of an existing blueprint entity in a log. I prefer using LINQpad because it also shows you the relations between different tables.

So which properties do we need for the blueprint entity and how do we put them into the parameters variable? The script below shows how to do this.

Obviously you might want to change the TenantID or get it from a variable.


An entity object is basically an entry in a database table. This table links to other tables. So when creating a new entity you need to define to which elemetns in other tables this entity links to.

For blueprint entities there are 5 links to be set:

  • InterfaceType (vSphere in this case)
  • HostReservationPolicy (The reservation policy to deploy to)
  • ProvisioningGroup (A.ka Businiss Group)
  • WorkflowInfo (This is the kind of deployment you want. So for a BP that clones a template you need the Clone Workflow WorkflowInfo entity… still with me?)
  • GlobalProfiles (A.k.a Build Profiles)

This is how you put those links into a links object:

As you can see each attribute in the object is an array. The content of the array are vCAC Entities.  Most arrays have one value only the globalProfiles has multiple values if you have more then one build profile selected. In the code above I the buildProfiles variable is defined somewhere else and it is already an array so I left out the [ ].

Finding links entities

I guess you’re now wondering how to get the entities object for the links. You need to use the vCACEntitieManager to find these entities. Here is an example of how to find the WorkflowInfo entity for the clone workflow:

You can find the reservation policy by name in a very similar way:

If you have an array with build profile names as in input you can find all the corresponding entities with this piece of code:

If you want more of this in a workflow that’s ready to run, see the link at the end of this post.


So now we are able to create an entitie with the right parameters and links. After that’s successfully done there is one more thing we need to do: configuring the custom properties on the blueprint.

There are a couple required properties which start with a double underscore. Here is the list I used:

__buildprofile_order (order in which the buildprofiles are applied)
__clonefromid (id of the virtualmachineTemplate entity we created)
__clonefrom (name of the vmtemplate entity we created)
__clonespec (name of the customization spec in vCenter)
__displayLocationToUser (false)
__menusecurity_snapshotmanagement (false)
VirtualMachine.DiskN.IsClone (true for each disk)
VirtualMachine.DiskN.Size (the size of each disk)

You can set these properties with the “Update Property to Blueprint” workflow that comes with the vCAC plugin.

I used this script to generate the buildprofile order:

 Just give me the workflow

Too much information? I uploaded the example workflows to flowgrab. Find the download here.

A word of warning: The workflows might assume you’re using the vsphere.local tenant in vCAC. Should be easily fixable. If I’ve got some timeleft in the near future I might fix that myself. If you’re using another tenant you should be able to easily makes this work for you anyways.

About the author

Christiaan Roeleveld

Chris works for ITQ and one of his passions is to share his knowledge and use his experience to find the best solution for his customers. Chris started his consulting career shortly after his first encounting with VMware back in 2004. In 2013 he shifted focus to infrastructure automation and recently made the shift to cloud native platforms.


  • This is great, thanks so much for publishing it!

    Did you manage to get the Blueprint to be published?

    I set the line:

    “IsPublished”: true,

    which makes it appear to be published in the GUI in Blueprints, since there is a Yes in the published column. However, when I go to Catalog Items it is not listed as a published item, which suggests another step is also required?

  • Yeah this is pretty awesome for me right now. Currently working on creating 9 blueprints for a migration project. I’m fronting your workflow with a csv file taken from the system I’m importing the blueprints from so I can just automagically create the blueprints in my various environments. Saves me A LOT of time.

    Thanks for this Chris… 🙂

  • BTW, in the get props scriptable task you have the below to disallow snapshots:

    blueprintProperties.put(“__menusecurity_snapshotmanagement”, “False”);

    It only seems to work if false has a lower case f, like the below:

    blueprintProperties.put(“__menusecurity_snapshotmanagement”, “false”);

    This is what you have in the text in the post, but not in the downloadable code.

    • I’m sure __clonefromid is not used or at least doesn’t have an effect on which template is deployed. But this property is populated when you create a blueprint through the gui so I think it’s a good idea to populate it from the workflow as well.

  • Hi Christiaan,

    Fantastic article – very useful.

    Any chance you might be able to provide the script to publish the IaaS blueprint – please of course?

    I very much need this last bit to complete this exercise for a client – thanks!

  • Hi Christiaan
    Hope all is well. I have tried to get this to work in my environment where I am trying to create blueprints using this workflow.
    For our environment, the default tenant is not used.

    When trying to use this workflow, I can select the VRA host, however when trying to select a business group, the list is empty. To get around this, I made some changes to the workflow so that the tenant ID was changed to our tenant and made a few other changes. When running the workflow, the output shows as successful, however I cannot see the new blueprint. When I run the workflow again, it fails with an output that the blueprint already exists.

    Now when I go to Blueprints on the VRA site, I get application error, similar to this

    the only way I managed to get this fix was to restore the database from backup.

    My environment is 6.2.1

    Any help would be much appreciated.

    • The workflow looks up the provisioningGroup in the IaaS part of vRA. a provisioning group is the former name of business groups and is the entity that represents the business group on the IaaS side.
      The lookup is done by first getting the BG ID from the CAFE part of vRA and then searching for a PG with that same ID. If you can’t browse business groups in vRO than that lookup will fail end you end up linking your blueprint to null. So you won’t ever find your BP in the gui 🙂

      To check if this is the case put a System.log(provisioningGroup) in the “Get Entities” script object.

  • Hello again,

    I ran this workflow and the output showed that the blueprint was created successfully, however when clicking on blueprint in the GUI, i see the following error message

    Application Error
    Error has occurred. For more information, see event logs on the IaaS server or contact your system administrator.

    The only way to get rid of this error is to either restore the database or delete the blueprint row from the sql database in the table dbo.VirtualMachineTemplate

    I was wondering, when creating a new Blueprint, does it populate any other tables apart from dbo.VirtualMachineTemplate and dbo.TemplateToGlobalProfiles?

  • Sorry for flaming; BUT
    As Multiplatform Developer (with about +10 programming languagues in expert level) I’m now trying to get realy basic stuff done in vRA 7.3 (for now) and like all VMware products it suffers from the absence of documentation and intuitive handling. When it comes to Orchestrator I’m stuck to for 3 months now; I can’t believe what a piece motherfucking shit VMware bundled here and call it Enterprise Solution… We lost 3 professional developers over the last two years that could not handle Orchestrator, and left the company crying. After 1,5 years in a company that is VMware consulting partner and now a fourth year of total frustration I’m done too and if my boss is not going to find a replacement for me as a programmer or orchestrator as software (what will definitly not happen) I think I have to leave the company too and then there are zero devs left. No fucking one whe offered a job for this shitfuck would accept. For my part I would NEVER EVER say one of my customers he should go with anything else the Hypervisors and vCenter. Why are there “free” devs supporting this product and why in hell a whole community spends their time in fixing the code of any VMware product when even VMware themselfs dont care… It’s a fucking ridickoulus moneyprinting machine and I don’t get why. (A VMware Sales Manager told me because of all the problems and bugs they create the need for an whole branche; #FORMEAREASONTOBURNTHEMALL)

    • Can’t say I disagree with you… I have moved on to Cloudfoundry and coding in Don’t really want to go back to vro.

  • hello,

    Is there any way to get the workflow?
    The flowgrab website has been deleted.


    • I’ll see if I can still find them. These were for vRA6.x though. won’t work on vRA 7.

About the author

Christiaan Roeleveld
Chris works for ITQ and one of his passions is to share his knowledge and use his experience to find the best solution for his customers. Chris started his consulting career shortly after his first encounting with VMware back in 2004. In 2013 he shifted focus to infrastructure automation and recently made the shift to cloud native platforms.