Mastering vSphere Namespaces

Extending vSphere Namespaces with Aria Automation: Customization and Limits

In a previous post, we explored how to create vSphere namespaces with Aria Automation and utilize the vCenter API for extensibility. In this follow-up post, we’ll dive deeper into the additional properties we can use in Aria Automation and how to set limits for our namespaces.

Additional Properties in Aria Automation

————————————–

When creating a Cloud Template with Aria Automation, we can include additional properties to customize our vSphere namespaces. For example, we can specify which VM classes should be available for the namespaces we create. To do this, we can add the `vmClass` property in the YAML file.

“`yaml

resources:

– type: SupervisorNamespace

name: my-namespace

vmClass:

– Linux

– Windows

“`

This will ensure that only VMs with Linux or Windows operating systems can be created in this namespace.

We can also add a storage profile to our Cloud Template by setting a constraint for the storage profile matching a capability tag in a Storage Profile. This is done by adding the `storageProfile` property in the YAML file.

“`yaml

resources:

– type: SupervisorNamespace

name: my-namespace

vmClass:

– Linux

– Windows

storageProfile: tkgs-ftt0

“`

This will ensure that only VMs with the `tkgs-ftt0` storage profile can be created in this namespace.

Adding Limits to Our Namespaces

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

In addition to customizing our namespaces, we can also set limits for our resources. For example, we can set a limit on the number of CPU cores or memory that can be allocated to VMs in our namespace. To do this, we can add the `limits` property in the YAML file.

“`yaml

resources:

– type: SupervisorNamespace

name: my-namespace

vmClass:

– Linux

– Windows

storageProfile: tkgs-ftt0

limits:

cpu: 4

memory: 8192

“`

This will ensure that no more than 4 CPU cores and 8192 MB of memory can be allocated to VMs in this namespace.

Hardcoding Limits for Testing

—————————–

For testing purposes, we can hardcode some limits in the YAML file. For example, we can set a limit of 0 for CPU cores and memory to effectively have unlimited resources. However, 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 error:

“`

Failed to create namespace: Invalid limit value: ‘0’

“`

On the other hand, the memory limit works with 0.

Verifying Our Namespace Settings

———————————–

After deploying our Cloud Template, we can verify that our namespace settings have been applied correctly. We can use the vSphere API to retrieve the namespace and check its properties. For example, we can use the `Get-Namespace` cmdlet in PowerCLI to retrieve the namespace and check its limits.

“`powershell

$namespace = Get-Namespace -Name “my-namespace”

Write-Host $namespace.limits.cpu

Write-Host $namespace.limits.memory

“`

This will output the CPU and memory limits that we set for our namespace.

Conclusion

———-

In this post, we explored some of the built-in capabilities of the Aria Automation integration with vSphere with Tanzu when it comes to creating vSphere namespaces. We showed how to use additional properties in Aria Automation to customize our namespaces and set limits for our resources. We also discussed some shortcomings when dealing with permissions and hinted at a possible solution using extensibility. Stay tuned for our next post where we’ll dive deeper into this topic.

Copyright © 2017-2023 Rudimar Tinsens. All rights reserved.