Azure Site Recovery – Part 2 – Getting Started with Recovery Services Vaults

In the 2nd post of this series about Azure Site Recovery (ASR), we will create a new Recovery Services Vaults and go through the different settings we can configure here.

Links to other posts in this series:

Azure Site Recovery – Part 1 – Introduction

Azure Site Recovery – Part 2 – Getting Started with Recovery Services Vaults (this post)

Azure Site Recovery – Part 3 – Hyper-V to Azure 

What is Recovery Services Vaults?

Recovery Services Vaults are the new name for Azure Site Recovery vaults in Azure Resource Manager. Recovery Services Vaults are not just for ASR though, we can also use them for Azure Backup. That way we have both backups and our disaster recovery solution in the same interface, and can monitor these from a single location.

If we do Azure Backup, all of our data will be backed up to a Recovery Services Vault. Behind the scenes Azure Backup use either Locally-Redundant or Geo-Redundant Storage. You change this from within the vault, and not on a storage account – because Azure will manage this storage account for you.

When using Azure Site Recovery on the other hand, we will manage our storage accounts, and create them depending on our preference. As a new thing in Azure Resource Manager, we can use both LRS and GRS storage, which means we can also use Premium Storage. Awesome stuff, and once again proof that Microsoft listens to feedback!

Manage Vaults in the portal

Let’s dive in, and start by creating a new Recovery Services Vault in the portal. First of all, browse to https://portal.azure.com, and sign in. From there select New -> Management -> Backup and Site Recovery (OMS):

Next, fill out the fields:

Name – Name of the vault, in this case Cloudpuzzles

Subscription – If you have multiple subscriptions, select the correct here

Resource Group – I’m creating a new one here, named CloudpuzzlesASR

Location – Select the location you want to use, I’m using North Europe

Then click Create.

Creating a new vault is pretty quick, usually 20-30 seconds, and when completed you should see this output if check the Audit Logs:

To browse to your vault, select Browse in the menu on the left, and select Recovery Services Vaults (optionally search for it, as it’s far down the list):

On the Recovery Services Vaults blade, select your vault

The overview page of our vault shows a few different things (note that I have minimized the essentials view):

  1. Site Recovery Health

    1. Any events about unhealthy servers, lost connections etc, will show under Events. Above that we will see a count of unhealthy servers too.
  2. Backup Items

    1. This is just a link to see your Backup Items, VMs or Files & Folders
  3. Backup Jobs

    1. Shows the count of recent backup jobs
  4. Backup Usage

    1. Amount of data used, for both LRS and GRS storage
  5. Replicated Items

    1. This view shows all your replicated servers. Note that servers do not show up until they have run their initial replication succesfully!
  6. Recovery Plans

    1. Number of Recovery Plans we have
  7. Site Recovery Jobs

    1. Count of Failed, Waiting and In Progress jobs. Successful jobs it not listed here, but you will be able to see them, don’t worry

Click any of the tiles, and a new blade will open with more details about the tile you selected.

I we click Settings, we’ll get all the options we have to manage our vault:

  1. Getting Started

    1. For both Backup and Site Recovery, Microsoft has created some very good wizards to get started on the configuration. If you choose these options, you’ll be guided through a lot of the things you need to do.
  2. General

    1. Just general information about your vault. You can also download the latest version of the Microsoft Azure Recovery Services agent (MARS agent – used for both Backup and Site Recovery) here, and a Vault Credentials file, which lets you connect the MARS agent to Azure.
  3. Monitoring and Reports

    1. Get an overview of jobs that have run, this can be both Backup and Site Recovery jobs. You can go back in time, and see all the details about a job. For example why it failed to add a new server to Azure Site Recovery.
  4. Protected Items

    1. This is where you add, configure or delete items you want to backup, or include in your failover scenarios
  5. Manage – This requires a bit more information.

      1. Site Recovery Infrastructure

        1. This is all the servers you have running, which are replicating data to Azure. This could be Virtual Machine Manager (VMM), Hyper-V hosts, or Configuration Servers (which are used for VMware and physical scenarios).
      2. Backup infrastructure

        1. Here you can switch between LRS and GRS storage for your backups. Note that you have to change this before you start using the vault for backups! You will also find any servers you have connected to Azure Backup here, for example Data Protection Manager (DPM) or Microsoft Azure Backup Server (MABS).
      3. Recovery Plans

        1. Recovery Plans is where a lot of the Azure Site Recovery magic happens. Recovery Plans lets you group VMs, scripts and manual actions together – or in different groups – to control the failover process. You might want to start Domain Controllers before any other servers for example, and this is where you configure those things. Recovery Plans also integrate with Azure Automation, to let you run scripts directly from there. All of this is what makes Azure Site Recovery awesome in my opinion!

