How to configure All-Flash vSAN from command line

How to configure All-Flash vSAN from command line - logo

In my previous post https://www.wojcieh.net/my-new-home-lab/ I showed you my new homelab. It was configured having in mind single node vSAN to leverage caching for I/O. Today I will show you how to configure all-flash vSAN from command line.

  1. To configure single node all-flash vSAN we first must identify the disks we will use.
  2. Login to ESXi via SSH and execute command vdq -q. This command will list all available disks to be used.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[root@ESXi:~] vdq -q
[
  {
      "Name"     : "t10.NVMe____WDC_WDS256G1X0C2D00ENX0__________________B10A464                                                                                                                                                             44A441B00",
      "VSANUUID" : "522288b0-d99b-a8f8-6dd5-44b7ef7354e4",
      "State"    : "In-use for VSAN",
      "Reason"   : "None",
      "IsSSD"    : "1",
"IsCapacityFlash": "0",
      "IsPDL"    : "0",
  },

  {
      "Name"     : "t10.ATA_____DeLOCK_54659_32GB_______________________20170502                                                                                                                                                             AA9241826001",
      "VSANUUID" : "",
      "State"    : "Ineligible for use by VSAN",
      "Reason"   : "Has partitions",
      "IsSSD"    : "1",
"IsCapacityFlash": "0",
      "IsPDL"    : "0",
  },

  {
      "Name"     : "t10.ATA_____Crucial_CT2050MX300SSD1_________________________                                                                                                                                                             1651150F2144",
      "VSANUUID" : "52c93db2-c879-ce09-ea2a-664a0ae10485",
      "State"    : "In-use for VSAN",
      "Reason"   : "None",
      "IsSSD"    : "1",
"IsCapacityFlash": "1",
      "IsPDL"    : "0",
  },
]
  • In my case I’ve got two disks - 256GB NVME which will be used as flash tier and 2TB SSD as a capacity tier.
  • Once we identified our disks we must tag the 2TB disk as a capacity disk
    1
    
    esxcli vsan storage tag add -t capacityFlash -d t10.ATA_____Crucial_CT2050MX300SSD1_________________________1651150F2144
    
  • In the next step we will add 256GB NVME disk as a flash device.
    1
    
    esxcli vsan storage add -s t10.NVMe____WDC_WDS256G1X0C2D00ENX0__________________B10A46444A441B00 -d t10.ATA_____Crucial_CT2050MX300SSD1_________________________1651150F2144
    
  • In the next step, we will create vSAN Cluster.
    1
    
    esxcli vsan cluster new
    
  • Once vSAN Cluster is enabled we must change default vSAN policies to allow us to deploy virtual machines.
    1
    2
    3
    4
    5
    
    esxcli vsan policy setdefault -c cluster -p "((\"hostFailuresToTolerate\" i0) (\"forceProvisioning\" i1))"
    esxcli vsan policy setdefault -c vdisk -p "((\"hostFailuresToTolerate\" i0) (\"forceProvisioning\" i1))"
    esxcli vsan policy setdefault -c vmnamespace -p "((\"hostFailuresToTolerate\" i0) (\"forceProvisioning\" i1))"
    esxcli vsan policy setdefault -c vmswap -p "((\"hostFailuresToTolerate\" i0) (\"forceProvisioning\" i1))"
    esxcli vsan policy setdefault -c vmem -p "((\"hostFailuresToTolerate\" i0) (\"forceProvisioning\" i1))"
    
  • Now we can deploy virtual machines.

References:

All rights reserved © Wojciech Marusiak
Last updated on 05 Oct, 2017 07:00 ETC
Built with Hugo
Theme Stack designed by Jimmy