impo
impo

Reputation: 777

Azure Vm Backup - change from OS Disk only to all disks

I have a virtual machine that has a backup that only includes the OS Disk. I need to change this so it includes all disks on the vm.

enter image description here

I cannot find where to do this on the Recovery Vault or the Backup Policy. I have only found documentation that is for excluding drives from the Backup Policy, not adding them.

Is it possible to add all the drives of a vm to an existing backup policy?

(Apologies, I am fairly new to azure and the vm backups so I am not sure if my terminology is correct).

Upvotes: 0

Views: 1020

Answers (1)

Ansuman Bal
Ansuman Bal

Reputation: 11411

You can use az backup protection update-for-vm with include as well the same way exclude works.

For excluding disk:

az backup protection update-for-vm --resource-group {resourcegroupname} --vault-name {vaultname} -c {vmname} -i {vmname} --disk-list-setting exclude --diskslist {LUN no's separated by space}

For including disks:

az backup protection update-for-vm --resource-group {resourcegroupname} --vault-name {vaultname} -c {vmname} -i {vmname} --disk-list-setting include --diskslist {LUN no's separated by space}

Example:

I have a VM with 2 data disks as below:

enter image description here

My Backup excludes the 2 data disks:

enter image description here

Command to include the data disks:

az backup protection update-for-vm --resource-group myresourcegroup --vault-name vault131 -c ansumantestvm -i ansumantestvm --disk-list-setting include --diskslist 0 1

After running the command the output is as :

enter image description here

enter image description here

Note : Reference on How to Install azure CLI

Upvotes: 1

Related Questions