Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Azure VM Selective Disk Backup

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Azure VM Selective Disk Backup – Blog of Danidu (wordpress.

com)

Azure VM Selective Disk Backup

Hey Folks

Recently Microsoft has announched that, Azure now supports VM


Selective backups.

What is this selective backup??. This will allow the


admins/customers to backup only the selected disks in a VM to
Azure backup. But at the moment we can only perform the
following scnearios

Example

We have a Linux VM which has OS Disk and 2 data disks as mention


below

What we can do is

1. Backup All Data disks (Typical option)


2. Backup only the OS disk
3. Backup OS Disk + Disk 1
4. Backup OS Disk + Disk 2
Azure VM Selective Disk Backup – Blog of Danidu (wordpress.com)

What we cannot do is back up on the data disks without the OS


disk.

I will talk about option 2 and 3 ( 4 is same as 3). Basically I will be


covering the new options. Alos on this to note, at the moment
option 3 only can be set from powershell. There is no GUI option for
it.

Backup OS Disk + Data Disk 1

Get VM Disk Details

Get-AzDisk -ResourceGroupName AE-DEV-LINUX

Get Azure VM Datadisk details

$Vm = Get-AzVM -ResourceGroupName AE-DEV-LINUX -Name


LinuxVm01
Azure VM Selective Disk Backup – Blog of Danidu (wordpress.com)

Determine Datadisk lun details

$vm.StorageProfile.DataDisks

Specify the data disk lun numbers seperated with a comma

$disks = (“0”)
$targetVault = Get-AzRecoveryServicesVault -ResourceGroupName
AE-DEV-LINUX -Name LinuxRecovery

Setting the vault content

Set-AzRecoveryServicesVaultContext -Vault $targetVault

GetBackup policy details to a variable

$pol = Get-AzRecoveryServicesBackupProtectionPolicy -Name


“Linux”
Azure VM Selective Disk Backup – Blog of Danidu (wordpress.com)

Enable Protection

Enable-AzRecoveryServicesBackupProtection -Policy $pol -Name


“LinuxVm01” -ResourceGroupName “AE-DEV-LINUX” -
InclusionDisksList $disks -VaultId $targetVault.ID

check the Backup status

$item= Get-AzRecoveryServicesBackupItem -
BackupManagementType “AzureVM” -WorkloadType “AzureVM” -
VaultId $targetVault.ID -FriendlyName “LinuxVm01”
Azure VM Selective Disk Backup – Blog of Danidu (wordpress.com)

Backup OS Disk Only

To backup the OS disk only, we can achive this from GUi. Simply
browse torecovery services vault.

Azure VM Backup Page

Azure Backup select Server


Azure VM Selective Disk Backup – Blog of Danidu (wordpress.com)

Once you select the VM, you can simply tick the option to backup
OS only

Or what you can do is powershell use the below parameer to


exclude all data disks

You might also like