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 Tanzu Kubernetes Grid 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.

When you create new classes, keep in mind the following considerations.
  • VM classes that you create in a vCenter instance are available to all vCenter clusters and all namespaces in these clusters.
  • VM classes are available to all namespaces in vCenter. However, DevOps engineers can use only those VM classes that you associate with a particular namespace.
Note: You can also create VM classes using the DCLI command. See Create and Manage VM Classes Using the Data Center CLI.

Prerequisites

Required privileges:
  • Namespaces.Modify cluster-wide configuration
  • Namespaces.Modify namespace configuration
  • Virtual Machine Classes.Manage Virtual Machine Classes

Procedure

  1. Go to the VM Service page.
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Services tab and click Manage on the VM Service pane.
  2. On the VM Service page, click VM Classes and click Create VM Class.
  3. On the Name page, specify the VM class name and click Next.
    The VM class 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.
    After you create the VM class, you cannot change its name.
  4. On the Compatibility page, select the VM class hardware compatibility and click Next.
    For more information, see Virtual Machine Compatibility for more information.
    Note: You can only set the hardware compability of a VM class during its creaiton and you cannot change it later.
  5. On the Configuration page, leave the defaults.
  6. On the Review and Confirm page, review the details and click Finish.

What to do next

Edit the VM class configuration such as VM hardware and VM options.

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.

Editing a VM class does not result in automatic reconfiguring of the VMs that were previously deployed from this class. For example, if a DevOps user created a Tanzu Kubernetes Grid cluster with the VM class and you later change the VM class definition, existing Tanzu Kubernetes Grid VMs remain unaffected. New Tanzu Kubernetes Grid VMs will use the modified class definition.
Caution: If you scale out a Tanzu Kubernetes Grid cluster after editing a VM class used by that cluster, new cluster nodes use the updated class definition, but existing cluster nodes continue to use the initial class definition, resulting in a mismatch. Both control plane and worker nodes can be scaled. For information about scaling, see Scale a Workload Cluster in the Using TKG Service with vSphere IaaS Control Plane.

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

Required privileges:
  • Namespaces.Modify cluster-wide configuration
  • Namespaces.Modify namespace configuration
  • Virtual Machine Classes.Manage Virtual Machine Classes

