Automating two-node vSAN cluster setup

In a previous post I described how we are setting up remote offices for a customer with two-node vSAN clusters. I meant to get this post out right after that previous one, but things happened... Anyways, here's how we automated those two-node vSAN clusters.

Currently we have 7 of these racks ready with more to come. As these will be installed at distant locations we are extra keen on knowing that they are all configured as they should, and that the configuration is the same cross these multiple locations.

Of course, this calls for automation. And with our favorite automation tool PowerCLI we have put together a script to do the vSAN configuration for us.

The script is built for a two-node vSAN setup with a witness appliance and is built specifically for the setup described in the previous post. Hopefully it can have some value for others anyway.

I have been using Jase McCarty's post on the same topic, as well as William Lam's many vSAN posts, as guidance for my script. A big shout out to them for sharing their stuff.

The script requires three ESXi hosts installed and accessible, the first two will be the vSAN hosts while the third will be hosting the virtual witness appliance. In our setup the two vSAN hosts has a total of 6 disks and the witness host has two disk arrays pre-configured. Furthermore we will only use standard vSwitches in this setup.

So, in a few words this is what will happen:

  • A new cluster will be created
  • The three hosts will added to vCenter (in our setup we are adding the witness host to a different location than the vSAN hosts)
  • Configure network for the three hosts
  • Create datastores on the witness host
  • Deploy and configure the witness appliance
  • Start the witness appliance and add the virtual host to vCenter
  • Network config for the witness appliance
  • Some standard config for all four hosts (DNS, NTP, SSH, Syslog)
  • Enable vSAN on cluster
  • Creating diskgroups
  • Configure witness traffic
  • Finalize vSAN cluster configuration with fault domains and specifying witness host

Some of the configurations might be very specific to this setup, and I have not made it as modular as Jase has in his scripts so please be sure to check out those.

The full script is available on GitHub.

This page was modified on April 1, 2019: Fixed categories and tags