VsanFault Category | Vmware PowerCLI Reference

vSAN Fault Category

Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations

Step 1: Retrieve a object by running a Get command

You can READ objects by using Get-VsanFaultDomain cmdlet. See example below:

# Retrieves the vSAN fault domain which contains the $vmHost virtual machine host.

Get-VsanFaultDomain -VMHost $vmHost

Step 2 : Run commands from the CRUD group

You can CREATE objects by using New-VsanFaultDomain cmdlet. See example below:

# Creates a new vSAN fault domain named "MyFaultDomainName", which has virtual machine hosts $vmHost1 and $vmHost2.

New-VsanFaultDomain -VMHost $vmHost1, $vmHost2 -Name "MyFaultDomainName"
You can UPDATE objects by using Set-VsanFaultDomain cmdlet. See example below:

# Renames the $fd vSAN fault domain to "NewName" and adds the $vmHost1 and $vmHost2 virtual machine hosts to it. Also, removes the $vmHost3 virtual machine host from the renamed vSAN fault domain.

Set-VsanFaultDomain -VsanFaultDomain $fd -Name "NewName" -AddVMHost $vmHost1, $vmHost2 -RemoveVMHost $vmHost3
You can REMOVE objects by using Remove-VsanFaultDomain cmdlet. See example below:

# Removes the $vsanFaultDomain vSAN fault domain without asking for confirmation.

Remove-VsanFaultDomain -VsanFaultDomain $vsanFaultDomain -Confirm:$false