Sourav Karmakar
Sourav Karmakar

Reputation: 95

Resume backup of a azure VM, Powershell command

I just disabled the backup of my Azure VM and moved it to another subscriptions with all dependencies. Now I want to resume the backup using Powershell command. But I find that there is only some command for enable or disable backup, is there anything to resume a backup ?

Upvotes: 0

Views: 1061

Answers (2)

Nancy Xiong
Nancy Xiong

Reputation: 28204

As you know there is enable or disable operation for Azure VM backup. I think there is no such resume backup operation. Per my understanding, I suppose what you want is to continue backups the Azure VM in the existing recovery service vault after you move the Azure VM to another subscription. If so, please note that

Recovery Services vault doesn't support cross subscription backups. If you move a vault with virtual machine backup data across subscriptions, you must move your virtual machines to the same subscription, and use the same target resource group to continue backups.

To move a virtual machine to a new subscription without moving the Recovery Services vault:

  1. Temporarily stop backup
  2. Delete the restore point. This operation deletes only the instant recovery points, not the backed-up data in the vault.
  3. Move the virtual machines to the new subscription
  4. Reprotect it under a new vault in that subscription

In this case, you have to create a new vault for Azure VM backup after you move the VM to another subscription, so you will use Enable-AzRecoveryServicesBackupProtection to enable backup for an Azure VM then start a backup job with Backup-AzRecoveryServicesBackupItem.

Otherwise, you can move a Recovery Services vault and its associated resources to another subscription. Currently, you can move one Recovery Services vault, per region, at a time. You can't move vaults that back up Azure Files, Azure File Sync, or SQL in IaaS virtual machines. To move a Recovery Services vault, you must enroll in a limited public preview.

You also could get more details from the recovery service limitation.

Upvotes: 0

howie
howie

Reputation: 2685

If you want to resume ? Just Re-enable vm backup?

Reference: Enable backup for an Azure VM and Back up a virtual machine in Azure with PowerShell

You enable backup for an Azure VM, and specify a backup policy.

The policy defines when backups run, and how long recovery points created by the backups should be retained. The default protection policy runs a backup once a day for the VM, and retains the created recovery points for 30 days. You can use this default policy to quickly protect your VM.

Enable backup as follows:

First, set the default policy with Get-AzRecoveryServicesBackupProtectionPolicy:

    $policy = Get-AzRecoveryServicesBackupProtectionPolicy     -Name "DefaultPolicy"

Enable VM backup with Enable-AzRecoveryServicesBackupProtection. Specify the policy, the resource group and the VM name.

    Enable-AzRecoveryServicesBackupProtection `
        -ResourceGroupName "myResourceGroup" `
        -Name "myVM" `
        -Policy $policy

Upvotes: 1

Related Questions