You can create an anti-affinity rule to indicate that all virtual disks of certain virtual machines must be kept on different datastores. The rule applies to individual datastore clusters.
Virtual machines that participate in an VM anti-affinity rule in a datastore cluster must be associated with an intra-VM affinity rule in the datastore cluster. The virtual machines must also comply with the intra-VM affinity rule.
If a virtual machine is subject to an VM anti-affinity rule, the following behavior applies:
Storage DRS places the virtual machine's virtual disks according to the rule.
Storage DRS migrates the virtual disks using vMotion according to the rule, even if the migration is for a mandatory reason such as putting a datastore in maintenance mode.
If the virtual machine's virtual disk violates the rule, Storage DRS makes migration recommendations to correct the error or reports the violation as a fault if it cannot make a recommendation that will correct the error.
No VM anti-affinity rules are defined by default.
- Browse to the datastore cluster in the vSphere Client.
- Click the Configure tab and click Configuration.
- Select VM/Host Rules.
- Click Add.
- Type a name for the rule.
- From the Type menu, select VM anti-affinity.
- Click Add.
- Click Select Virtual Machine.
- Select at least two virtual machines and click OK.
- Click OK to save the rule.