Homelab Setup Part 2 - vSAN Configuration
To setup the NUC and install ESXi, follow part one of this guide. The following is the process to bootstrap loading the vCenter Server Appliance onto a vSAN datastore. This process was replaced in vCenter 6.7 which provides this capability natively through the installer. If you are deploying vCenter 6.7+, skip through to part three.
To install vCenter you need the datastore in place, which for my environment is vSAN. However to configure vSAN, this is done through vCenter. A classic chicken and egg scenario which thankfully VMware have the solution for. You can bootstrap the vSAN datastore which William Lam has documented over at virtuallyghetto.com and my configuration steps are below. On the first host, enable SSH and SSH into the host. Modify the default vSAN policy to enable force provisioning.
1esxcli vsan policy setdefault -c vdisk -p "((\"hostFailuresToTolerate\" i1) (\"forceProvisioning\" i1))" 2esxcli vsan policy setdefault -c vmnamespace -p "((\"hostFailuresToTolerate\" i1) (\"forceProvisioning\" i1))"
Confirm the changes were made successfully by running the getdefault command below to confirm the vSAN policy
1~ # esxcli vsan policy getdefault 2Policy Class Policy Value 3------------ -------------------------------------------------------- 4cluster (("hostFailuresToTolerate" i1)) 5vdisk (("hostFailuresToTolerate" i1) ("forceProvisioning" i1)) 6vmnamespace (("hostFailuresToTolerate" i1) ("forceProvisioning" i1)) 7vmswap (("hostFailuresToTolerate" i1) ("forceProvisioning" i1))
Next step is to work out which disks will be used by the vSAN datastore. Run the below command to get the output
Once you have found the 500GB capacity tier SSD and the 256GB cache tier SSD, record the device name ready to be used later. The value will be in brackets under Display Name. For my environment the values are below
1500GB Capacity Tier Device Name 2t10.ATA_____Samsung_SSD_860_EVO_500GB_______________S3Z2NB0K329187Z_____ 3 4256GB Cache Tier Device Name 5t10.NVMe____Samsung_SSD_960_EVO_250GB_______________4301B18154382500
Create a new vSAN cluster with the command below
1esxcli vsan cluster new
Confirm the new vSAN cluster has been created successfully
1esxcli vsan cluster get
Set the 500GB SSD as a capacity tier drive by running the following command and substituting the device name for your environment as recorded earlier
1esxcli vsan storage tag add -d t10.ATA_____Samsung_SSD_860_EVO_500GB_______________S3Z2NB0K329187Z_____ -t capacityFlash
Finally the vSAN all flash disk group is created with the below command to add the two SSDs into the cluster
1esxcli vsan storage add -s t10.NVMe____Samsung_SSD_960_EVO_250GB_______________4301B18154382500 -d t10.ATA_____Samsung_SSD_860_EVO_500GB_______________S3Z2NB0K329187Z_____
To verify the vSAN cluster has been created and the disks have been added, run the below command and check the output
1esxcli vsan storage list
Part 3 of this guide will cover the initial vCenter Server Configuration and is available here.
Note: If you get stuck with vSAN and need to remove all of the partitions, run the commands below to format all of your data and start your homelab from scratch!
1esxcli vsan cluster leave 2reboot 3vdq -q 4partedUtil delete /dev/disks/t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RBNX1JC25558T_____ 1 5partedUtil delete /dev/disks/t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RBNX1JC25558T_____ 2 6partedUtil delete /dev/disks/t10.NVMe____Samsung_SSD_960_EVO_250GB_______________4901B18154382500 1 7partedUtil delete /dev/disks/t10.NVMe____Samsung_SSD_960_EVO_250GB_______________4901B18154382500 2