To be able to self-service VMs in vSphere with Tanzu, DevOps users must have access to VM classes. A VM class is a template that defines CPU, memory, and reservations for VMs. The VM class helps to set guardrails for the policy and governance of VMs by anticipating development needs and accounting for resource availability and constraints.
vSphere with Tanzu offers several default VM classes. A vSphere administrator can use them as is or create custom VM classes. To make the classes available to the DevOps users, the vSphere administrator adds them to a namespace. The VM classes assigned to the namespace can be used by stand-alone VMs and by the VMs that make up Tanzu Kubernetes Grid clusters.
Create a Custom VM Class in vSphere with Tanzu
As a vSphere administrator, you can use available default classes. You can also create custom VM classes instead of the default and use them for VM deployment in a namespace.
- VM classes that you create in a vCenter Server instance are available to all vCenter Server clusters and all namespaces in these clusters.
- VM classes are available to all namespaces in vCenter Server. However, DevOps engineers can use only those VM classes that you associate with a particular namespace.
Prerequisites
Procedure
Edit or Delete a VM Class in vSphere with Tanzu
After you create a VM class, you can edit its parameters. You can also edit default VM classes that vSphere with Tanzu offers. If you no longer need an existing VM class, you can delete it from your environment.
When you delete a VM class, it is removed from all associated namespaces. DevOps users can no longer self-service VMs using this VM class. VMs that have already been created with this VM class are not affected.
Prerequisites
Procedure
- In the vSphere Client, display available VM classes.
- From the vSphere Client home menu, select Workload Management.
- Click the Services tab and click the VM Service pane.
- On the VM Service page, click VM Classes.
All default or user-created VM classes appear under Available VM Classes.
- Edit or delete an existing VM class.
Option Description Edit a VM class - In the selected VM class pane, click Manage and click Edit.
- Modify the VM class parameters.
Note: You cannot change the name of the VM class.
Delete a VM class - In the selected VM class pane, click Manage and click Delete.
- Confirm that you want to delete the VM class.
Associate a VM Class with a Namespace in vSphere with Tanzu
As a vSphere administrator, add a default or custom VM class to one or more namespaces on a Supervisor. When you add a VM class to a namespace, you make the class available to DevOps users, so that they can start self-servicing VMs in the Kubernetes namespace environment. The VM classes you assign to the namespace are also used by the VMs that make up Tanzu Kubernetes Grid clusters.
You can add multiple VM classes to a single namespace. Different VM classes serve as indicators of different levels of service. If you publish multiple VM classes, DevOps users can select between all custom and default classes when creating and managing virtual machines in the namespace.
To be able to deploy a Tanzu Kubernetes Grid cluster in a newly created namespace, DevOps engineers need to have access to VM classes. As a vSphere administrator, you must explicitly associate default or custom VM classes to any new namespace where the Tanzu Kubernetes Grid cluster is deployed.
Prerequisites
Procedure
- In the vSphere Client, go to the namespace.
- From the vSphere Client home menu, select Workload Management.
- Click the Namespaces tab and click the namespace.
- Add a VM class.
- On the VM Service pane, click Add VM Class.
- Select one or several VM classes and click OK.
Results
The VM classes you added become available in the namespace for the DevOps to self-service VMs. These classes can also be used by the VMs that make up Tanzu Kubernetes Grid clusters.
Manage VM Classes on a Namespace in vSphere with Tanzu
After you associate a VM class with a namespace, you can add more VM classes or remove the class to unpublish it from the Kubernetes namespace.
Prerequisites
- If you want to remove a VM class from a namespace, verify that it is not used by Tanzu Kubernetes Grid. Removing it can affect operations Tanzu Kubernetes Grid.
- Required privileges:
Procedure
- In the vSphere Client, go to the namespace.
- From the vSphere Client home menu, select Workload Management.
- Click the Namespaces tab and click the namespace.
- Add or remove a VM class.
- On the VM Service pane, click Manage VM Class.
- Perform one of the following operations.
Option Description Remove a VM class Deselect the VM class and click OK. Add a VM class Select one or several VM classes and click OK.