Setting the default affinity rule for Storage DRS

On my blog article for yesterday “Rob M” commented that the default affinity rule for Storage DRS (SDRS), keep VM files together, did not make sense to him. One of the reasons this affinity rule is set is because customers indicated that from an operational perspective it would be easier if all files of a given VM (vmx / vmdk’s) would reside in the same folder. Especially troubleshooting was one of the main reasons, as this lowers complexity. I have to say that I fully agree with this, I’ve been in the situation where I needed to recover virtual machines and having them spread across multiple datastore really complicates things.

But, just like Rob, you might not agree with this and rather have SDRS handling balancing on a file per file basis. That is possible and we documented this procedure in our book. I was under the impression that I blogged this, but just noticed that somehow I never did. Here is how you change the affinity rule for the current provisioned VMs in a datastore cluster:

  1. Go to Datastores and Datastore Clusters
  2. Right click a datastore cluster and select “edit settings”
  3. Click “Virtual machine settings”
  4. Deselect “Keep VMDKs together”
    1. For virtual machines that need to stick together you can override the default by ticking the tick box next to the VM

Also check out this article by Frank about DRS/SDRS affinity rules, useful to know!

Be Sociable, Share!


    1. Robert says

      We’ve had trouble with snapshots when the vmx and vmdk (just the primary, it seems) aren’t on the same datastore. I had wanted to let SDRS be as efficient as it could be, not realizing it wasn’t as smart as it could be. Generally we’ve got separate file share and SQL datastores for extra drives, so any issue with keeping the drives together in our OS datastores was quite minimized, especially given the small number of additional OS drives and the issues we had snapping separate vmx/vmdks. Keeping them together is an easy fix. Having separate datastores for your other types of storage (which would probably want different types of storage qualities anyway, right?) makes it even easier to do that.

    2. Adeline says

      On our VMware infrastrucutre, we have different storage class. One VM can have disk on the gold class and another disk to the silver class for example.
      So I think to create one cluster by class.
      Did you know how Storage DRS manage that ? Can I keep this configuration on my virtual machines ? If I choose to keep VMDKS together, do I have all my vmdk on the same “storage cluster” ? Or I will still have vmdk in gold class together and vmdk in silver class together ?

    3. says

      @Adeline: you can create Datastore Clusters per storage tier and select the right datastore cluster for your Disk. Then Storage DRS will not keep them together.

    4. kennyd says

      we have vfast on the SAN side and we run SDRS as well. We have it in manual mode, so it does recommendations every once in a while. That is what we have read to keep SDRS in because we have vfast on the SAN side. Would there be any other recommendations perhaps in the SDRS arena?

      Storage on the SAN is as follows: sata > fibre > efd – initial placement is fibre.

    5. Alastair says

      this setting, when applied as per your image, does not apply as the DEFAULT in vSphere 5.0 datastore clusters.

      I untick the box, it unticks all the current VM’s, but when i build a new VM it again has the default “keep vmdk’s together” affinity rule applied.

      do you know how to apply the DEFAULT setting? Other blogs have shown using the web client to adjust the default but i don’t see this option in 5.0 web client. Maybe this only works in 5.1?

      • Travis Quinnelly says

        I have the same problem in my environment and I’ve googled to no avail.

        Does anyone know how to change this default behavior?