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

New resource azurerm_disk_pool_managed_disk_attachment based on New Resource azurerm_disk_pool on pr #14675 #14268

Merged
merged 9 commits into from
Jan 13, 2022

Conversation

lonegunmanb
Copy link
Contributor

A new resource allow user add or remove a managed disk to a disks pool as this doc described.

@lonegunmanb
Copy link
Contributor Author

New added acc test:
=== RUN TestAccStorageDisksPoolDiskAttachment_basic
=== PAUSE TestAccStorageDisksPoolDiskAttachment_basic
=== CONT TestAccStorageDisksPoolDiskAttachment_basic
--- PASS: TestAccStorageDisksPoolDiskAttachment_basic (1835.36s)
=== RUN TestAccStorageDisksPoolDiskAttachment_requiresImport
=== PAUSE TestAccStorageDisksPoolDiskAttachment_requiresImport
=== CONT TestAccStorageDisksPoolDiskAttachment_requiresImport
--- PASS: TestAccStorageDisksPoolDiskAttachment_requiresImport (1751.69s)
=== RUN TestAccStorageDisksPoolDiskAttachment_multipleDisks
=== PAUSE TestAccStorageDisksPoolDiskAttachment_multipleDisks
=== CONT TestAccStorageDisksPoolDiskAttachment_multipleDisks
--- PASS: TestAccStorageDisksPoolDiskAttachment_multipleDisks (1921.51s)
=== RUN TestAccStorageDisksPoolDiskAttachment_destroy
=== PAUSE TestAccStorageDisksPoolDiskAttachment_destroy
=== CONT TestAccStorageDisksPoolDiskAttachment_destroy
--- PASS: TestAccStorageDisksPoolDiskAttachment_destroy (1703.99s)
PASS

@tombuildsstuff tombuildsstuff self-assigned this Nov 19, 2021
@tombuildsstuff tombuildsstuff added new-virtual-resource Resources which are split out to enhance the user experience service/disks labels Dec 20, 2021
katbyte pushed a commit that referenced this pull request Jan 5, 2022
This PR introduces a new resource azurerm_disk_pool which supersedes the existing azurerm_storage_disks_pool - this is because the existing resource is unrelated to the Storage package and is a collection of (Managed) Disks. Since there's a number of Disk related resources (and will be more with #14268) - this pulls the existing resource and this new resource out into it's own package.

There's a follow up here to move Managed Disks into this package too, but that's outside the scope of this PR.

Dependent on #14673 and #14672
@lonegunmanb lonegunmanb force-pushed the disk_pool_managed_disk_attachment branch from c67ef49 to 8b58cfe Compare January 7, 2022 08:39
@lonegunmanb
Copy link
Contributor Author

Hi @tombuildsstuff , I've moved origin attachment code to disks directory, along with acc tests.
Acc tests:

=== RUN TestAccStorageDisksPoolDiskAttachment_basic
=== PAUSE TestAccStorageDisksPoolDiskAttachment_basic
=== CONT TestAccStorageDisksPoolDiskAttachment_basic
--- PASS: TestAccStorageDisksPoolDiskAttachment_basic (1746.68s)
=== RUN TestAccStorageDisksPoolDiskAttachment_multipleDisks
=== PAUSE TestAccStorageDisksPoolDiskAttachment_multipleDisks
=== CONT TestAccStorageDisksPoolDiskAttachment_multipleDisks
--- PASS: TestAccStorageDisksPoolDiskAttachment_multipleDisks (2085.68s)
=== RUN TestAccStorageDisksPoolDiskAttachment_destroy
=== PAUSE TestAccStorageDisksPoolDiskAttachment_destroy
=== CONT TestAccStorageDisksPoolDiskAttachment_destroy
--- PASS: TestAccStorageDisksPoolDiskAttachment_destroy (1261.74s)
PASS

Process finished with the exit code 0

@lonegunmanb lonegunmanb force-pushed the disk_pool_managed_disk_attachment branch from 014f95a to 634f762 Compare January 7, 2022 08:47
@lonegunmanb lonegunmanb changed the title New resource azurerm_storage_disks_pool_managed_disk_attachment New resource azurerm_disk_pool_managed_disk_attachment based on New Resource azurerm_disk_pool on pr #14675 Jan 11, 2022
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

We have a test failure here:

------- Stdout: -------
=== RUN   TestAccDiskPoolDiskAttachment_requiresImport
=== PAUSE TestAccDiskPoolDiskAttachment_requiresImport
=== CONT  TestAccDiskPoolDiskAttachment_requiresImport
    testcase.go:110: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating Disk Pool (Subscription: "*******"
        Resource Group Name: "acctestRG-diskpool-220112211612942034"
        Disk Pool Name: "acctest-diskpool-vnq7y"): polling after CreateOrUpdate: Code="GoalStateApplicationTimeoutError" Message="The deployment of the resource did not complete in the allowed time. Please try again. (Tracking id : fcf8a383-0097-9cf6-6431-50aa6dd7da5d). https://aka.ms/diskpools-troubleshooting."

should we be wrapping this in a pluginsdk.Retry() that looks for "Please Try again" and tried again after 5 min?

@lonegunmanb
Copy link
Contributor Author

lonegunmanb commented Jan 13, 2022

We have a test failure here:

------- Stdout: -------
=== RUN   TestAccDiskPoolDiskAttachment_requiresImport
=== PAUSE TestAccDiskPoolDiskAttachment_requiresImport
=== CONT  TestAccDiskPoolDiskAttachment_requiresImport
    testcase.go:110: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating Disk Pool (Subscription: "*******"
        Resource Group Name: "acctestRG-diskpool-220112211612942034"
        Disk Pool Name: "acctest-diskpool-vnq7y"): polling after CreateOrUpdate: Code="GoalStateApplicationTimeoutError" Message="The deployment of the resource did not complete in the allowed time. Please try again. (Tracking id : fcf8a383-0097-9cf6-6431-50aa6dd7da5d). https://aka.ms/diskpools-troubleshooting."

should we be wrapping this in a pluginsdk.Retry() that looks for "Please Try again" and tried again after 5 min?

Hello @katbyte , I've added retry to disk_pool_resource.go since this error occured in Disk Pool's creation. According to document:

Common failure codes when deploying a disk pool

Code Description
UnexpectedError Usually occurs when a backend unrecoverable error occurs. Retry the deployment. If the issue isn't resolved, contact Azure Support and provide the tracking ID of the error message.
DeploymentFailureZonalAllocationFailed This occurs when Azure runs out of capacity to provision a VM in the specified region/zone. Retry the deployment at another time.
DeploymentFailureQuotaExceeded The subscription used to deploy the disk pool is out of VM core quota in this region. You can request an increase in vCPU quota limits per Azure VM series for Dsv3 series.
DeploymentFailurePolicyViolation A policy on the subscription prevented the deployment of Azure resources that are required to support a disk pool. See the error for more details.
DeploymentTimeout This occurs when the deployment of the disk pool infrastructure gets stuck and doesn't complete in the allotted time. Retry the deployment. If the issue persists, contact Azure support and provide the tracking ID of the error message.
GoalStateApplicationTimeoutError Occurs when the disk pool infrastructure stops responding to the resource provider. Confirm you meet the networking prerequisites and then retry the deployment. If the issue persists, contact Azure support and provide the tracking ID of the error.
OngoingOperationInProgress An ongoing operation is in-progress on the disk pool. Wait until that operation completes, then retry deployment.

I've chosen the following errors as retryable:

retryableErrors := []string{
		"DeploymentTimeout",
		"GoalStateApplicationTimeoutError",
		"OngoingOperationInProgress",
	}

And acc tests:

=== RUN TestAccDiskPool_basic
=== PAUSE TestAccDiskPool_basic
=== CONT TestAccDiskPool_basic
--- PASS: TestAccDiskPool_basic (1294.61s)
=== RUN TestAccDiskPool_requiresImport
=== PAUSE TestAccDiskPool_requiresImport
=== CONT TestAccDiskPool_requiresImport
--- PASS: TestAccDiskPool_requiresImport (1143.48s)
=== RUN TestAccDiskPool_complete
=== PAUSE TestAccDiskPool_complete
=== CONT TestAccDiskPool_complete
--- PASS: TestAccDiskPool_complete (1496.02s)
PASS

Process finished with the exit code 0

=== RUN TestAccDiskPoolDiskAttachment_basic
=== PAUSE TestAccDiskPoolDiskAttachment_basic
=== CONT TestAccDiskPoolDiskAttachment_basic
--- PASS: TestAccDiskPoolDiskAttachment_basic (1548.86s)
=== RUN TestAccDiskPoolDiskAttachment_requiresImport
=== PAUSE TestAccDiskPoolDiskAttachment_requiresImport
=== CONT TestAccDiskPoolDiskAttachment_requiresImport
--- PASS: TestAccDiskPoolDiskAttachment_requiresImport (1634.41s)
=== RUN TestAccDiskPoolDiskAttachment_multipleDisks
=== PAUSE TestAccDiskPoolDiskAttachment_multipleDisks
=== CONT TestAccDiskPoolDiskAttachment_multipleDisks
--- PASS: TestAccDiskPoolDiskAttachment_multipleDisks (2080.83s)
=== RUN TestAccDiskPoolDiskAttachment_destroy
=== PAUSE TestAccDiskPoolDiskAttachment_destroy
=== CONT TestAccDiskPoolDiskAttachment_destroy
--- PASS: TestAccDiskPoolDiskAttachment_destroy (1313.89s)
PASS

Process finished with the exit code 0

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Awesome @lonegunmanb! much better then grepping for a string thanks

LGTM 🏗️

@katbyte katbyte merged commit 7323f29 into hashicorp:main Jan 13, 2022
@github-actions github-actions bot added this to the v2.92.0 milestone Jan 13, 2022
katbyte added a commit that referenced this pull request Jan 13, 2022
@github-actions
Copy link

This functionality has been released in v2.92.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!

@lonegunmanb lonegunmanb deleted the disk_pool_managed_disk_attachment branch January 26, 2022 09:15
@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 Feb 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation new-virtual-resource Resources which are split out to enhance the user experience service/disks size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants