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

[Bug]: Weight and state not pulled correctly in terraform state, device updates don't show #1134

Closed
gusmb opened this issue Apr 8, 2024 · 4 comments · Fixed by #1140
Closed
Assignees
Labels
bug In-Progress ..being worked upon

Comments

@gusmb
Copy link

gusmb commented Apr 8, 2024

Terraform Core Version

1.7.5

citrixadc Provider Version

1.37.0

Operating system

RHEL7

Affected Resource(s)

  • citrixadc_servicegroup_servicegroupmember_binding
  • citrixadc_servicegroup_lbmonitor_binding

Equivalent NetScaler CLI Command

bind servicegroup s1 -monitorName tcp -weight 100

Expected Behavior

after running a terraform plan command, the monitor weight should be restored to the intended value declared in the Terraform manifest (since it is not an updateable attribute, Terraform plan should result on a resource being destroyed and re-created)

Actual Behavior

Terraform plan shows no changes required to the infrastructure, even though a monitor binding weight has been manually changed in the Netscaler

Relevant Error/Panic Output Snippet

N/A

Terraform Configuration Files

Example resources:

resource "citrixadc_servicegroup_servicegroupmember_binding" "sample-https-pool-443-s1" {
  provider         = citrixadc.PARTITION1
  servicegroupname = "SVG_SAMPLE_443_1"
  servername       = "s1"
  port             = 443
  weight           = 1
  depends_on = [citrixadc_servicegroup.sample-https-pool-443]
}
resource "citrixadc_servicegroup_lbmonitor_binding" "sample-https-pool-443-sample-monitor-http-s1" {
  provider         = citrixadc.PARTITION1
  servicegroupname = "SVG_SAMPLE_443_1"
  monitorname      = "M_S1_443_HTTP"
  weight           = 1
  depends_on = [citrixadc_servicegroup.sample-https-pool-443, citrixadc_lbmonitor.sample-monitor-http-s1]
}

Steps to Reproduce

  1. Configure resources with Terraform
  2. Login to the Netscaler and directly update weight on either of the 2 resource types
  3. run terraform state pull or terraform plan
  4. Terraform does not detect any changes, even though the weight of the bindings have changed in the load balancer
  • NOTE: same thing happens with the state parameter of the citrixadc_servicegroup_lbmonitor_binding resource

Debug Output

N/A

Panic Output

N/A

Important Factoids

No response

References

No response

@gusmb gusmb added the bug label Apr 8, 2024
@rohit-myali
Copy link
Contributor

Hello @gusmb
Thanks for raising the issue.

I'm able to reproduce the error for weight attribute and I have fixed it, we will release it in our next release. But I'm not able to reproduce for state attribute.

Can you give me steps to reproduce.?

@gusmb
Copy link
Author

gusmb commented Apr 15, 2024

Hello @gusmb Thanks for raising the issue.

I'm able to reproduce the error for weight attribute and I have fixed it, we will release it in our next release. But I'm not able to reproduce for state attribute.

Can you give me steps to reproduce.?

I think the issue was that I wasn't explicitely specifying the monstate parameter in the binding resource declaration. The assumption of the default value is not enough. Once I added monstate = "ENABLED", it works as expected.
Thanks for fixing the weight parameter issue

@gusmb
Copy link
Author

gusmb commented Apr 15, 2024

Hello @gusmb Thanks for raising the issue.
I'm able to reproduce the error for weight attribute and I have fixed it, we will release it in our next release. But I'm not able to reproduce for state attribute.
Can you give me steps to reproduce.?

I think the issue was that I wasn't explicitely specifying the monstate parameter in the binding resource declaration. The assumption of the default value is not enough. Once I added monstate = "ENABLED", it works as expected. Thanks for fixing the weight parameter issue

resource "citrixadc_servicegroup_lbmonitor_binding" "sample-https-pool-443-sample-monitor-http-s1" {
  provider         = citrixadc.PARTITION1
  servicegroupname = "SVG_SAMPLE_443_1"
  monitorname      = "M_S1_443_HTTP"
  weight           = 1
  monstate     = "ENABLED"
  depends_on = [citrixadc_servicegroup.sample-https-pool-443, citrixadc_lbmonitor.sample-monitor-http-s1]
}

@rohit-myali
Copy link
Contributor

Hello @gusmb
We have fixed this and it is now available in the terraform registry. Please download the latest terraform-provider-citrixadc version v1.38.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug In-Progress ..being worked upon
Projects
None yet
2 participants