Before you enable vSphere with Tanzu, create storage policies to be used in the Supervisor Cluster and namespaces. The policies represent datastores available in the vSphere environment. They control the storage placement of such objects as control plane VMs, pod ephemeral disks, container images, and persistent storage volumes. If you use Tanzu Kubernetes clusters, the storage policies also dictate how the Tanzu Kubernetes cluster nodes are deployed.

Depending on your vSphere storage environment and the needs of DevOps, you can create several storage policies to represent different classes of storage. For example, if your vSphere storage environment has three classes of datastores, Bronze, Silver, and Gold, you can create storage policies for all datastores. You can then use the Bronze datastore for ephemeral and container image virtual disks, and use the Silver and Gold datastores for persistent volume virtual disks. For more information about storage policies, see the Storage Policy Based Management chapter in the vSphere Storage documentation.

The following example creates the storage policy for the datastore tagged as Gold.

If you use vSAN Data Persistence platform you can create storage policies for vSAN Direct or vSAN SNA datastores. For information, see Create vSAN Direct Storage Policy and Create vSAN SNA Storage Policy.

Prerequisites

  • Make sure that the datastore you reference in the storage policy is shared between all ESXi hosts in the cluster.
  • Required privileges: VM storage policies. Update and VM storage policies. View.

Procedure

  1. Add tags to the datastore.
    1. Right-click the datastore you want to tag and select Tags and Custom Attributes > Assign Tag.
    2. Click Add Tag and specify the tag's properties.
      Property Description
      Name Specify the name of the datastore tag, for example, Gold.
      Description Add the description of the tag. For example, Datastore for Kubernetes objects.
      Category Select an existing category or create a new category. For example, Storage for Kubernetes.
  2. In the vSphere Client, open the Create VM Storage Policy wizard.
    1. Click Menu > Policies and Profiles.
    2. Under Policies and Profiles, click VM Storage Policies.
    3. Click Create VM Storage Policy.
  3. Enter the policy name and description.
    Option Action
    vCenter Server Select the vCenter Server instance.
    Name Enter the name of the storage policy, for example, goldsp.
    Note: When vSphere with Tanzu converts storage policies that you assign to namespaces into Kubernetes storage classes, it changes all upper case letters into lower case and replaces spaces with dashes (-). To avoid confusion, use lower case and no spaces in the VM storage policy names.
    Description Enter the description of the storage policy.
  4. On the Policy structure page under Datastore specific rules, enable tag-based placement rules.
  5. On the Tag based placement page, create the tag rules.
    Select the options using the following example.
    Option Description
    Tag category From the drop-down menu, select the tag's category, such as Storage for Kubernetes.
    Usage option Select Use storage tagged with.
    Tags Click Browse Tags, and select the datastore tag, for example, Gold.
  6. On the Storage compatibility page, review the list of datastores that match this policy.
    In this example, only the datastore that is tagged as Gold is displayed.
  7. On the Review and finish page, review the storage policy settings and click Finish.

Results

The new storage policy for the datastore tagged as Gold appears on the list of existing storage policies.

What to do next

After creating storage policies, a vSphere administrator can perform the following tasks:
  • Assign the storage policies to the Supervisor Cluster. The storage policies configured on the Supervisor Cluster ensure that the control plane VMs, pod ephemeral disks, and container images are placed on the datastores that the policies represent. See Enable Workload Management with NSX Networking.
  • Assign the storage policies to the vSphere Namespace. Storage policies visible to the namespace determine which datastores the namespace can access and use for persistent volumes. The storage policies appear as matching Kubernetes storage classes in the namespace. They are also propagated to the Tanzu Kubernetes cluster on this namespace. DevOps engineers can use the storage classes in their persistent volume claim specifications. See Create and Configure a vSphere Namespace.