Spring into Action with vRA8 Custom Properties – A Fresh Start for Your Virtualized Applications

Grouping Custom Properties in Cloud Templates

When working with cloud templates, it is common to have a large number of custom properties that need to be set. These properties can be grouped logically into categories to make them easier to manage and maintain. In this article, we will explore the benefits of grouping custom properties and how to do it in your cloud templates.

Benefits of Grouping Custom Properties

—————————————

Grouping custom properties has several benefits, including:

### Easier Maintenance

When custom properties are grouped logically, it is easier to maintain and update them. You can make changes to one property without affecting the others.

### Improved Readability

Grouping custom properties makes it easier to understand the configuration of your cloud templates. It helps to reduce complexity and improve readability.

### Better Organization

Grouping custom properties allows you to organize your configuration in a more logical and structured way. This can help to reduce confusion and errors.

### Extensibility

When custom properties are grouped logically, it is easier to extract values for use in extensibility actions. Your custom properties are provided as objects within an array, which is simple to iterate through from vRO or an ABX action.

Grouping Custom Properties in YAML

————————————-

To group custom properties in your cloud templates, you can use nested objects. For example, you can create a resource object with nested properties, and then group your custom properties within those nested properties. Here is an example of how to group custom properties in a cloud template YAML file:

“`

formatVersion: 1

inputs:

businessUnit:

type: string

title: Business unit

vmNotesEntry:

type: string

title: VM Notes entry

resources:

Cloud_vSphere_Machine:

type: Cloud.vSphere.Machine

allocatePerInstance: true

properties:

cmdbProperties:

– deploymentName: ${env.deploymentName}

deploymentDate: ${env.requestedAt}

requestor: ${env.requestedBy}

businessUnit: ${input.businessUnit}

deploymentProperties:

– vmNotesEntry: ‘${input.vmNotesEntry}’

operatingSystemType: ‘linux’

image: ubuntu

cpuCount: 1

totalMemoryMB: 8192

storage:

constraints:

– tag: storage.profile:gold

networks:

– network: ${resource.Cloud_vSphere_Network.id}

assignment: static

“`

In this example, we have created two groups of custom properties: `cmdbProperties` and `deploymentProperties`. The `cmdbProperties` group contains properties that are used to populate a CMDB, while the `deploymentProperties` group contains properties that are used to configure the deployment.

Conclusion

———-

Grouping custom properties in your cloud templates can help to improve maintenance, readability, and organization. By using nested objects to group your custom properties, you can make it easier to extract values for use in extensibility actions. Standards should not be understated. So go and give your YAML code a spring clean and de-clutter! You will feel much better for it afterwards.

Leave a Reply