Azure – Windows Server virtual disk cache settings

azuredisk-cachehyper-vperformancevirtual-disk

In Windows under Azure or Hyper-V, the Disk Policy write cache settings for a virtual disk will always appear to be enabled from the server configuration, regardless of the actual status of write cache settings on the underlying disk system. However, there is a second setting related to the first, for which its effect is unclear in this case of virtual disks, where the first is checked/enabled in the setting, but actually disabled in the virtual disk hardware. The disk settings appear like this:

[x] Enable Write Caching on the device
    [ ] Turn off Windows write-cache buffer flushing on the device 

Intuitively, I would assume there is no reason to enable this, since write caching is actually NOT on for the device, and if it were a physical disk, this setting would be disabled. But this article suggests that enabling it will free the OS and hardware from doing meaningless work, improving performance while maintaining the same data integrity, for this case where write caching is enabled in the setting but is actually disabled in hardware:

…since a virtual hard disk isn't really a disk at all, that setting
has no meaning as far as virtual disks are concerned. But the second
setting is different and does have meaning as it controls the cache
flush on/off settings for the disk. When you select the second
setting, cache flushes will essentially pretend to succeed–at least
at the level of the software stack. … when you select this setting
in the guest OS for a virtual hard disk in a virtual machine, you
might see some performance improvement for applications running in the
virtual machine. But always remember that it's the host's disk cache
settings that are the important ones as far as data integrity are
concerned.

Can anyone confirm whether or not this claim is true and a safe thing to do WRT data integrity?

Best Answer

I think those settings do not really have any sense if your data disks were initially configured with Read/None cache. This article states it is more a matter of host caching that can be modified through Service Management APIs or Powershell commands.