Terraform-provider-azurerm: Feature Request: Recovery Services Backup Policies / Site Recovery

Created on 20 Mar 2018  ยท  8Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

We would like to automate the configuration of Backup and Site Recovery for VMs, a la https://docs.microsoft.com/en-us/azure/site-recovery/azure-to-azure-tutorial-enable-replication.

This should include the configuration of Resource Group, Network, Storage and Availability Sets.

new-resource servicrecovery-services

Most helpful comment

๐Ÿ‘‹

Support for Recovery Services Policies and Recovery Services Protected VM's shipped in v1.17 of the AzureRM Provider. You can upgrade to this by updating the version number specified in the Provider block (as shown below) then by running terraform init -upgrade:

provider "azurerm" {
  version = "=1.18.0"
}

Thanks!

All 8 comments

I will be very interested too on this feature, we currently use the not recommended solution "azurerm_template_deployment"

For info, if it can help I published here how I create a recovery vault through the Terraform resource "azurerm_template_deployment" : https://github.com/JamesDLD/terraform
I will add soon how to enable backup for a VM.

hi @philipstreet-hiscox @JamesDLD

Thanks for opening this issue :)

Support for provisioning Recovery Services has been added in #995 which will ship as part of the next release of the Azure Provider. There's a separate issue tracking adding Virtual Machines to a Recovery Vault - which I'm going to close this in favour of: https://github.com/terraform-providers/terraform-provider-azurerm/issues/1143

Thanks!

Adding some additional context after a little investigation: it appears this'd need to be a resource per "Type" - we should be able to start with IaaS VM's and add additional types based on demand? This is available in the SDK: https://github.com/Azure/azure-sdk-for-go/blob/4de511fba6f4c9d4266d37a7b0d142abb976fa8e/services/recoveryservices/mgmt/2017-07-01/backup/models.go#L3572

My specific scenario is configuring Replicated items (https://docs.microsoft.com/en-us/azure/site-recovery/azure-to-azure-tutorial-enable-replication#enable-replication).

What I've done so far is Terraform the additional resources required to configure Azure-to-Azure VM replication, i.e. Availability Sets, NSGs, Recovery Services Vault & Storage Accounts, and then manually configure (via the Portal) the VM Replication (as described in the above link).

So, what I would like to be able to do in Terraform is (depending on what is supported):

  • Configure replication settings for a VM, specifying target Resource Group, Availability Set, Virtual Network, Replica Managed Disks, and Cache Storage
  • Configure Replication policy, including using an existing Replication policy or configuring a new one (Name, recovery point, app consistency snapshot frequency), multi-VM consistency with Replication group details (name, machines)
  • Extension settings (Update settings)

๐Ÿ‘‹

Support for Recovery Services Policies and Recovery Services Protected VM's shipped in v1.17 of the AzureRM Provider. You can upgrade to this by updating the version number specified in the Provider block (as shown below) then by running terraform init -upgrade:

provider "azurerm" {
  version = "=1.18.0"
}

Thanks!

Hi There, can this be used to set up replication rather than backups? From the documentation, it seems only backups are possible.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐Ÿค– ๐Ÿ™‰ , please reach out to my human friends ๐Ÿ‘‰ [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings