The disk that are attached to a VM has a option to set cache preference to manage local cache that are used for read or write operations. This settings can used to improve performance.
There are three cache options:
- None
- Read Only
- Read/Write
Following are the steps to set the caching preference using portal
Navigate to the azure portal and click Virtual Machines
x
Select the VM and click Disk from the blade
Click Edit from the menu and select the appropriate Host Caching from the drop down.
Click Save to save the changes.
Following are the steps to set the preferences using powershell
Powershell commands to update the host caching preferences.
Following example sets the caching to None
$vm = Get-AzureRmVM -ResourceGroupName cprg -VMName cpvm
$vm.storageprofile.osdisk.Caching="None"
Other options
$vm.storageprofile.osdisk.Caching="ReadWrite"
$vm.storageprofile.osdisk.Caching="ReadOnly"