Creating vSphere Namespaces in Aria Automation revisited

In a previous post we took a look at how to create vSphere namespaces with vRealize Aria Automation, and how to utilize the vCenter API to create extensibility around it to get more customization.

Now we'll take a closer look at what we can do in Aria Automation.

We have a Cloud Template that includes a Supervisor Namespace already so we'll see the additional properties we can make use of

Cloud Template properties

We'll start out by adding which VM Classes that should be available for the namespaces we create to the yaml

1vm_classes:
2  - name: best-effort-medium
3  - name: best-effort-small
4  - name: best-effort-xsmall

We'll also add the Storage Profile we've been working with so far, the tkgs-ftt0 profile. This is done by setting a constraint for the storage profile matching a capability tag in a Storage Profile

1storage:
2  - profile:
3      constraints:
4        - tag: storage:ftt0

Storage Profile

And finally we will hard code some limits just to test

1limits:
2  cpu_limit: 20
3  memory_limit: 100

Note that when we add in the cpu limit here we cannot set them to 0 to effectively have "unlimited" resources. While the vSphere namespaces can have 0 in limit, the vRA integration fails with the following Limit error Interestingly, the memory limit works with 0..

The yaml schema is ready for testing.

 1formatVersion: 1
 2inputs:
 3  name:
 4    type: string
 5    title: Namespace name
 6resources:
 7  Cloud_SV_Namespace_1:
 8    type: Cloud.SV.Namespace
 9    properties:
10      name: ${input.name}
11      limits:
12        cpu_limit: 20
13        memory_limit: 100
14      storage:
15        - profile:
16            constraints:
17              - tag: storage:ftt0
18      vm_classes:
19        - name: best-effort-medium
20        - name: best-effort-small
21        - name: best-effort-xsmall
22

Deploy Cloud Template

And after the deployment finishes we can verify that the namespace is created with our selected properties

vSphere namespace created

Verify VM classes

Nice. Let's change this up so that the limits can be set as a user input

We'll set the minimum and maximums for the limits, and tie them up in the Supervisor Namespace resource in the Cloud Template

 1formatVersion: 1
 2inputs:
 3  name:
 4    type: string
 5    title: Namespace name
 6  cpuLimit:
 7    type: number
 8    title: CPU Limit (MHz)
 9    minimum: 10
10    maximum: 4000
11  memLimit:
12    type: number
13    title: Memory limit (GB)
14    minimum: 0
15    maximum: 1024
16resources:
17  Cloud_SV_Namespace_1:
18    type: Cloud.SV.Namespace
19    properties:
20      name: ${input.name}
21      limits:
22        cpu_limit: ${input.cpuLimit}
23        memory_limit: ${input.memLimit * 1024}
24      storage:
25        - profile:
26            constraints:
27              - tag: storage:ftt0
28      vm_classes:
29        - name: best-effort-medium
30        - name: best-effort-small
31        - name: best-effort-xsmall

Deploy with limits from user inputs

After deploying this let's check again that our limits are set

vSphere namespace with limits set from user inputs

Summary

This post has explored some of the built-in capabilities of the Aria Automation integration with vSphere with Tanzu when it comes to creating vSphere namespaces. There are a more properties that can be set, but hopefully you get the idea on how to use it.

Still there are some shortcomings when dealing with permissions. We worked with permissions in an earlier post through Aria Orchestrator, and in an upcoming post we'll see if we can make use of extensibility to add this to our current setup as well

This page was modified on February 18, 2023: Added links