5. vCloud vApp Provisioning : 5.5 Workflow Overview : 5.5.3 Loop Through Each VM in vApp : 5.5.3.1. Apply Custom Naming Convention to Each VM in the vApp
   
5.5.3.1. Apply Custom Naming Convention to Each VM in the vApp
At the start of the workflow, especially when being called via the API, the number of child virtual machines is unknown. This makes it quite challenging to provide user-supplied names or other per-VM properties to the virtual machines prior to deployment. A programmatic method of generating virtual machines names can be developed that matches client requirements. For demonstration purposes, the custom naming convention applied in the example workflow is as follows:
<OS Initial><4 digit number><First initial of organization name><First initial of virtual datacenter name>
In this naming convention, <OS Initial> is either W for Windows or L for non-Windows. The four-digit number begins at 0001 and is incremented if the final virtual machine name is discovered to already exist in the target organization. The final two parts of the name are the upper-case first initial of the organization and virtual datacenter respectively. For relevant scripting, see the VM Customization scriptable task of the sample workflow.