To be able to deploy a stand-alone VM in vSphere with Tanzu, a DevOps engineer must have access to specific VM resources. As a DevOps engineer, verify that you can access these resources and view VM classes and VM templates available in your environment. You can also list storage classes and other items you might need to self-service a VM.

This task covers commands you use to access resources available for a deployment of a stand-alone VM. For information about resources necessary to deploy Tanzu Kubernetes clusters and VMs that make up the clusters, see Virtual Machine Classes for Tanzu Kubernetes Clusters.

Prerequisites

A vSphere administrator has performed these steps:

Procedure

  1. Access your namespace in the Kubernetes environment.
  2. To view VM classes available in your namespace, run the following command.
    kubectl get virtualmachineclassbindings
    You can see the following output.
    Note: Because the best effort VM class type allows resources to be overcommitted, you can run out of resources if you have set limits on the namespace where you are provisioning the VMs. For this reason, use the guaranteed VM class type in the production environment.
    NAME                       VIRTUALMACHINECLASS        AGE
    
    best-effort-large          best-effort-large          44m
    best-effort-medium         best-effort-medium         44m
    best-effort-small          best-effort-small          44m
    best-effort-xsmall         best-effort-xsmall         44m
    custom                     custom                     44m
  3. To view details of a specific VM class, run the following commands.
    • kubectl describe virtualmachineclasses name_vm_class

      If a VM class includes a vGPU device, you can see its profile under spec: hardware: devices: vgpuDevices.

      ......
      spec:
        hardware:
          cpus: 4
          devices:
            vgpuDevices:
            - profileName: grid_v100-q4
      ......
      
    • kubectl get virtualmachineclasses -o wide

      If the VM class includes a vGPU or a passthrough device, the output shows it in the VGPUDevicesProfileNames or PassthroughDeviceIDs column.

  4. View the VM images.
    kubectl get virtualmachineimages​
    The output you see is similar to the following.
    NAME                                              VERSION  OSTYPE                FORMAT  IMAGESUPPORTED  AGE
    centos-stream-8-vmservice-v1alpha1-xxxxxxxxxxxxx           centos8_64Guest       ovf     true            4d3h
  5. To describe a specific image, use the following command.
    kubectl describe virtualmachineimage/centos-stream-8-vmservice-v1alpha1-xxxxxxxxxxxxx

    VMs with vGPU devices require images that have boot mode set to EFI, such as CentOS. Make sure to have access to these images. For information about supported images, search for VM Service image on the VMware Cloud Marketplace web site.

  6. Verify that you can access storage classes.
    kubectl get resourcequotas
    NAME                        AGE   REQUEST                                                                                         LIMIT
    my-ns-ubuntu-storagequota   24h   wcpglobal-storage-profile.storageclass.storage.k8s.io/requests.storage: 0/9223372036854775807
  7. If you are using vSphere Distributed Switch for your workload networking, obtain the name of the network.
    Note: You use this information to specify the networkName parameter in the VM YAML file when the networkType is vsphere-distributed. You do not need to obtain and specify the network name if you use VMware NSX-T.
    kubectl get network
    NAME      AGE
    primary   7d2h

What to do next

You can now deploy VMs. See Deploy a Virtual Machine in vSphere with Tanzu.