Microsoft recently announced that Azure Site Recovery, an enterprise wide disaster recovery solution, now comes with the capability to protect virtual machines to Microsoft’s public cloud, Azure. In this blog post I will elaborate on the basic steps of setting up disaster recovery to Azure for an organization. These steps will be helpful specifically if you are an organization with a large number of Hyper-V hosts with virtual machines that need to be protected to Azure.
Following are the pre-requisites for setting up disaster recovery to Azure:
MicrosoftAzure Site Recovery Provider should be installed on the System Center Virtual Machine Manager server that is being used to manage the primary site.
Microsoft Azure Recovery Services Agent should beinstalled on all WS2012 R2 Hyper-V host machines that have virtual machines that need to be protected to Azure.
The agents on the Hyper-V host servers and the Virtual Machine Manager server need to have connectivity to Azure (via a proxy server or direct connectivity).
The setup process can be an easy two-step process for deploying the agent on multiple Hyper-V host servers that need to be protected to Azure and can be easily accomplished using the deployment methods used by your organization.
Agent install and configuration using System Center Configuration Manager
If you prefer using System Center Configuration Manager for managing deployments and installation of software, you can install the Microsoft Azure Recovery Services agent on all Hyper-V hosts following detailed steps for software package deployment as mentioned here.
To configure proxy settings using System Center Configuration Manager you need to run the below PowerShell cmdlet on all the Hyper-V host servers.
Set-OBMachineSetting [-ProxyServer]
[-ProxyPort] [[-ProxyUsername] ] [[-ProxyPassword] ] [-Confirm] [-WhatIf] [ ] Parameters:
ProxyPassword
: Specifies authentication password to be used for proxy ProxyPort
: Specifies the port number ProxyServer
: Specifies the proxy server to be used ProxyUsername
: Specifies the username to be used Set-OBMachineSetting [-NoProxy] [-Confirm] [-WhatIf] [
] -NoProxy Specifies that unique proxy server settings are not to be used for the agent.
Use the cmdlet for Set-OBMachineSetting to create a powershell script(.ps1). Create a task sequence and run the PowerShell script using the Run PowerShell script task sequence step. Details on how PowerShell scripts can be executed using System Center Configuration Manager can be found here.
Agent install and proxy configuration using Group Policy
If you use Group Policy for centralized configuration management, you can use it to install the Microsoft Azure Recovery Services agent on hosts using the detailed steps to publish a package available here.
2. Group policy can be used to set proxy configuration for a large number of hosts.
- Use the above mentioned cmdlet for Set-OBMachineSetting to create a powershell script(.ps1). Share the script with the cmdlet and related xml on a network share that can be accessed by all users accounts that need to run the script.
- Open the Group Policy Management Console to create a GPO for the domain or container that contains the user accounts/hosts for which the proxy configuration needs to be set.
- In Group Policy management editor, expand user configuration, policies, windows settings to add the PowerShell script at logon/logoff or system start/shutdown. Detailed steps on how the PowerShell script can be used as a logon script can be found here.
Agent install and proxy configuration using Remote PowerShell
If you do not use any of the above deployment methods for agent install and configuration, you can use remote PowerShell. You can use Invoke-WmiMethod to install the agent on all host servers. Specify [-Class] parameter as Win32_Process, [-Name ] parameter as create, [-ArgumentList] parameter as the install location and [-ComputerName] as the comma separated list of computer names on which the installation is to be completed. Details on Invoke-WmiMethod can be found here.
Proxy configuration can be done using the Invoke-Command to run a script block for executing the Set-OBMachineSetting cmdlet on the list of host servers. You can find more details on the Invoke-Command at http://technet.microsoft.com/en-us/library/hh849719.aspx . Specify the list of hosts servers on which you need to set the proxy as a comma separated list for the [-ComputerName] parameter. Specify the Set-OBMachineSetting cmdlet in the [-ScriptBlock] parameter along with the related arguments as the [-ArgumentList