VMware Cloud Community
hleibowi
Contributor
Contributor
Jump to solution

How to make dynamic folder creation in vSphere for vRA blueprint deployments?

Hello and good day!

Im trying to figure out how to make a dynamic folder created  when a user requests a vRA blueprint and have those machines from that deploy dumped into that folder.

What im aiming for is that when a user requests a blueprint in vRA, the request page asks what their name is.

When  the machines are created/deployed from that blueprint/request, a folder would be created in vSphere that would be labeled with the username that was provided through the request form, and all those provisioned machines would then be dropped into that folder.

Ive ran across the custom property of VMware.VirtualCenter.Folder, which works fine if  I manually put in the info into the blueprint properties,  but of course every time that blueprint is ran, it puts all the provisioned machines in the same folder.  Im aiming for the value of that property be dynamic and based on the info provided in the blueprint request form.

Hope this makes sense.

Any general help would be appreciated.

Eventually, id like the folder to be created with the info of <user+time/date>, but for starters and for my understanding, if i could just get it created dynamically with the user name, that would be a good start.

Thank you

0 Kudos
1 Solution

Accepted Solutions
RebeccaW
Enthusiast
Enthusiast
Jump to solution

For just the folder being named by the enduser you could check the box for "Show in Request" for that property in the blueprint. Then add it to the Property Dictionary so you can set the displayed name to have a friendly label other than VMware.VirtualCenter.Folder. That should work if you want them all as top-level folders.

If you need to have some hierarchy above the <Name> folder and/or append something to the name they give in the form then an Event Broker subscription tied to a simple workflow could get you that. Take a look at "virtualMachineAddOrUpdateProperties". A search on that will pull up some good tutorials on how to set it up.

View solution in original post

0 Kudos
6 Replies
daphnissov
Immortal
Immortal
Jump to solution

I wrote a blog post in which I address this challenge specifically. When using the SovLabs Property Toolkit module, this becomes a very easy task and I walk you through exactly how dynamic and flexible that can be.

0 Kudos
RebeccaW
Enthusiast
Enthusiast
Jump to solution

Would it work if you had the EBS write the value of VMware.VirtualCenter.Folder perhaps at VMPSMasterWorkflow32.Requested PRE?

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

You'd still have to dynamically calculate its value by that stage, and that would still have to be munged inside vRO.

0 Kudos
RebeccaW
Enthusiast
Enthusiast
Jump to solution

Yes, it would be a simple single element vRO workflow. Providing you have all the the pieces (properties or parts thereof) needed to calculate the value you want for the vrm folder property I'm not seeing how it would be very complex. Adding\Changing\Removing properties via the EBS is pretty straight forward out of the box.

We have quite a few subscriptions at a few stages to calculate and write additional properties, either by just using other existing properties to calculate the value or using an action to use existing properties as a search to look up a value in the configurations.

0 Kudos
RebeccaW
Enthusiast
Enthusiast
Jump to solution

For just the folder being named by the enduser you could check the box for "Show in Request" for that property in the blueprint. Then add it to the Property Dictionary so you can set the displayed name to have a friendly label other than VMware.VirtualCenter.Folder. That should work if you want them all as top-level folders.

If you need to have some hierarchy above the <Name> folder and/or append something to the name they give in the form then an Event Broker subscription tied to a simple workflow could get you that. Take a look at "virtualMachineAddOrUpdateProperties". A search on that will pull up some good tutorials on how to set it up.

0 Kudos
hleibowi
Contributor
Contributor
Jump to solution

Thank you Rebecca. I'm going to give that a try.

Edit: That worked perfectly.

Now going to work on making it name+date.time.

Thanks again!

0 Kudos