azureazure-storageazure-virtual-machineazure-disk

Update Cache setting on a "live" data disk for a Azure VM using azure cli/bash


If I want to update host-cache settings on a live data disk, what is the approach?

Should I do a script where I first take a snapshot and then create a new disk from that with the new host-cache settings?

Is there any other way of doing this with azurecli/bash?


Solution

  • You could try to use az vm update to update disk cache to a VM.

    az vm update -n name -g group --disk-caching os=ReadWrite
    

    Use singular value to apply across, or specify individual disks, e.g. os=ReadWrite 0=None 1=ReadOnly should enable update os disk and 2 data disks.