You can create vSAN disk groups on standalone hosts and add the hosts to a vSAN-enabled cluster to form a vSAN datastore. You can then create a virtual machine on the vSAN datastore and assign a storage policy to the virtual machine and its hard disk.

Prerequisites

  • Verify that you are connected to a vCenter Server system.
  • Verify that you have access to at least three virtual machine hosts.
  • Verify that each of the virtual machine hosts has at least one SSD and one HDD.
  • Verify that the virtual machine hosts are in maintenance mode.

Procedure

  1. Create a vSAN enabled cluster with manual disk claim mode.
    $vsanCluster = New-Cluster -Name 'VsanCluster' -Location (Get-Datacenter) -VsanEnabled -VsanDiskClaimMode 'Manual'
  2. Configure a vSAN VMkernel port on each of the three hosts.
    New-VMHostNetworkAdapter -VMHost 'Host-A' -PortGroup 'VMkernel' -VirtualSwitch 'vSwitch0' -VsanTrafficEnabled $true
    New-VMHostNetworkAdapter -VMHost 'Host-B' -PortGroup 'VMkernel' -VirtualSwitch 'vSwitch0' -VsanTrafficEnabled $true
    New-VMHostNetworkAdapter -VMHost 'Host-C' -PortGroup 'VMkernel' -VirtualSwitch 'vSwitch0' -VsanTrafficEnabled $true
  3. Create a vSAN disk group on each of the three hosts.
    New-VsanDiskGroup -DataDiskCanonicalName 'HDD1-CanonicalName' -SsdCanonicalName 'SSD1-CanonicalName' -VMHost 'Host-A'
    New-VsanDiskGroup -DataDiskCanonicalName 'HDD1-CanonicalName' -SsdCanonicalName 'SSD1-CanonicalName' -VMHost 'Host-B'
    New-VsanDiskGroup -DataDiskCanonicalName 'HDD1-CanonicalName' -SsdCanonicalName 'SSD1-CanonicalName' -VMHost 'Host-C'
  4. Add each of the three hosts to the vSAN cluster to create a vSAN datastore.
    Move-VMHost -VMHost 'Host-A' -Destination $vsanCluster
    Move-VMHost -VMHost 'Host-B' -Destination $vsanCluster
    Move-VMHost -VMHost 'Host-C' -Destination $vsanCluster
  5. Revert the virtual machine hosts to the Connected state.
    Set-VMHost -VMHost 'Host-A','Host-B','Host-C' -State 'Connected'
  6. Create a virtual machine on the vSAN datastore.
    $vsanDS = Get-Datastore -Name 'vsanDatastore'
    $vm = New-VM -Name 'newVM' -DiskMB 1024 -Datastore $vsanDS -VMHost 'Host-A'
  7. Create a storage policy by using any of the vSAN capabilities.
    $cap = Get-SpbmCapability -Name vSAN*
    $rule = New-SpbmRule $cap[1] $true
    $ruleset = New-SpbmRuleSet $rule
    $policy = New-SpbmStoragePolicy -Name 'vsan policy' -RuleSet $ruleset -Description 'vSAN-based storage policy'
  8. Assign the storage policy to the virtual machine and its hard disk.
    $vmHdd = Get-HardDisk -VM $vm
    Set-SpbmEntityConfiguration $vm, $vmHdd -StoragePolicy $policy
  9. Check the compliance of the virtual machine and its hard disk with the storage policy.
    Get-SpbmEntityConfiguration $vm, $vmHdd
    The status should be Compliant.