The Storage DRS rules that you define at the virtual machine level function in the same way as the affinity and anti-affinity rules that you define at the datastore cluster level. Virtual machine Storage DRS rules define whether virtual machine hard disks are placed and kept on the same datastore or on different datastores within a datastore cluster.
In the vSphere Client, you can create, edit, and delete Storage DRS rules. You can also create Storage DRS rules that place and keep all virtual disks of certain virtual machines on different datastores within a datastore cluster.
VMDK Affinity Rules
By default, all virtual machine hard disks are kept together on the same datastore within a datastore cluster that has Storage DRS enabled. That is, VMDK affinity rules are enabled by default for all virtual machines that are in a datastore cluster. You can override that rule for the datastore cluster or for individual virtual machines.
Storage DRS Anti-Affinity Rules
- VMDK anti-affinity rules ensure that two or more virtual hard disks of a single virtual machine are placed and kept on different datastores within the datastore cluster.
- VM anti-affinity rules ensure that all the virtual hard disks of two or more virtual machines are placed and kept on different datastores within the datastore cluster.
For more information about Storage DRS, see the vSphere Resource Management documentaion.
Add a VMDK Affinity Rule
Create a VMDK affinity rule to place and keep all virtual disks of a virtual machine on the same datastore within a datastore cluster.
Prerequisites
Procedure
Results
An Intra-VM Affinity rule is created that keeps VMDKs together. That is, all virtual hard disks of the selected virtual machine are placed and kept together on the same datastore within the datastore cluster.
Add a VMDK Anti-Affinity Rule
Create a VMDK anti-affinity rule to place and keep certain virtual hard disks of a virtual machine on different datastores within the datastore cluster.
When you create an anti-affinity rule, it applies to those of the virtual machine's hard disks that are on datastores within the selected datastore cluster. Anti-affinity Storage DRS rules operate during migrations that Storage DRS initiates or recommends, but they do not operate when the user initiates a migration.
Prerequisites
Procedure
Results
A VMDK anti-affinity rule is created. If the rule is enabled, all selected virtual hard disks are placed and kept on different datastores within the datastore cluster.
Add a VM Anti-Affinity Rule
Create a VM anti-affinity rule to place and keep all virtual hard disks of selected virtual machines on different datastores within the datastore cluster.
Prerequisites
Procedure
Results
A VM anti-affinity rule is created. If the rule is enabled, all virtual hard disks of the selected virtual machines are placed and kept on different datastores within the datastore cluster.