Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article provides the procedure to back up long-term retention points in Archive tier, and snapshots and the Standard tier using Azure portal.
Workloads | Operations |
---|---|
Azure Virtual Machine | View archived recovery points. Move all recommended recovery points to archive. Restore for archived recovery points. View archive move and restore jobs. |
SQL Server in Azure Virtual Machine SAP HANA in Azure Virtual Machines |
View archived recovery points. Move all archivable recovery points to archive. Restore from archived recovery points. View archive move and restore jobs. |
You can now view all the recovery points that are moved to archive.
You can automatically move all eligible/recommended recovery points to Vault-archive by configuring the required settings in the backup policy.
To enable Smart Tiering for Azure VM backup policies, follow these steps:
In the Azure portal, go to Recovery Services vault -> Manage -> Backup policies.
Select or create a backup policy:
- Existing Backup Policy: Select the backup policy for which you want to enable Smart Tiering.
- Create a new Policy: Create a new backup policy.
In Backup policy, select Enable Tiering.
Select one of the following options to move to Vault-archive tier:
- Recommended recovery points: This option moves all recommended recovery points to the vault-archive tier. Learn more about recommendations.
- Eligible recovery points: This option moves all eligible recovery point after a specific number of days.
Note
- The value of x can range from 3 months to (monthly/yearly retention in months -6).
- This can increase your overall costs.
Once the policy is configured, all the recommended recovery points are moved to archive tier.
You can move all recovery points for a particular SQL/SAP HANA database at one go.
Follow these steps:
Select the backup item (database in SQL Server or SAP HANA in Azure VM) whose recovery points you want to move to the Vault-archive tier.
Select click here to view the list of all eligible achievable recovery points.
Select Move recovery points to archive to move all recovery points to the Vault-archive tier.
Note
This option moves all the archivable recovery points to the Vault-archive tier.
You can monitor the progress in backup jobs.
You can move all recommended recovery points for selected Azure Virtual Machines to the Vault-archive tier. Learn about recommendation set for Azure Virtual Machine.
Follow these steps:
Select the Virtual Machine whose recovery points you want to move to the Vault-archive tier.
Select click here to view recommended recovery points.
Select Move recovery points to archive to move all the recommended recovery points to Archive tier.
Note
To ensure cost savings, you need to move all the recommended recovery points to the Vault-archive tier. To verify, follow steps 1 and 2. If the list of recovery points is empty in step 3, all the recommended recovery points are moved to the Vault-archive tier.
To restore the recovery points that are moved to archive, you need to add the required parameters for rehydration duration and rehydration priority.
You can also view the archive usage in the vault dashboard.
- Use Archive tier support via PowerShell/CLI.
- Troubleshoot Archive tier errors
This article provides the procedure to back up long-term retention points in Archive tier, and snapshots and the Standard tier using PowerShell.
Workloads | Operations |
---|---|
Azure Virtual Machines SQL Server in Azure Virtual Machines |
View archivable recovery points. View recommended recovery points (only for Virtual Machines). Move archivable recovery points. Move recommended recovery points (only for Azure Virtual Machines). View archived recovery points. Restore from archived recovery points. |
Download the latest version of PowerShell from GitHub.
Run the following cmdlet in PowerShell:
install-module -name Az.RecoveryServices -Repository PSGallery -RequiredVersion 4.4.0 -AllowPrerelease -force
Connect to Azure using the Connect-AzAccount cmdlet.
Sign into your subscription:
Set-AzContext -Subscription "SubscriptionName"
Get the vault:
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName" -Name "vaultName"
Get the list of backup items:
For Azure Virtual Machines
$BackupItemList = Get-AzRecoveryServicesBackupItem -vaultId $vault.ID -BackupManagementType "AzureVM" -WorkloadType "AzureVM"
For SQL Server in Azure Virtual Machines
$BackupItemList = Get-AzRecoveryServicesBackupItem -vaultId $vault.ID -BackupManagementType "AzureWorkload" -WorkloadType "MSSQL"
Get the backup item.
For Azure Virtual Machines
$bckItm = $BackupItemList | Where-Object {$_.Name -match '<vmName>'}
For SQL Server in Azure Virtual Machines
$bckItm = $BackupItemList | Where-Object {$_.FriendlyName -eq '<dbName>' -and $_.ContainerName -match '<vmName>'}
(Optional) Add the date range for which you want to view the recovery points. For example, if you want to view the recovery points from the last 120 days, use the following cmdlet:
$startDate = (Get-Date).AddDays(-120) $endDate = (Get-Date).AddDays(0)
Note
To view recovery points for a different time range, modify the start and the end date accordingly.
By default, it's taken for the last 30 days.
You can now check the archivable status of all recovery points of a backup item using the following cmdlet:
$rp = Get-AzRecoveryServicesBackupRecoveryPoint -VaultId $vault.ID -Item $bckItm -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime()
$rp | select RecoveryPointId, @{ Label="IsArchivable";Expression={$_.RecoveryPointMoveReadinessInfo["ArchivedRP"].IsReadyForMove}}, @{ Label="ArchivableInfo";Expression={$_.RecoveryPointMoveReadinessInfo["ArchivedRP"].AdditionalInfo}}
$rp = Get-AzRecoveryServicesBackupRecoveryPoint -VaultId $vault.ID -Item $bckItm -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime() -IsReadyForMove $true -TargetTier VaultArchive
This cmdlet lists all recovery points associated with a particular backup item that's ready to be moved to archive (from the start date to the end date). You can also modify the start dates and the end dates.
$rp = Get-AzRecoveryServicesBackupRecoveryPoint -VaultId $vault.ID -Item $bckItm -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime() -IsReadyForMove $false -TargetTier VaultArchive
$rp[0].RecoveryPointMoveReadinessInfo["ArchivedRP"]
Where $rp[0]
is the recovery point for which you want to check why it's not archivable.
Sample output
IsReadyForMove AdditionalInfo
-------------- --------------
False Recovery-Point Type is not eligible for archive move as it is already moved to archive tier
The recovery points associated with a Virtual Machine are incremental. When you move a particular recovery point to archive, it's converted into a full backup, then moved to archive. So, the cost savings associated with moving to archive depends on the churn of the data source.
Therefore, Azure Backup provides a recommended set of recovery points that might save cost, if moved together.
Note
- The cost savings depends on various reasons and might not be the same for every instance.
- Cost savings are ensured only when you move all recovery points contained in the recommendation set to the Vault-archive tier.
$RecommendedRecoveryPointList = Get-AzRecoveryServicesBackupRecommendedArchivableRPGroup -Item $bckItm -VaultId $vault.ID
Move-AzRecoveryServicesBackupRecoveryPoint -VaultId $vault.ID -RecoveryPoint $rp[0] -SourceTier VaultStandard -DestinationTier VaultArchive
Here, $rp[0]
is the first recovery point in the list. If you want to move other recovery points, use $rp[1]
, $rp[2]
, and so on.
This cmdlet moves an archivable recovery point to archive. It returns a job that can be used to track the move operation, both from portal and with PowerShell.
This cmdlet returns all archived recovery points.
$rp = Get-AzRecoveryServicesBackupRecoveryPoint -VaultId $vault.ID -Item $bckItm -Tier VaultArchive -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime()
For recovery points in archive, Azure Backup provides an integrated restore methodology. The integrated restore is a two-step process.
- Involves rehydrating the recovery points stored in archive.
- Temporarily store it in the Vault-standard tier for a duration (also known as the rehydration duration) ranging from a period of 10 to 30 days. The default is 15 days. There are two different priorities of rehydration - Standard and High priority. Learn more about rehydration priority.
Note
- The rehydration duration once selected can't be changed and the rehydrated recovery points stay in the standard tier for the rehydration duration.
- The additional step of rehydration incurs cost.
For more information about various restore methods for Azure Virtual Machines, see Restore an Azure VM with PowerShell.
Restore-AzRecoveryServicesBackupItem -VaultLocation $vault.Location -RehydratePriority "Standard" -RehydrateDuration 15 -RecoveryPoint $rp -StorageAccountName "SampleSA" -StorageAccountResourceGroupName "SArgName" -TargetResourceGroupName $vault.ResourceGroupName -VaultId $vault.ID
To restore SQL Server, follow these steps. The Restore-AzRecoveryServicesBackupItem
cmdlet requires two other parameters, RehydrationDuration
and RehydrationPriority
.
To view the move and restore jobs, use the following PowerShell cmdlet:
Get-AzRecoveryServicesBackupJob -VaultId $vault.ID
You can now use sample scripts to perform at scale operations. Learn more about how to run the sample scripts. You can download the scripts from here.
You can perform the following operations using the sample scripts provided by Azure Backup:
- Move all eligible recovery points for a particular database/all databases for a SQL server in Azure VM to Archive tier.
- Move all recommended recovery points for a particular Azure Virtual Machine to Archive tier.
You can also write a script as per your requirements or modify the above sample scripts to fetch the required backup items.
You can automatically move all eligible/ recommended recovery points to vault-archive using a backup policy.
In the following sections, you'll learn how to enable Smart Tiering for eligible recovery points.
To create and configure a policy, run the following cmdlets:
Fetch the vault name:
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "testRG" -Name "TestVault"
Set the policy schedule:
$schPol = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -PolicySubType Enhanced -ScheduleRunFrequency Weekly
Set long-term retention point retention:
$retPol = Get-AzRecoveryServicesBackupRetentionPolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -ScheduleRunFrequency Weekly
You can now configure Smart Tiering to move recovery points to Vault-archive and retain them using the backup policy.
Note
After configuration, Smart Tiering is automatically enabled and moves the recovery points to Vault-archive.
To tier all recommended recovery points to Vault-archive, run the following cmdlet:
$pol = New-AzRecoveryServicesBackupProtectionPolicy -Name TestPolicy -WorkloadType AzureVM -BackupManagementType AzureVM -RetentionPolicy $retPol -SchedulePolicy $schPol -VaultId $vault.ID -MoveToArchiveTier $true -TieringMode TierRecommended
Learn more about archive recommendations for Azure VMs.
If the policy doesn't match the Vault-archive criteria, the following error appears:
New-AzRecoveryServicesBackupProtectionPolicy: TierAfterDuration needs to be >= 3 months, at least one of monthly or yearly retention should be >= (TierAfterDuration + 6) months
Note
Tier recommended is supported for Azure Virtual Machines, and not for SQL Server in Azure Virtual Machines.
To tier all eligible Azure VM recovery points to Vault-archive, specify the number of months after which you want to move the recovery points, and run the following cmdlet:
$pol = New-AzRecoveryServicesBackupProtectionPolicy -Name hiagaVMArchiveTierAfter -WorkloadType AzureVM -BackupManagementType AzureVM -RetentionPolicy $retPol -SchedulePolicy $schPol -VaultId $vault.ID -MoveToArchiveTier $true -TieringMode TierAllEligible -TierAfterDuration 3 -TierAfterDurationType Months
Note
- The number of months must range from 3 to (Retention - 6) months.
- Enabling Smart Tiering for eligible recovery points can increase your overall costs.
To tier all eligible SQL Server in Azure VM recovery points to Vault-archive, specify the number of days after which you want to move the recovery points and run the following cmdlet:
$pol = New-AzRecoveryServicesBackupProtectionPolicy -Name SQLArchivePolicy -WorkloadType MSSQL -BackupManagementType AzureWorkload -RetentionPolicy $retPol -SchedulePolicy $schPol -VaultId $vault.ID -MoveToArchiveTier $true -TieringMode TierAllEligible -TierAfterDuration 40 -TierAfterDurationType Days
Note
The number of days must range from 45 to (Retention - 180) days.
If the policy isn't eligible for Vault-archive, the following error appears:
New-AzRecoveryServicesBackupProtectionPolicy: TierAfterDuration needs to be >= 45 Days, at least one retention policy for full backup (daily / weekly / monthly / yearly) should be >= (TierAfter + 180) days
To modify an existing policy, run the following cmdlet:
$pol = Get-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID | Where { $_.Name -match "Archive" }
To disable Smart Tiering to archive recovery points, run the following cmdlet:
Set-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Policy $pol[0] -MoveToArchiveTier $false
To enable Smart Tiering after you've disable it, run the following cmdlet:
Azure Virtual Machine
Set-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Policy $pol[0] -MoveToArchiveTier $true -TieringMode TierRecommended
Azure SQL Server in Azure VMs
Set-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Policy $pol[1] -MoveToArchiveTier $true -TieringMode TierAllEligible -TierAfterDuration 45 -TierAfterDurationType Days
- Use Archive tier support via Azure portal/CLI.
- Troubleshoot Archive tier errors.
This article provides the procedure to back up long-term retention points in the Archive tier, and snapshots and the Standard tier using command-line interface (CLI).
Workloads | Operations |
---|---|
Azure Virtual Machines SQL Server in Azure Virtual Machines SAP HANA in Azure Virtual Machines |
View archivable recovery points. View recommended recovery points (only for Virtual Machines). Move archivable recovery points. Move recommended recovery points (only for Azure Virtual Machines). View archived recovery points. Restore from archived recovery points. |
Download/Upgrade Azure CLI version to 2.26.0 or higher.
- Follow the instructions to install CLI for the first time.
- Run
az --upgrade
to upgrade an already installed version.
Sign in using the following command:
az cloud set -n AzureChinaCloud az login
Set Subscription Context:
az account set -s <subscriptionId>
You can move the archivable recovery points to the Vault-archive tier using the following commands. Learn more about the eligibility criteria.
For Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureIaasVM} --workload-type {VM} --target-tier {VaultArchive} --is-ready-for-move {True}
For SQL Server in Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {MSSQL} --target-tier {VaultArchive} --is-ready-for-move {True}
For SAP HANA in Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {SAPHANA} --target-tier {VaultArchive} --is-ready-for-move {True}
Run the following command:
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload / AzureIaasVM} --workload-type {MSSQL / SAPHANA / VM} --query [].{Name:name,move_ready:properties.recoveryPointMoveReadinessInfo.ArchivedRP.isReadyForMove,additional_details: properties.recoveryPointMoveReadinessInfo.ArchivedRP.additionalInfo
You'll get a list of all recovery points, whether they're archivable and the reason if they're not archivable
Run the following command:
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type { AzureIaasVM} --workload-type {VM} --recommended-for-archive
Learn more about recommendation set.
Note
- Cost savings depends on various reasons and might not be the same for every instance.
- You can ensure cost savings only when all the recovery points contained in the recommendation set is moved to the Vault-archive tier.
You can move archivable recovery points to the Vault-archive tier using the following commands. The name parameter in the command should contain the name of an archivable recovery point.
For Azure Virtual Machine
az backup recoverypoint move -g {rg} -v {vault} -c {container} -i {item} --backup-management-type { AzureIaasVM} --workload-type {VM} --source-tier {VaultStandard} --destination-tier {VaultArchive} --name {rp}
For SQL Server in Azure Virtual Machine
az backup recoverypoint move -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {MSSQL} --source-tier {VaultStandard} --destination-tier {VaultArchive} --name {rp}
For SAP HANA in Azure Virtual Machine
az backup recoverypoint move -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {SAPHANA} --source-tier {VaultStandard} --destination-tier {VaultArchive} --name {rp}
Use the following commands:
For Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload } --workload-type {VM} -- tier {VaultArchive}
For SQL Server in Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {MSSQL} -- tier {VaultArchive}
For SAP HANA in Azure Virtual Machines
az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload} --workload-type {SAPHANA} -- tier {VaultArchive}
Run the following commands:
For Azure Virtual Machines
az backup restore restore-disks -g {rg} -v {vault} -c {container} -i {item} --rp-name {rp} --storage-account {storage_account} --rehydration-priority {Standard / High} --rehydration-duration {rehyd_dur}
For SQL Server in Azure VMs/SAP HANA in Azure VMs
az backup recoveryconfig show --resource-group saphanaResourceGroup \ --vault-name saphanaVault \ --container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \ --item-name saphanadatabase;hxe;hxe \ --restore-mode AlternateWorkloadRestore \ --rp-name 7660777527047692711 \ --target-item-name restored_database \ --target-server-name hxehost \ --target-server-type HANAInstance \ --workload-type SAPHANA \ --output json az backup restore restore-azurewl -g {rg} -v {vault} --recovery-config {recov_config} --rehydration-priority {Standard / High} --rehydration-duration {rehyd_dur}
- Use Archive tier support via Azure portal/PowerShell.
- Troubleshoot Archive tier errors