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_storage_disks_pool #14145

Merged
merged 4 commits into from
Nov 19, 2021
Merged

Conversation

lonegunmanb
Copy link
Contributor

Add new resource for Azure Disks Pool

=== RUN TestAccStorageDisksPool_basic
=== PAUSE TestAccStorageDisksPool_basic
=== CONT TestAccStorageDisksPool_basic
--- PASS: TestAccStorageDisksPool_basic (846.68s)
=== RUN TestAccStorageDisksPool_standard
=== PAUSE TestAccStorageDisksPool_standard
=== CONT TestAccStorageDisksPool_standard
--- PASS: TestAccStorageDisksPool_standard (827.07s)
=== RUN TestAccStorageDisksPool_premium
=== PAUSE TestAccStorageDisksPool_premium
=== CONT TestAccStorageDisksPool_premium
--- PASS: TestAccStorageDisksPool_premium (806.30s)
=== RUN TestAccStorageDisksPool_requiresImport
=== PAUSE TestAccStorageDisksPool_requiresImport
=== CONT TestAccStorageDisksPool_requiresImport
--- PASS: TestAccStorageDisksPool_requiresImport (905.59s)

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.

looks like we have some test failures

------- Stdout: -------
=== RUN   TestAccStorageDisksPool_premium
=== PAUSE TestAccStorageDisksPool_premium
=== CONT  TestAccStorageDisksPool_premium
    testcase.go:109: Step 1/2 error: Error running apply: exit status 1
        
        Error: creation of "Storage Disks Pool: (Disk Pool Name \"acctest-diskspool-xt0go\" / Resource Group \"acctestRG-diskspool-211111173620746279\")": storagepool.DiskPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="400" Message="invalid request; request is malformed or invalid; unable to read `/subscriptions/*******/resourceGroups/acctestRG-diskspool-211111173620746279/providers/Microsoft.Network/virtualNetworks/acctest-vnet-211111173620746279/subnets/acctest-subnet-211111173620746279` due to permissions"
        
          with azurerm_storage_disks_pool.test,
          on terraform_plugin_test.tf line 34, in resource "azurerm_storage_disks_pool" "test":
          34: resource "azurerm_storage_disks_pool" "test" {
        
        creation of "Storage Disks Pool: (Disk Pool Name \"acctest-diskspool-xt0go\"
        / Resource Group \"acctestRG-diskspool-211111173620746279\")":
        storagepool.DiskPoolsClient#CreateOrUpdate: Failure sending request:
        StatusCode=400 -- Original Error: Code="400" Message="invalid request;
        request is malformed or invalid; unable to read
        `/subscriptions/*******/resourceGroups/acctestRG-diskspool-211111173620746279/providers/Microsoft.Network/virtualNetworks/acctest-vnet-211111173620746279/subnets/acctest-subnet-211111173620746279`
        due to permissions"
--- FAIL: TestAccStorageDisksPool_premium (112.00s)
FAIL

@lonegunmanb
Copy link
Contributor Author

looks like we have some test failures

------- Stdout: -------
=== RUN   TestAccStorageDisksPool_premium
=== PAUSE TestAccStorageDisksPool_premium
=== CONT  TestAccStorageDisksPool_premium
    testcase.go:109: Step 1/2 error: Error running apply: exit status 1
        
        Error: creation of "Storage Disks Pool: (Disk Pool Name \"acctest-diskspool-xt0go\" / Resource Group \"acctestRG-diskspool-211111173620746279\")": storagepool.DiskPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="400" Message="invalid request; request is malformed or invalid; unable to read `/subscriptions/*******/resourceGroups/acctestRG-diskspool-211111173620746279/providers/Microsoft.Network/virtualNetworks/acctest-vnet-211111173620746279/subnets/acctest-subnet-211111173620746279` due to permissions"
        
          with azurerm_storage_disks_pool.test,
          on terraform_plugin_test.tf line 34, in resource "azurerm_storage_disks_pool" "test":
          34: resource "azurerm_storage_disks_pool" "test" {
        
        creation of "Storage Disks Pool: (Disk Pool Name \"acctest-diskspool-xt0go\"
        / Resource Group \"acctestRG-diskspool-211111173620746279\")":
        storagepool.DiskPoolsClient#CreateOrUpdate: Failure sending request:
        StatusCode=400 -- Original Error: Code="400" Message="invalid request;
        request is malformed or invalid; unable to read
        `/subscriptions/*******/resourceGroups/acctestRG-diskspool-211111173620746279/providers/Microsoft.Network/virtualNetworks/acctest-vnet-211111173620746279/subnets/acctest-subnet-211111173620746279`
        due to permissions"
--- FAIL: TestAccStorageDisksPool_premium (112.00s)
FAIL

Hi @katbyte,

Apology for this failure, I forgot to mention a prerequisite that was not listed in the official document, we must register Microsoft.StoragePool resource provider to our subscription first as this blog told us at the beginning. I've updated document for this.

And for other incoming disks pool resources, we must make sure our service principal has permission to list and read other service principal's info like this:

data "azuread_service_principal" "example" {
  display_name = "StoragePool Resource Provider"
}

It's required in both our acc tests and document, but for now, I think register Microsoft.StoragePool would fix disks pool's acc test.

If you encounter any further issues, please let me know. Thanks!

@lonegunmanb
Copy link
Contributor Author

Hi @katbyte ,

Please forgive my previous mumbo jumbo, I'm a newbie to this project and Azure.
I've added Microsoft.StoragePool to required providers, and acc tests are passed now (I've checked on team city).

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.

Thanks @lonegunmanb! all the tests pass now 🙁 👍 🚀

@katbyte katbyte added this to the v2.86.0 milestone Nov 19, 2021
@katbyte katbyte merged commit 6e5e487 into hashicorp:main Nov 19, 2021
katbyte added a commit that referenced this pull request Nov 19, 2021
@lonegunmanb
Copy link
Contributor Author

Thanks @katbyte , this is my first new resource pr!

@github-actions
Copy link

This functionality has been released in v2.86.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 Dec 20, 2021
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.

2 participants