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

[Enhancement]: Add SVM QoS Policy Activation #346

Open
wants to merge 1,032 commits into
base: integration/main
Choose a base branch
from

Conversation

acch
Copy link

@acch acch commented Dec 3, 2024

Adds ability to configure qos_policy parameter of SVMs.

Needs to be a dedicated resource, as creating a QoS Policy scoped to an SVM, and then activating it for the SVM, is a 2-step process. See documentation for details.

Closes #301.

Acceptance tests pass:

$ TF_ACC=1 go test ./internal/provider/svm/svm_qos_policy_activation_resource_test.go -v
=== RUN   TestAccSvmQosPolicyActivationResource
--- PASS: TestAccSvmQosPolicyActivationResource (2.96s)
PASS
ok      command-line-arguments  2.967s

Example Terraform Configuration WIP:

resource "netapp-ontap_svm_qos_policy_activation" "example" { 
  svm = {
    name = "svm01"
  }
  qos_policy = {
    name = "performance_svm01"
  }
}

suhasbshekar and others added 30 commits August 13, 2024 16:32
…resource-example-not-showing-up-correctly-1

fix Doc bug for flexcache
carchi8py and others added 16 commits December 13, 2024 15:24
…b.com/aws/aws-sdk-go-v2-1.32.6

Bump github.com/aws/aws-sdk-go-v2 from 1.30.3 to 1.32.6
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.27 to 1.28.6.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@config/v1.27.27...config/v1.28.6)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/aws/aws-sdk-go-v2/config-1.28.6

Bump github.com/aws/aws-sdk-go-v2/config from 1.27.27 to 1.28.6
Bumps [github.com/aws/aws-sdk-go-v2/service/lambda](https://github.com/aws/aws-sdk-go-v2) from 1.56.3 to 1.69.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@service/lambda/v1.56.3...service/glue/v1.69.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/lambda
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/aws/aws-sdk-go-v2/service/lambda-1.69.1

Bump github.com/aws/aws-sdk-go-v2/service/lambda from 1.56.3 to 1.69.1
Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.4 to 0.20.1.
- [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-docs@v0.19.4...v0.20.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-docs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/hashicorp/terraform-plugin-docs-0.20.1

Bump github.com/hashicorp/terraform-plugin-docs from 0.19.4 to 0.20.1
Bumps [github.com/aws/aws-sdk-go-v2/service/lambda](https://github.com/aws/aws-sdk-go-v2) from 1.69.1 to 1.69.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@service/glue/v1.69.1...service/lambda/v1.69.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/lambda
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/aws/aws-sdk-go-v2/service/lambda-1.69.2

Bump github.com/aws/aws-sdk-go-v2/service/lambda from 1.69.1 to 1.69.2
Bumps [github.com/hashicorp/terraform-plugin-framework-validators](https://github.com/hashicorp/terraform-plugin-framework-validators) from 0.12.0 to 0.16.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-framework-validators/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-framework-validators@v0.12.0...v0.16.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-framework-validators
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/hashicorp/terraform-plugin-framework-validators-0.16.0

Bump github.com/hashicorp/terraform-plugin-framework-validators from 0.12.0 to 0.16.0
Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.34.0 to 2.35.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-sdk@v2.34.0...v2.35.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…b.com/hashicorp/terraform-plugin-sdk/v2-2.35.0

Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.34.0 to 2.35.0
@carchi8py carchi8py added New Resource New Request for an ONTAP Resource and removed enhancement New feature or request labels Jan 6, 2025
Copy link
Contributor

@carchi8py carchi8py left a comment

Choose a reason for hiding this comment

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

So do you expect users to ever pass in the UUID vs name?

When we wrote the Ansible/Terraform modules/resource, we've already assume users would always use name, and we would treat UUID as more of a internal thing. As a user is having both name and UUID useful?

Optional: true,
Computed: true,
},
"id": schema.StringAttribute{
Copy link
Contributor

Choose a reason for hiding this comment

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

We try to use name all the time, as UUID is not something user friendly, and name itself can handle all functionality, so we have used name in all our Ansible/Terrafrom modules/resources. Unless you have an explicit case, let us know

@acch
Copy link
Author

acch commented Jan 13, 2025

There is an advantage of referencing dependent resources by their UUID: the ID is computed by ONTAP API, and hence it's "unknown" during plan-phase. Terraform uses this information when building its dependency graph, and implicitly understands that the dependent resources (e.g. svm or qos_policy) must be created first, before the svm_qos_policy_activation resource.

When referencing resources by their name, Terraform has no indication that one resource depends on the existence of another, and thus needs to be created first. It would attempt to create all resources in parallel (race condition). To prevent this, one would need to add the depends_on meta-argument.

So the following code...

resource "netapp-ontap_qos_policy" "this" {
  name = "test"
}
resource "netapp-ontap_svm_qos_policy_activation" "this" { 
  qos_policy = {
    id = netapp-ontap_qos_policy.this.id
  }
}

...is equivalent to the following code:

resource "netapp-ontap_qos_policy" "this" {
  name = "test"
}
resource "netapp-ontap_svm_qos_policy_activation" "this" { 
  qos_policy = {
    name = "test"
  }
  depends_on = [ netapp-ontap_qos_policy.this ]
}

Hence, I'd suggest to keep the UUID as an optional attribute - do you agree?

@acch acch force-pushed the 301-svm-qos-policy-activation branch from 8c5e7f1 to 35cfcb1 Compare January 13, 2025 14:50
@acch
Copy link
Author

acch commented Jan 13, 2025

I've manually added the documentation pages in the docs/ directory. Please let me know what else is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Resource New Request for an ONTAP Resource
Projects
Status: 2.1
Development

Successfully merging this pull request may close these issues.

[New Resource]: SVM QoS Policy Activation
6 participants