NetApp / terraform-provider-netapp-ontap

Terrafrom ONTAP provider
https://registry.terraform.io/providers/NetApp/netapp-ontap/latest
Mozilla Public License 2.0
17 stars 8 forks source link

[New Resource]: SVM QoS Policy Activation #301

Open acch opened 1 month ago

acch commented 1 month ago

Description

Ability to activate (existing) QoS policy for (existing) SVM

Requested Resource(s) and/or Data Source(s)

Potential Terraform Configuration

// example SVM
resource "netapp-ontap_svm" "svm1" {
  name = "svm1"
}

// example policy
resource "netapp-ontap_qos_policies" "policy1" {
  name     = "policy1"
  svm_name = netapp-ontap_svm.svm1.name
}

// activate example policy for example SVM
resource "netapp-ontap_svm_qos_policy_activation" "svm1_policy1" { 
  svm_name        = netapp_ontap_svm.svm1.name
  qos_policy_name = netapp_ontap_qos_policies.policy1.name
}

References

Would you like to implement a fix?

Yes

carchi8py commented 1 month ago

hmmmm we'll need to look at how we are going to do this. I don't think we need a specific resource for this and should be able to do it in SVM, but let me see how that would work.

acch commented 1 month ago

@carchi8py Thanks for looking into this!

My understanding is that QoS policy activation is a multi-step process (taken from here):

  1. Create SVM: vserver create -vserver svm1
  2. Create QoS policy: qos policy-group create -policy-group policy1 -vserver svm1
  3. Apply policy group to SVM: vserver modify -vserver svm1 -qos-policy-group policy1

Creating the policy group is only possible after the SVM / vserver exists. Hence, activating it is a separate step - it can't be activated upon initial creation... but I might be missing something here!

That's why I've opted for a separate resource to model the association of SVM <-> policy. Again, this might be due to my limited understanding - let me know if there's a more elegant way to do it.

Thanks again, and all the best! Achim