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_backup_policy_vm: support instant_restore_resource_group #20562

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

ziyeqf
Copy link
Contributor

@ziyeqf ziyeqf commented Feb 20, 2023

close #20559

test

terraform-provider-azurerm ❯ TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccBackupProtectionPolicyVM -timeout=600m                            [ tengzh/issue/policy_vm_enhance][$!][🐹 v1.19.5][⏱ 19s][13:53:25]
=== RUN   TestAccBackupProtectionPolicyVM_policyTypeDefault
=== PAUSE TestAccBackupProtectionPolicyVM_policyTypeDefault
=== RUN   TestAccBackupProtectionPolicyVM_basicDaily
=== PAUSE TestAccBackupProtectionPolicyVM_basicDaily
=== RUN   TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
=== PAUSE TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
=== RUN   TestAccBackupProtectionPolicyVM_requiresImport
=== PAUSE TestAccBackupProtectionPolicyVM_requiresImport
=== RUN   TestAccBackupProtectionPolicyVM_basicWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_basicWeekly
=== RUN   TestAccBackupProtectionPolicyVM_completeDaily
=== PAUSE TestAccBackupProtectionPolicyVM_completeDaily
=== RUN   TestAccBackupProtectionPolicyVM_completeWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_completeWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateDaily
=== PAUSE TestAccBackupProtectionPolicyVM_updateDaily
=== RUN   TestAccBackupProtectionPolicyVM_updateWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyToWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyToWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
=== RUN   TestAccBackupProtectionPolicyVM_basicHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_basicDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== PAUSE TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== RUN   TestAccBackupProtectionPolicyVM_basicWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
=== RUN   TestAccBackupProtectionPolicyVM_withCustomRGName
=== PAUSE TestAccBackupProtectionPolicyVM_withCustomRGName
=== RUN   TestAccBackupProtectionPolicyVMWorkload_basic
=== PAUSE TestAccBackupProtectionPolicyVMWorkload_basic
=== RUN   TestAccBackupProtectionPolicyVMWorkload_update
=== PAUSE TestAccBackupProtectionPolicyVMWorkload_update
=== CONT  TestAccBackupProtectionPolicyVM_policyTypeDefault
=== CONT  TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== CONT  TestAccBackupProtectionPolicyVM_completeWeekly
=== CONT  TestAccBackupProtectionPolicyVM_updateDaily
=== CONT  TestAccBackupProtectionPolicyVM_requiresImport
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
=== CONT  TestAccBackupProtectionPolicyVM_basicWeekly
=== CONT  TestAccBackupProtectionPolicyVM_completeDaily
--- PASS: TestAccBackupProtectionPolicyVM_completeWeekly (389.29s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyToWeekly
--- PASS: TestAccBackupProtectionPolicyVM_completeDaily (389.93s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
--- PASS: TestAccBackupProtectionPolicyVM_policyTypeDefault (392.23s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeekly
--- PASS: TestAccBackupProtectionPolicyVM_basicWeekly (395.25s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_requiresImport (413.19s)
=== CONT  TestAccBackupProtectionPolicyVMWorkload_update
--- PASS: TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2 (503.87s)
=== CONT  TestAccBackupProtectionPolicyVMWorkload_basic
--- PASS: TestAccBackupProtectionPolicyVM_updateDaily (556.66s)
=== CONT  TestAccBackupProtectionPolicyVM_withCustomRGName
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToPartial (672.30s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
--- PASS: TestAccBackupProtectionPolicyVMWorkload_basic (283.75s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateWeekly (461.52s)
=== CONT  TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyV2 (467.50s)
=== CONT  TestAccBackupProtectionPolicyVM_completeWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVMWorkload_update (454.79s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToDaily (488.90s)
=== CONT  TestAccBackupProtectionPolicyVM_updateHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_withCustomRGName (362.91s)
=== CONT  TestAccBackupProtectionPolicyVM_basicDailyV2
=== CONT  TestAccBackupProtectionPolicyVM_basicHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyToWeekly (572.92s)
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2 (472.53s)
=== CONT  TestAccBackupProtectionPolicyVM_completeHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_completeWeeklyV2 (368.81s)
=== CONT  TestAccBackupProtectionPolicyVM_completeDailyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateHourlyV2 (405.45s)
=== CONT  TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
--- PASS: TestAccBackupProtectionPolicyVM_basicDailyV2 (366.61s)
=== CONT  TestAccBackupProtectionPolicyVM_basicDaily
--- PASS: TestAccBackupProtectionPolicyVM_basicHourlyV2 (370.11s)
=== CONT  TestAccBackupProtectionPolicyVM_basicWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyV2 (475.67s)
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2 (589.16s)
--- PASS: TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2 (599.52s)
--- PASS: TestAccBackupProtectionPolicyVM_completeHourlyV2 (359.04s)
--- PASS: TestAccBackupProtectionPolicyVM_completeDailyV2 (369.96s)
--- PASS: TestAccBackupProtectionPolicyVM_basicWeeklyV2 (371.90s)
--- PASS: TestAccBackupProtectionPolicyVM_basicDaily (465.14s)
--- PASS: TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate (491.47s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1777.029s

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @ziyeqf, left a few comments in-line but once those are fixed up we can take another look at this!

@ziyeqf ziyeqf force-pushed the tengzh/issue/policy_vm_enhance branch from 44c9119 to 2c925cd Compare February 21, 2023 02:50
@ziyeqf
Copy link
Contributor Author

ziyeqf commented Feb 21, 2023

test

terraform-provider-azurerm ❯ TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccBackupProtectionPolicyVM -timeout=600m                          [ tengzh/issue/policy_vm_enhance][$!][🐹 v1.19.6][⏱ 3m55s][10:24:48]
=== RUN   TestAccBackupProtectionPolicyVM_policyTypeDefault
=== PAUSE TestAccBackupProtectionPolicyVM_policyTypeDefault
=== RUN   TestAccBackupProtectionPolicyVM_basicDaily
=== PAUSE TestAccBackupProtectionPolicyVM_basicDaily
=== RUN   TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
=== PAUSE TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
=== RUN   TestAccBackupProtectionPolicyVM_requiresImport
=== PAUSE TestAccBackupProtectionPolicyVM_requiresImport
=== RUN   TestAccBackupProtectionPolicyVM_basicWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_basicWeekly
=== RUN   TestAccBackupProtectionPolicyVM_completeDaily
=== PAUSE TestAccBackupProtectionPolicyVM_completeDaily
=== RUN   TestAccBackupProtectionPolicyVM_completeWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_completeWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateDaily
=== PAUSE TestAccBackupProtectionPolicyVM_updateDaily
=== RUN   TestAccBackupProtectionPolicyVM_updateWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyToWeekly
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyToWeekly
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
=== RUN   TestAccBackupProtectionPolicyVM_basicHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_basicDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== PAUSE TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== RUN   TestAccBackupProtectionPolicyVM_basicWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_basicWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_completeWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_completeWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateHourlyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateHourlyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
=== RUN   TestAccBackupProtectionPolicyVM_withCustomRGName
=== PAUSE TestAccBackupProtectionPolicyVM_withCustomRGName
=== RUN   TestAccBackupProtectionPolicyVMWorkload_basic
=== PAUSE TestAccBackupProtectionPolicyVMWorkload_basic
=== RUN   TestAccBackupProtectionPolicyVMWorkload_update
=== PAUSE TestAccBackupProtectionPolicyVMWorkload_update
=== CONT  TestAccBackupProtectionPolicyVM_policyTypeDefault
=== CONT  TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2
=== CONT  TestAccBackupProtectionPolicyVM_basicDailyV2
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== CONT  TestAccBackupProtectionPolicyVM_withCustomRGName
=== CONT  TestAccBackupProtectionPolicyVMWorkload_update
=== CONT  TestAccBackupProtectionPolicyVM_completeWeeklyV2
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyV2
--- PASS: TestAccBackupProtectionPolicyVM_policyTypeDefault (366.60s)
=== CONT  TestAccBackupProtectionPolicyVM_completeHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_basicDailyV2 (372.47s)
=== CONT  TestAccBackupProtectionPolicyVM_completeDailyV2
--- PASS: TestAccBackupProtectionPolicyVM_completeWeeklyV2 (382.11s)
=== CONT  TestAccBackupProtectionPolicyVM_updateHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_withCustomRGName (383.61s)
=== CONT  TestAccBackupProtectionPolicyVM_basicWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVMWorkload_update (457.07s)
=== CONT  TestAccBackupProtectionPolicyVMWorkload_basic
--- PASS: TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdateV2 (485.38s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyV2 (538.14s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyV2
    testing_new.go:86: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting Resource Group: (Resource Group "acctestRG-backup-230221102458923558"): resources.GroupsClient#Delete: Failure sending request: StatusCode=404 -- Original Error: Code="ResourceGroupNotFound" Message="Resource group 'acctestRG-backup-230221102458923558' could not be found."
        
--- FAIL: TestAccBackupProtectionPolicyVM_updateWeeklyV2 (552.81s)
=== CONT  TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_completeHourlyV2 (378.56s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDaily
--- PASS: TestAccBackupProtectionPolicyVM_completeDailyV2 (373.01s)
=== CONT  TestAccBackupProtectionPolicyVM_basicHourlyV2
--- PASS: TestAccBackupProtectionPolicyVM_basicWeeklyV2 (372.31s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToPartial
--- PASS: TestAccBackupProtectionPolicyVMWorkload_basic (355.19s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyToDaily
--- PASS: TestAccBackupProtectionPolicyVM_updateHourlyV2 (469.86s)
=== CONT  TestAccBackupProtectionPolicyVM_updateDailyToWeekly
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToPartialV2 (482.49s)
=== CONT  TestAccBackupProtectionPolicyVM_updateWeekly
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyAndWeeklyV2 (598.51s)
=== CONT  TestAccBackupProtectionPolicyVM_basicWeekly
--- PASS: TestAccBackupProtectionPolicyVM_basicHourlyV2 (371.17s)
=== CONT  TestAccBackupProtectionPolicyVM_completeWeekly
--- PASS: TestAccBackupProtectionPolicyVM_updateHourlyAndWeeklyV2 (597.10s)
=== CONT  TestAccBackupProtectionPolicyVM_completeDaily
--- PASS: TestAccBackupProtectionPolicyVM_updateDaily (464.03s)
=== CONT  TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToPartial (469.64s)
=== CONT  TestAccBackupProtectionPolicyVM_requiresImport
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyToDaily (466.14s)
=== CONT  TestAccBackupProtectionPolicyVM_basicDaily
--- PASS: TestAccBackupProtectionPolicyVM_updateDailyToWeekly (471.08s)
--- PASS: TestAccBackupProtectionPolicyVM_basicWeekly (373.94s)
--- PASS: TestAccBackupProtectionPolicyVM_updateWeekly (460.97s)
--- PASS: TestAccBackupProtectionPolicyVM_completeWeekly (378.89s)
--- PASS: TestAccBackupProtectionPolicyVM_completeDaily (367.10s)
--- PASS: TestAccBackupProtectionPolicyVM_requiresImport (395.18s)
--- PASS: TestAccBackupProtectionPolicyVM_basicDaily (370.13s)
--- PASS: TestAccBackupProtectionPolicyVM_withInstantRestoreRetentionRangeUpdate (478.92s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1689.355s
FAIL

failed one

terraform-provider-azurerm ❯ TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccBackupProtectionPolicyVM_updateWeeklyV2 -timeout=600m             [ tengzh/issue/policy_vm_enhance][$][🐹 v1.19.6][⏱ 24ms][10:50:39]
=== RUN   TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== PAUSE TestAccBackupProtectionPolicyVM_updateWeeklyV2
=== CONT  TestAccBackupProtectionPolicyVM_updateWeeklyV2
--- PASS: TestAccBackupProtectionPolicyVM_updateWeeklyV2 (497.98s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      499.228s

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ziyeqf LGTM 🌶️

@stephybun stephybun merged commit d9d5956 into hashicorp:main Feb 21, 2023
@github-actions github-actions bot added this to the v3.45.0 milestone Feb 21, 2023
stephybun added a commit that referenced this pull request Feb 21, 2023
@github-actions
Copy link

This functionality has been released in v3.45.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azurerm_backup_policy_vm has no "Azure Backup Resource Group (Optional)" parameter
2 participants