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
- 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.
Procedure
What to do next
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
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:
Procedure
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.
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-storageapiVersion: 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.