Skip to content

[Bug]: netapp-ontap_volume efficiency is never enabled #618

@flappje

Description

@flappje

Terraform Core Version

1.13.3

ONTAP Provider Version

2.4.0

Affected Resource(s)

  • netapp-ontap_volume

Expected Behavior

when I create a new volume or change an existing volume and set the efficiency policy like this:

efficiency = {
  policy_name = "foobar" 
}

I expect efficiency to be enabled on the volume and set to the selected policy

Actual Behavior

When I create a new volume or change the value on an existing volume I get an error.

I looked on the netapp itself and it seems that efficiency is not enabled (so also not with the "default" policy).

when I run the volume efficiency show -vserver svm1 -volume vol1
and try to change the efficiency policy again I don't get the error's, BUT i get a new error:

╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.vserver["1"].netapp-ontap_volume.default["1"], provider "provider[\"registry.terraform.io/netapp/netapp-ontap\"]" produced an unexpected new value: .nas.junction_path: was cty.StringVal("/sharedstorage"), but now cty.StringVal("").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

and looking to the volume in netapp again I see the my path is removed from the volume together with other errors
when I run terraform apply a second time the error is gone and my volume is correct again and the efficiency policy is changed. changing it again will produce the same error.

Relevant Error/Panic Output Snippet

When I try to create a new resource and give it the resource policy name: "foobar"
"
│ Error: Provider produced inconsistent result after apply

│ When applying changes to module.vserver["1"].netapp-ontap_volume.default["1"], provider "provider[\"registry.terraform.io/netapp/netapp-ontap\"]" produced an unexpected new value: .efficiency.policy_name: was cty.StringVal("foobar"), but now cty.StringVal("default").

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
"

when I create the resource with "default" policy and then try to rename it to "foobar" I get:
"
│ Error: error updating volume

│   with module.vserver["1"].netapp-ontap_volume.default["1"],
│   on vserver/volumes.tf line 102, in resource "netapp-ontap_volume" "default":
│  102: resource "netapp-ontap_volume" "default" {

│ error on POST storage/volumes: REST reported error restclient.RestError{Code:"6881332", Message:"Failed to modify efficiency configuration for volume \"vol1\" of SVM \"svm1\": Operation is not enabled. ", Target:""}, statusCode: 500, statusCode 500
"

Terraform Configuration Files

main.tf

resource "netapp-ontap_volume_efficiency_policy" "default" {
  cx_profile_name = "netapp1"
  name            = "foobar"
  enabled         = true
  qos_policy      = "best_effort"
  type            = "scheduled"
  svm = {
    name = "svm1"
  }
  schedule = {
    name = "daily"
  }
}

resource "netapp-ontap_volume" "default" {
  cx_profile_name = "netapp1"
  name            = "vol1"
  svm_name        = "svm1"

  aggregates = [
    {
      name = "aggr1",
    }
  ]
  space = {
    size      = 10
    size_unit = "gb"
  }
  efficiency = {
    policy_name = "foobar"
  }
}

Steps to Reproduce

first error: just run terraform apply.

second error: change policy to "default", run apply, change to "foobar" and run apply again.

for the latest error: after creating the volume (with "default" policy) enable efficiency on the cli. then change the policy_name to "foobar" and back to "default"

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions