terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
Support for target_staging_storage_account_id on azurerm_site_recovery_replicated_vm when failing back
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.
Description
Unable to set the storage cache for the target destination when failing back in a cross region DR.
The cache storage account '' specified must be located in the same region as the source VM. The specific cache storage account location is : 'northeurope',
New or Affected Resource(s)/Data Source(s)
azurerm_site_recovery_replicated_vm
Potential Terraform Configuration
resource "azurerm_site_recovery_replicated_vm" "protected_vm_tf" {
name = local.virtual_machine_name
recovery_vault_name = local.support_recovery_vault
resource_group_name = local.support_recovery_vault_group
recovery_replication_policy_id = data.azurerm_site_recovery_replication_policy.policy[0].id
source_vm_id = local.virtual_machine_id
source_recovery_fabric_name = data.azurerm_site_recovery_fabric.fabric[0].name
source_recovery_protection_container_name = data.azurerm_site_recovery_protection_container.primary[0].name
target_resource_group_id = data.azurerm_resource_group.virtualmachine_asr[0].id
target_recovery_fabric_id = data.azurerm_site_recovery_fabric.secondary_fabric[0].id
target_recovery_protection_container_id = data.azurerm_site_recovery_protection_container.secondary[0].id
target_network_id = local.create_cross_region_failover ? data.azurerm_virtual_network.failover_vnet[0].id : data.azurerm_virtual_network.vnet.id
managed_disk {
disk_id = local.os_disk_id
staging_storage_account_id = data.azurerm_storage_account.primary[0].id
target_staging_storage_account_id = data.azurerm_storage_account.secondary[0].id
target_resource_group_id = data.azurerm_resource_group.virtualmachine_asr[0].id
target_disk_type = local.os_disk_storage
target_replica_disk_type = local.os_disk_storage
}
}
References
https://github.com/hashicorp/terraform-provider-azurerm/issues/23729