VMware Cloud Community
jaelae
Enthusiast
Enthusiast
Jump to solution

Unable to create and place VM into subfolder structure

I think this is simply not using the correct logic to make this work. I have a use case to place newly created VMs from Aria Automation 8.9 into a folder structure that uses some detail of the requester. For example, all VMs should be into the 'vra_folder' in a sub folder for the requester like this: vra_folder/jason

I can make this work by manually prompting for it. I do this by creating a 'vCenter_Folder' input which prompts for this structure.

vCenter_Folder:
type: string
title: vCenter Folder
description: vCenter Folder Placement
default: vra_vm_folder/username

Then I reference it using:

foldername: ${input.vCenter_Folder}

This will place the VM in the existing vra_vm_folder and then if the username subfolder doesn't exist, it will create it and works fine. However, I cannot figure out how to pull that name from the requester. Any assistance or ideas would be fantastic!

 

0 Kudos
1 Solution

Accepted Solutions
jaelae
Enthusiast
Enthusiast
Jump to solution

I think I was overthinking this after looking at some other solutions. This is now working correctly. If it helps someone in the future, I did the following under Cloud_vSphere_Machine_1:

folderName: vra_folder/${env.requestedBy}

The vra_folder is the root folder I want all vRA deployments in. Then the env.requestedBy variable simply contained the username without the domain name. For user jdoe@company.com, it created the following:

vCenter-DC
-> vra_folder/jdoe

All VMs were placed within this folder (which didn't exist previously). I deployed a second VM and it just placed the VM in the same folder since it now exists.

 

 

 

View solution in original post

0 Kudos
1 Reply
jaelae
Enthusiast
Enthusiast
Jump to solution

I think I was overthinking this after looking at some other solutions. This is now working correctly. If it helps someone in the future, I did the following under Cloud_vSphere_Machine_1:

folderName: vra_folder/${env.requestedBy}

The vra_folder is the root folder I want all vRA deployments in. Then the env.requestedBy variable simply contained the username without the domain name. For user jdoe@company.com, it created the following:

vCenter-DC
-> vra_folder/jdoe

All VMs were placed within this folder (which didn't exist previously). I deployed a second VM and it just placed the VM in the same folder since it now exists.

 

 

 

0 Kudos