That was the quick overview. We’ll dive in to a lot more details about all of this, in later posts.

Manage Vaults in PowerShell

As with any other Azure service, Recovery Services vaults can also be managed through PowerShell. Let’s jump right in!

Start by logging in:

[powershell]Login-AzureRmAccount[/powershell]

If you are a CSP, you will need to provide -TenantId, remember that.
Next, create a Resource Group for your Recovery Services Vault:

[powershell]New-AzureRmResourceGroup -Name "CloudPuzzlesASR-PS" -Location "North Europe"[/powershell]

Before we can create a new vault, you might have to register with the Microsoft.RecoveryServices resource provider, to do that, run the following command:

[powershell]Register-AzureRmResourceProvider -ProviderNamespace Microsoft.RecoveryServices[/powershell]

After this, you can use:

[powershell]Get-AzureRmResourceProvider -ProviderNamespace Microsoft.RecoveryServices[/powershell]

To check if it has been registered. The output will look like this:

[powershell]Get-AzureRmResourceProvider -ProviderNamespace Microsoft.RecoveryServices
ProviderNamespace RegistrationState ResourceTypes Locations
—————– —————– ————- ———
Microsoft.RecoveryServices Registered {vaults} {West US, East US, North Europe, West Europe…}[/powershell]

Now we can create a new vault, for this we will use:

[powershell]New-AzureRmRecoveryServicesVault -Name "Cloudpuzzles-PS" -ResourceGroupName "CloudpuzzlesASR-PS" -Location "North Europe"
Name : Cloudpuzzles-PS
ID : /subscriptions/7bce381f-79b3-4521-b36e-138932735300/resourceGroups/CloudpuzzlesASR-PS/providers/Microsoft.RecoveryServices/vaults/Cloudpuzzles-PS
Type : Microsoft.RecoveryServices/vaults
Location : northeurope
ResouceGroupName : CloudpuzzlesASR-PS
SubscriptionId : 7bce381f-79b3-4521-b36e-138932735300
Properties : Microsoft.Azure.Commands.RecoveryServices.ARSVaultProperties[/powershell]

To work with the vault, we have to download a Vault Credentials file:

[powershell]Get-AzureRmRecoveryServicesVault -Name "Cloudpuzzles-PS" -ResourceGroupName "CloudpuzzlesASR-PS" | Get-AzureRmRecoveryServicesVaultSettingsFile[/powershell]

Note that this file is only valid for 48 hours, so you have to renew this when you work with it.

Now run this to import the credentials to your PowerShell session:

[powershell]Import-AzureRmSiteRecoveryVaultSettingsFile -Path C:Pathtofile.vaultcredentials #Normally saved under your user accounts temp directory[/powershell]

The observant user will notice that we’re now working with the AzureRM.SiteRecovery PowerShell module, where the previous command was from AzureRM.RecoveryServices module.
From now on, in this PowerShell session, we can work with our Recovery Services vault. We can for example get our vault using this command:

[powershell]Get-AzureRmSiteRecoveryVault -Name "Cloudpuzzles-PS" -ResourceGroupName "CloudpuzzlesASR-PS"
Name : Cloudpuzzles-PS
ID : /subscriptions/7bce381f-79b3-4521-b36e-138932735300/resourceGroups/CloudpuzzlesASR-PS/providers/Microsoft.RecoveryServices/vaults/Cloudpuzzles-PS
Type : Microsoft.RecoveryServices/vaults
Location : northeurope
ResouceGroupName : CloudpuzzlesASR-PS
SubscriptionId : 7bce381f-79b3-4521-b36e-138932735300
Properties : Microsoft.Azure.Commands.SiteRecovery.ASRVaultProperties[/powershell]

Once again, we will get into more details about the commands, when we talk about the different settings.

Manage Vaults with ARM Templates

At the moment the APIs for Recovery Services Vaults are now available, so we will have to dive into this later.

2 comments

Leave a Reply