As a vSphere administrator, create custom VM classes to be used for a VM deployment in a namespace in vSphere with Tanzu. Custom VM classes can be used by stand-alone VMs that run in namespaces and by VMs hosting a Tanzu Kubernetes cluster.
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. You can use them as is, edit, or delete them.
- 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.
- Go to the VM Service page.
- From the vSphere Client home menu, select Workload Management.
- Click the Services tab and click Manage on the VM Service pane.
- On the VM Service page, click VM Classes and click Create VM Class.
- On the Configuration page, specify the general VM class attributes.
VM Class Attribute Description Name Identifies the VM class. Enter a unique DNS compliant name that follows these requirements:
- Use a unique name that does not duplicate the names of default or custom VM classes in your environment.
- Use alphanumeric string with maximum length of 63 characters.
- Do not use uppercase letters or spaces.
- Use a dash anywhere except as a first or last character. For example, vm-class1.
vCPU Count Defines the number of virtual CPUs (vCPUs) for a VM. This is a VM hardware configuration. When a DevOps user assigns the VM class to a VM, this count becomes the configured number of vCPUs for the VM. CPU Resource Reservation Optional parameter. Specifies the guaranteed minimum CPU resource allocation for a virtual machine. This value is expressed in percentage (%). Value of 0 % defines no CPU reservation.
The percentage you enter is multiplied by the minimum CPU available among all the cluster nodes. The resulting value, in MHz, specifies the amount of CPU resources that vSphere guarantees for a VM.
Memory Defines the memory configured for a VM in MB, GB, or TB. This is a VM hardware configuration. When a DevOps user assigns the VM class policy to a VM, the VM receives the amount of memory defined by this attribute.
The value must be between 4 MB and 24 TB and a multiple of 4 MB.
Memory Resource Reservation Optional parameter. Defines the reserved amount of memory that is configured for a VM. The value of the attribute ranges between 0 and 100%.
If you add PCI devices to the VM class configuration, set the parameter to 100%.
- (Optional) To add PCI devices, on the Configuration page, select Yes from the PCI Devices drop-down menu and click Next.
If you select this option, the memory resource reservation value automatically changes to 100%.For requirements and additional details, see Add PCI Devices to a VM Class in vSphere with Tanzu.
- On the Review and Confirm page, review the details and click Finish.
What to do next
After you create a VM class, you can edit its parameters or delete it from your environment. See Edit or Delete a VM Class in vSphere with Tanzu.
To make the VM class available to DevOps engineers, associate it with a namespace. The association of the VM class occurs on a per namespace level. See Associate a VM Class with a Namespace in vSphere with Tanzu.