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. This storage is typically located on high-speed devices, such as NVMe, that are local to the ESXi host.

Instance Storage Lifecycle

At the VM creation, the system creates instance storage volumes and attaches them to the VM. Data in the instance storage volume persists only during the lifetime of its associated VM instance. The volume is deleted when the VM is deleted.

VMs with instance storage support ESXi host maintenance mode. The VM is turned off when the ESXi host enters maintenance mode and is turned on after the host exits maintenance mode.

Instance Storage VM Considerations

Consider the following items when you use VMs with instance storage:
  • Supervisor with a VDS networking stack does not support instance storage.
  • Three-zone Supervisor does not support instance storage.
  • A warning appears if a vSphere administrator applies a VM class with instance storage to a namespace that misses an appropriate storage policy required for the instance storage.
  • VMs with instance volumes cannot migrate to other ESXi hosts.
  • You cannot edit the instance storage volumes when the volumes are already in use.
  • If the vSphere administrator removes the instance storage policy from the namespace after the VM creation, the VM continues to run.
  • As the DevOps engineer, you cannot delete or update instance storage resources. You cannot detach the instance storage volume from one VM instance and attach it to a different instance.

Workflow for Provisioning and Monitoring an Instance Storage VM

Step Performed by Description
1 vSphere administrator Create content libraries and assign them to the namespace you use for the VM.
2 vSphere administrator Create a vSAN Direct datastore.
3 vSphere administrator Create a storage policy compatible with vSAN Direct and assign it to the namespace.
4 vSphere administrator Create an instance storage VM class and assign it to the namespace.
5 DevOps engineer Provision a VM with instance storage in the namespace.
6 vSphere administrator Monitor deployed VMs.

Create a vSAN Direct Datastore

As a vSphere administrator, set up a vSAN Direct datastore to be used with such functionality as vSAN Data Persistence platform or VM instance storage. To create the datastore, use unclaimed storage devices local to your ESXi host.

You can create the vSAN Direct datastore when enabling vSAN for your Supervisor. The following task shows how to claim local storage devices as vSAN Direct when vSAN is already enabled on the cluster.

Procedure

  1. In the vSphere Client, navigate to the vSAN cluster.
  2. Click the Configure tab.
  3. Under vSAN, click Disk Management.
  4. Click Claim Unused Disks.
  5. On the Claim Unused Disks dialog box, click the vSAN Direct tab.
  6. Select a device to claim and select a check box in the Claim for vSAN Direct column.
    Note: If you claimed the devices for a regular vSAN datastore, these devices do not appear in the vSAN Direct tab.
    Claim unused disks by selecting a check box in the Claim for vSAN Direct column
  7. Click Create.
    For each device you claim, vSAN Direct creates a new datastore.
  8. Click the Datastores tab to display all vSAN Direct datastores in your cluster.
    vSAN Direct datastore appears on the list

What to do next

You can use vSAN Direct with external storage. For more information, see Use External Storage with vSAN Direct in the Maintaining vSphere IaaS Control Plane documentation.

Create vSAN Direct Storage Policy

If you use vSAN Direct, create a storage policy to be used with a Supervisor namespace. On the namespace that you associate with this storage policy, you can run workloads compatible with vSAN Direct, for example, stateful services or instance storage VMs.

Procedure

  1. In the vSphere Client, open the Create VM Storage Policy wizard.
    1. In the Home menu, click Policies and Profiles.
    2. Under Policies and Profiles, click VM Storage Policies.
    3. Click Create.
  2. Enter the policy name and description.
    Option Action
    vCenter Server Select the vCenter instance.
    Name Enter the name of the storage policy.
    Description Enter the description of the storage policy.
  3. On the Policy structure page under Datastore specific rules, enable rules for vSAN Direct storage placement.
  4. On the vSAN Direct rules page, specify vSAN Direct as a storage placement type.
  5. On the Storage compatibility page, review the list of vSAN Direct datastores that match this policy.
  6. On the Review and finish page, review the storage policy settings and click Finish.
    To change any settings, click Back to go to the relevant page.

Create a VM Class with Instance Storage

In the VM class, you reference the vSAN Direct storage policy and set the size of the volumes to be used for instance storage. After you create the VM class, assign it to the namespace that you plan to use for the instance storage VM.

Prerequisites

  • Create a storage policy compatible with the vSAN Direct datastore.
  • Add the vSAN Direct storage policy to the namespace you use for the instance storage VM. See Create and Configure a vSphere Namespace on the Supervisor.
  • Required privileges:
    • Namespaces.Modify cluster-wide configuration
    • Namespaces.Modify namespace configuration
    • Virtual Machine Classes.Manage Virtual Machine Classes

Procedure

  1. Add instance storage when you create or edit a VM class.
    Option Action
    Create a VM class
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Services tab and click Manage on the VM Service card.
    3. On the VM Service page, click Create VM Class.
    4. Configure the VM Class as needed, see Edit a VM Class Using the vSphere Client for the available options.
    5. To add instance storage, on the Configuration page, select Virtual Hardware then select Add New Device > Instance Storage.

      The Instance Storage option appears in Virtual Hardware.

    Edit an existing VM class
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Services tab and click Manage on the VM Service pane.
    3. On the VM Service page, click VM Classes.
    4. In the existing VM class card, click Manage and click Edit.
    5. To add instance storage, select Virtual Hardware then select Add New Device > Instance Storage.

      The Instance Storage option appears in Virtual Hardware.

  2. Expand the Instance Storage option to edit the instance storage settings.
    Option Action
    Storage Policy Select the vSAN Direct storage policy.
    Volume Specify the size of the volume. You can add multiple storage volumes.
  3. On the Review and Confirm page, review the details and click Finish.

    The Review and Confirm page shows details of the instance storage volume.
  4. Assign the VM class you created to the namespace you use for the instance storage VM.

Deploy a VM with Instance Storage

As a DevOps engineer, verify that you can access VM resources necessary to create an instance storage VM. Use the resources to deploy the VM.

When you deploy the instance storage VM, you follow general VM deployment steps. See Deploying a Stand-Alone VM in vSphere IaaS Control Plane. This procedure covers additional specific items that apply to the instance storage VM.

Procedure

  • Verify the following items specific to the instance storage VM:
    • Your namespace includes the storage class compatible with the vSAN Direct datastore.
    • The instance storage VM class references this storage class.

      When reviewing details of the instance storage VM class, make sure that it includes the instanceStorage section.

      kubectl describe virtualmachineclasses vm-class-instance-storage
      apiVersion: vmoperator.vmware.com/v1alpha2
      kind: VirtualMachineClass
      metadata:
        name: vm-class-instance-storage
      spec:
        hardware:
          cpus: 8
          memory: 64Gi
          devices:
      ...
          instanceStorage:
            storageClass: vsan-direct
            volumes:
            - size: 256Gi
            - size: 512Gi
       
      ...
    • The VM YAML file points to the appropriate instance storage VM class.