Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_site_recovery_replication_recovery_plan does not keep order of boot groups #22323

Closed
1 task done
viewegchris opened this issue Jun 29, 2023 · 4 comments · Fixed by #22348
Closed
1 task done

Comments

@viewegchris
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 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

Terraform Version

1.4.4

AzureRM Provider Version

3.62.0

Affected Resource(s)/Data Source(s)

azurerm_site_recovery_replication_recovery_plan

Terraform Configuration Files

resource "azurerm_site_recovery_replication_recovery_plan" "recovery_plan" {
  name                      = "dr-test-plan"
  recovery_vault_id         = data.azurerm_recovery_services_vault.asr-vault.id
  source_recovery_fabric_id = data.azurerm_site_recovery_fabric.asr-recovery-fabric.id
  target_recovery_fabric_id = data.azurerm_site_recovery_fabric.asr-recovery-fabric.id

  recovery_group {
    type                       = "Shutdown"
  }

  recovery_group {
    type = "Failover"
  }

  recovery_group {
    type                       = "Boot"
    replicated_protected_items = local.replication_protected_db_items

  }

  recovery_group {
    type = "Boot"
    replicated_protected_items = local.replication_protected_app_items

    pre_action {
      name            = "final-approval-gate"
      type            = "ManualActionDetails"

      fail_over_directions = [
        "PrimaryToRecovery", "RecoveryToPrimary"
      ]
      fail_over_types = [
        "TestFailover", "PlannedFailover", "UnplannedFailover"
      ]
      manual_action_instruction = "Please check your application"
    }
  }

  azure_to_azure_settings {
    primary_zone  = local.source_zone
    recovery_zone = local.target_zone
  }
}

Debug Output/Panic Output

{"error":null,"id":null,"name":"36790663-972e-494f-bbc7-1183428e264d","properties":null,"status":"Succeeded","startTime":"2023-06-29T12:04:21.3486592Z","endTime":"2023-06-29T12:04:21.0000000Z","percentComplete":null}: timestamp=2023-06-29T12:04:51.539Z
2023-06-29T12:04:51.539Z [DEBUG] provider.terraform-provider-azurerm_v3.62.0_x5: AzureRM Request:
GET /subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/dr-test-plan?api-version=2022-10-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.20.5 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/replicationrecoveryplans/2022-10-01 HashiCorp Terraform/1.4.4 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/3.62.0
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: f5bbbc7a-26ef-3cc5-8cdd-66971d630acf
Accept-Encoding: gzip: timestamp=2023-06-29T12:04:51.539Z
2023-06-29T12:04:51.656Z [DEBUG] provider.terraform-provider-azurerm_v3.62.0_x5: AzureRM Response for https://management.azure.com/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/dr-test-plan?api-version=2022-10-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Thu, 29 Jun 2023 12:04:51 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: dc959b20-1b1b-487f-b243-c07bc7cd0a5f
X-Ms-Correlation-Request-Id: f5bbbc7a-26ef-3cc5-8cdd-66971d630acf
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11956
X-Ms-Request-Id: dc959b20-1b1b-487f-b243-c07bc7cd0a5f 6/29/2023 12:04:51 PM
X-Ms-Routing-Request-Id: SWITZERLANDNORTH:20230629T120451Z:914d46c0-6b78-4aa4-9800-94f1867c4e8e

{"id":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/dr-test-plan","name":"dr-test-plan","type":"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans","properties":{"friendlyName":"dr-test-plan","primaryFabricId":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric","primaryFabricFriendlyName":"Switzerland North","recoveryFabricId":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric","recoveryFabricFriendlyName":"Switzerland North","failoverDeploymentModel":"ResourceManager","replicationProviders":["A2A"],"allowedOperations":["UnplannedFailover","TestFailover"],"currentScenario":null,"currentScenarioStatus":null,"currentScenarioStatusDescription":null,"groups":[{"groupType":"Shutdown","replicationProtectedItems":[],"startGroupActions":[],"endGroupActions":[]},{"groupType":"Failover","replicationProtectedItems":[],"startGroupActions":[],"endGroupActions":[]},{"groupType":"Boot","replicationProtectedItems":[],"startGroupActions":[{"actionName":"final-approval-gate","failoverTypes":["PlannedFailover","UnplannedFailover","TestFailover"],"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"customDetails":{"instanceType":"ManualActionDetails","description":"Please check your application","canWrite":false,"canRead":true}}],"endGroupActions":[]},{"groupType":"Boot","replicationProtectedItems":[{"id":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric/replicationProtectionContainers/primary-protection-container/replicationProtectedItems/zachadevtestpr01008","virtualMachineId":"055d5a72-a050-5823-bffb-1c264f4bfadb"}],"startGroupActions":[],"endGroupActions":[]}],"providerSpecificDetails":[{"instanceType":"A2A","primaryZone":"1","recoveryZone":"2","primaryExtendedLocation":null,"recoveryExtendedLocation":null}]}}: timestamp=2023-06-29T12:04:51.656Z
2023-06-29T12:04:51.659Z [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/azurerm\"]" produced an unexpected new value for azurerm_site_recovery_replication_recovery_plan.recovery_plan, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .azure_to_azure_settings[0].primary_edge_zone: was null, but now cty.StringVal("")
- .azure_to_azure_settings[0].recovery_edge_zone: was null, but now cty.StringVal("")
2023-06-29T12:04:51.665Z [DEBUG] cloud/state: state read serial is: 508; serial is: 508
2023-06-29T12:04:51.665Z [DEBUG] cloud/state: state read lineage is: 337bccf7-9dea-2085-6870-ce35907259c4; lineage is: 337bccf7-9dea-2085-6870-ce35907259c4
2023-06-29T12:04:52.627Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-06-29T12:04:52.636Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/azurerm/3.62.0/linux_amd64/terraform-provider-azurerm_v3.62.0_x5 pid=178
2023-06-29T12:04:52.636Z [DEBUG] provider: plugin exited

Expected Behaviour

The order of the defined boot recovery_groups should keep the same as deffined in the tf file

Actual Behaviour

The order of recovery_groups should keep the same as defined in the Terraform Configuration file. Currently it's impossible to define a startup order of replicated items

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@ziyeqf
Copy link
Contributor

ziyeqf commented Jul 3, 2023

Hi @viewegchris, thanks for opening the issue.

I have submitted a PR(#22348) for it, once it merged & released the issue should be fixed. You can subscribe the PR to keep track on it.

For any further questions please leave comments.
Thanks!

@viewegchris
Copy link
Author

Hi @ziyeqf thanks for creating the PR.

Looks good to me

@viewegchris
Copy link
Author

Hi @ziyeqf do you have any ETA on which version your PR will released with?
Thanks

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants