NetApp / terraform-provider-netapp-elementsw

Support for Volume, Initiator, Account, and Volume Access Group resources.
Mozilla Public License 2.0
5 stars 6 forks source link

for_each loop does not appear to work when creating volume access groups #4

Closed smetroid closed 3 years ago

smetroid commented 4 years ago

Hello,

I've been trying to use the provider to create some volumes against our netapp cluster. I've been using the terraform for_each loop to create volumes and to create the volume access groups. Volumes work, however when creating the volume access groups and using a for_each loop the second VAG fails with the error below:

{Code:500 Message:DBClient operation failed due to version mismatch at [/volumeaccessgroups] Name:xDBVersionMismatch}

Terraform version: 0.12.25 If I run the terraform apply a second time, it works without any issues.

ERROR BELOW:

2020/05/16 02:12:21 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2020/05/16 02:12:21 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # elementsw_volume_access_group.terraform_group["DWIAC20200505"] will be created
  + resource "elementsw_volume_access_group" "terraform_group" {
      + id         = (known after apply)
      + initiators = (known after apply)
      + name       = "DWIAC20200505-iac-ag"
    }

  # elementsw_volume_access_group.terraform_group["DWIAC20200514"] will be created
  + resource "elementsw_volume_access_group" "terraform_group" {
      + id         = (known after apply)
      + initiators = (known after apply)
      + name       = "DWIAC20200514-iac-ag"
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions in workspace "DLAS"?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

20200514\"]"
elementsw_volume_access_group.terraform_group["DWIAC20200514"]: Creating...
elementsw_volume_access_group.terraform_group["DWIAC20200505"]: Creating...
2020/05/16 02:12:24 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Request returned an error. {Code:500 Message:DBClient operation failed due to version mismatch at [/volumeaccessgroups] Name:xDBVersionMismatch}
t operation failed due to version mismatch at [/volumeaccessgroups] Name:xDBVersionMismatch}
elementsw_volume_access_group.terraform_group["DWIAC20200514"]: Creation complete after 0s [id=66]

Error: Request returned an error. {Code:500 Message:DBClient operation failed due to version mismatch at [/volumeaccessgroups] Name:xDBVersionMismatch}

  on storage.tf line 94, in resource "elementsw_volume_access_group" "terraform_group":
  94: resource "elementsw_volume_access_group" "terraform_group" {

Makefile:82: recipe for target 'run-dlas-terraform-apply' failed
make: *** [run-dlas-terraform-apply] Error 1
scaleoutsean commented 4 years ago

Interesting... I tried to manually create VAGs in various unsupported ways and all I get is xExceededLimit (attempt to add an IQN to the second VAG).

Is your cluster healthy?

Can you provide the full script or try once again and check what errors you see in Reporting > Event Log after xDBVersionMismatch comes up?

suhasbshekar commented 4 years ago

I tried to reproduce your error, but I am able to run successfully every time, let me know if you are still facing the issue or may be check the latest source code. following is the output,

An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

elementsw_volume_access_group.test-group[0] will be created

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.

Enter a value: yes

elementsw_volume_access_group.test-group[0]: Creating... elementsw_volume_access_group.test-group[1]: Creating... elementsw_volume_access_group.test-group[1]: Creation complete after 1s [id=721] elementsw_volume_access_group.test-group[0]: Creation complete after 1s [id=722]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

lonico commented 3 years ago

No update since June