Procedure

  1. In the vSphere Client, display available VM classes.
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Services tab and click the VM Service pane.
    3. On the VM Service page, click VM Classes.
      All default or user-created VM classes appear under Available VM Classes.
  2. In the selected VM class pane, click Manage and click Edit.
  3. In the Virtual Hardware page, configure the hardware resources of the VM class, such as memory, CPU, and different devices.
    All the VM hardware settings are applied when a DevOps user assigns the VM class to a VM. For example, the CPU configuration values become the CPU resources dedicated to all the VMs that DevOps user creates by using the VM class.
    Note: Starting from vSphere 8.0 Update 2b, the wizard for creating and editing VM classes changes from setting CPU and memory resources in percentages to numeric values in MB, GB, TB, and HMz. For all previously created VM classes you will see the CPU and memory in percentages, but now you can edit these values in the new numeric formats.
    VM Configuration Option Description
    CPU Define the CPU resources dedicated to the VM. For more information on configuring CPU resources, see Virtual CPU Configuration and Limitations and Configure CPU Resources of a Virtual Machine.
    Memory Define the memory configured for a VM in MB, GB, or TB. For more information on VM memory resources, see Virtual Memory Configuration.
    Video Card Configure 3D graphics to take advantage of Windows AERO, CAD, Google Earth, and other 3D design, modeling, and multimedia applications. For more information on the video card setting, see How do I Configure 3D Graphics.
    Security Devices Provide additional security to the VM class by configuring ® Software Guard Extensions (vSGX). See Securing Virtual Machines with Intel Software Guard Extensions.
  4. In the Virtual Hardwareoption, click Add New Device to add and configure devices to the VM class.
    You configure different devices to the VM class, such as storage controllers, network adapters, USB, and PCI devices.
    VM Configuration Option Description
    RDM Disk Add a raw device mapping (RDM) to store virtual machine data directly on a SAN LUN, instead of storing it in a virtual disk file. See Add an RDM Disk to a Virtual Machine.
    Host USB Device Add one or more USB passthrough devices from an ESXi host to a virtual machine if the physical devices are connected to the host on which the virtual machine runs. See Add USB Devices from an ESXi Host to a Virtual Machine.
    NVDIMM Configure a virtual NVDIMM device to the VM class to enable it to use non-volatile, or persistent, computer memory. See Add an NVDIMM Device to a Virtual Machine.
    CD/DVD Drive Configure a CD/DVD device to the VM class. See How do I Add or Modify a Virtual Machine CD or DVD Drive.
    NVMe Controller, SATA Controller, SCSI Controller Configure storage controllers to the VM class. See SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility.
    USB Controller Add a USB controller to the VM class to support USB passthrough from an ESXi host or from a client compute. See Add a USB Controller to a Virtual Machine.
    PCI Device Configure VMs to use the NVIDIA GRID virtual GPU (vGPU) technology, if ESXi hosts in your vSphere IaaS control plane environment have one or more NVIDIA GRID GPU graphics devices. You can also configure other PCI devices on an ESXi host to make them available to a VM in a passthrough mode.

    If you select this option, the memory resource reservation value automatically changes to 100%.

    For more information and additional requirements, see Deploying a VM with PCI Devices in vSphere IaaS Control Plane.
    Watchdog Timer Add a virtual Watchdog Timer (VWDT) device to ensure self-reliance related to the system performance within a virtual machine. See How do I Add a Virtual Watchdog Timer Device to a Virtual Machine.
    Precision Clock Add a precision clock device to the VM. A precision clock is a virtual clock device that provides a virtual machine with access to the system time of the primary ESXi host. See How do I Add a Precision Clock Device to a Virtual Machine.
    Serial Port Configure a connection of the virtual serial port to a physical serial port or to a file on the host computer. See Change the Serial Port Configuration.
    Instance Storage Configure instance storage to the VM. Along with persistent storage volumes, a VM can use instance storage. Unlike persistent volumes that exist separately from the VM, instance storage volumes depend on the lifecycle of a VM instance.

    Using the Instance Storage option, you can add appropriate storage policies and configure volumes to be used with the VM.

    For additional requirements, see Deploying a VM with Instance Storage in vSphere IaaS Control Plane.

    Network Adapter Configure a network adapter to the VM class. When the DevOps user deploys a VM by using the VM class, she can specify a workload network to the adapter. The workload network must be configured to the vSphere Namespace where the VM runs. For more information on the supported adapter types, see Network Adapter Basics.
  5. On the VM Options page, set or change VM options to run VMware Tools scripts, control user access to the remote console, configure startup behavior, and more.
    For more information the VM options that you can configure to the VM class, see Configuring Virtual Machine Options.
  6. On the Advanced Parameters page, change or add VM configuration parameters when instructed by a VMware technical support representative, or if you see VMware documentation that instructs you to add or change a parameter to fix a problem with your system.
    For more information the VM advanced parameters, see Configure Virtual Machine Advanced File Parameters.
  7. Once you are ready with editing the VM class, review and confirm your changes and click Finish.

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 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.

Note:

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

Required privileges:
  • Namespaces.Modify cluster-wide configuration
  • Namespaces.Modify namespace configuration
  • Virtual Machine Classes.Manage Virtual Machine Classes

Procedure

  1. In the vSphere Client, go to the namespace.
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Namespaces tab and click the namespace.
  2. Add a VM class.
    1. On the VM Service pane, click Add VM Class.
    2. 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 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 Tanzu Kubernetes Grid. Removing it can affect operations Tanzu Kubernetes Grid.
  • Required privileges:
    • Namespaces.Modify cluster-wide configuration
    • Namespaces.Modify namespace configuration
    • Virtual Machine Classes.Manage Virtual Machine Classes

Procedure

  1. In the vSphere Client, go to the namespace.
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Namespaces tab and click the namespace.
  2. Add or remove a VM class.
    1. On the VM Service pane, click Manage VM Class.
    2. 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.