Azure – Cannot turn off disk write caching on Azure VM with no host cache

azurevhdwindows-server-2012-r2

I've created Azure VM and attached a data vhd disk with "None" host cache.

Next, if I run disk management on Windows and open drive properties, there is Policies tab which shows a checkbox indicating that write-caching is on and when I try to turn it off I get a "This device does not allow its write caching setting to be changed" warning.

How to turn it off?

Best Answer

When you add a data disk from the Azure portal you choose the "host Cache preference" this would be "None", "Read Only", or "Read/Write"

If you choose "None" then Azure Hosts won't cache. The VM host OS itself is controlled by you. You go into disk management and add the disk to the system and partition and format it to your desire. :)

A VM in Azure will always have 2 disks when you first create it. The C:\ drive for the OS and a D:\ drive for the swap file. The OS drive maps to your Azure storage and the D:\ drive maps to a local VHD file on the hyper-v host server. This d:\ drive is not persistent and you may lose data you stored on there when you are moved to a different hyper-v host. (No big deal cause it is for the swap file and that will be recreated)

If you are looking at how to set the no caching on your windows volume. From the Disk Management MMC.

  1. The fresh disk will be unallocated - right click on it and select properties
  2. Choose the policies tab de-select the "Enable Write Caching on this device"
  3. click "ok" Now just partition and format your drive
  4. assign a drive letter
  5. done
Related Topic