If your vSAN cluster spans across multiple racks or blade server chassis, you can logically group the hosts in fault domains to protect them against rack or chassis failure. You can separate the vSAN hosts in the same manner that they are physically separated.

In the vSphere Client, you can group hosts in fault domains during the initial configuration of the vSAN cluster or later.


vSphere Client UI configures fault domains for your vSAN cluster.

Following is an example of how to configure fault domains by using the vSAN Management API:

# Perform these tasks if fault domains are passed as an argument
if args.faultdomains:
    print 'Add fault domains in vsan'
faultDomains = []
# args.faultdomains is a string like f1:host1,host2 f2:host3,host4
for faultdomain in args.faultdomains.split():
    fname, hostnames = faultdomain.split(':')
domainSpec = vim.cluster.VsanFaultDomainSpec(
    name=fname,
    hosts=[
        host for host in hosts
        if hostProps[host]['name'] in hostnames.split(',')
    ])
faultDomains.append(domainSpec)

# Apply domain specification to vSAN Config
vsanReconfigSpec.faultDomainsSpec = vim.VimClusterVsanFaultDomainsConfigSpec(
    faultDomains=faultDomains)

# Configure fault domains
task = vsanClusterSystem.VsanClusterReconfig(cluster, vsanReconfigSpec)
vsanapiutils.WaitForTasks([task], si)