There was a question posted on the VMware Community Forums, and as this is something I have been asked regularly, I figured I would do a quick blog post about it. Although I have covered this before, it doesn’t hurt to repeat, as it appears to be somewhat confusing for people. When you create a VM Storage Policy, starting with vSAN 7.0 U2 you have the ability to specify if a VM needs to be Encrypted, have Dedupe and Compression enabled, have Compression-Only enabled, and/or needs to be stored on all-flash vSAN or Hybrid. Never noticed it? Look at the screenshot below.
In the screenshot, you see that you have the ability to specify which data service needs to be enabled. I guess this is where the confusion comes into play, as this functionality is not about enabling the data service for the VM to which you assign the policy. This is about which data service needs to be enabled on the datastore to which the VM can be provisioned. Huh, what? Okay, let’s explain.
If you are using vSAN as your storage platform, and you are sharing vSAN Datastores between clusters leveraging the HCI Mesh feature, then you could find yourself in a situation where some clusters are hybrid and some are all-flash. Some may have data services enabled like Encryption or Deduplication, some may not. In that scenario you want to be able to specify which features need to be enabled for the datastore the VM is provisioned to. So what this “storage rules” feature does is that it ensure that the datastore which is shown as “compatible” actually has the specified capabilities enabled! In other words, if you tick “data-at-rest encryption” in a policy and assign the policy to a VM, then only the datastores which have “data-at-rest encryption” enabled will be shown as compatible with your VM!
So again, “storage rules” apply to the data services that should be enabled on the vSAN Datastore, and do not enable data services on a per VM/VMDK basis.
<Update for vSAN 8.0 ESA>
With vSAN 8.0 ESA the above has changed. With vSAN 8.0 ESA you can set compression per VM, and you actually do that using the policy storage rules. I discussed this in this blog post.
Babak says
Hi . I am baber in vmware community . I just can say you are The Best.
Duncan Epping says
thanks!
nimrod shoshani says
Hello Duncan,
I recently encountered an issue regarding this feature.
I have a stretched cluster – 6+6+witness.
I created the vSAN default storage policy as a RAID1 between sites, and RAID6 in each site and ticked the deduplication and compression option under the space efficiency at the vSAN default storage policy level.
I also enabled Dedup and Compression at the cluster level.
With this configuration I wasn’t able to create a VM on the cluster with an error of “Cannot complete file creation operation”.
Only after I switched the dedup and compression option to no preference at the storage policy level, I was able to create VMs.
On the other hand, I have another regular vSAN cluster that I have enabled dedup and compression on both storage policy level and cluster level and VM creation is possible.
Is it possible that on a stretched vSAN cluster, you can’t tick the dedup and compression at the storage policy level and also on the Cluster level? maybe it is a bug?
Using 7U2c ESXi version (on a VxRail environment).
Waiting for your response, sorry for the long message.
Duncan Epping says
That policy setting typically is only used when you leverage HCI Mesh for sharing datastores. So unless you share datastores for that VM, (storage consuming from another cluster) you should not be using that setting.