To be able to self-service VMs in vSphere IaaS control plane, 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 IaaS control plane 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 TKG clusters.
Create a Custom VM Class Using the vSphere Client
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
What to do next
Edit a VM Class Using the vSphere Client
Checkout how to edit a VM class after its creation. You can configure hardware resources such as CPU, memory, and devices as well as edit VM options and advanced parameters. You can also edit default VM classes that vSphere IaaS control plane offers.
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
Associate a VM Class with a Namespace Using the vSphere Client
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 TKG 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 TKG 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 TKG 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 TKG clusters.
Manage VM Classes on a Namespace Using the vSphere Client
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 TKG. Removing it can affect operations TKG.
- 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.