Closed Priteshkal closed 5 years ago
checking with the api team on this. 'state' is a read-write property https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/global-server-load-balancing/gslbvserver/gslbvserver/#properties
OTOH, there is also enable/disable
API available on this object.
This is a bug in the provider.
The state
attribute is relevant only when creating the resource.
To change the state
after creation you need to apply the disable or enable NITRO operation on the resource.
The following bash script shows how it is done.
enable_glsb_vserver () {
curl \
-H "Content-Type: application/json" \
-H "X-NITRO-USER: nsroot" \
-H "X-NITRO-PASS: nsroot" \
-d "{\"gslbvserver\": { \"name\": \"${SERVERNAME}\" }}" \
-k \
https://$NSIP/nitro/v1/config/gslbvserver?action=enable
}
disable_glsb_vserver () {
curl \
-H "Content-Type: application/json" \
-H "X-NITRO-USER: nsroot" \
-H "X-NITRO-PASS: nsroot" \
-d "{\"gslbvserver\": { \"name\": \"${SERVERNAME}\" }}" \
-k \
https://$NSIP/nitro/v1/config/gslbvserver?action=disable
}
The solution is to take into account when the state
attribute of the resource is different from the actual object attribute and then apply the disable/enable operation along with any other attribute changes.
We will address this as soon as we can.
Just wondering if there has been any progress on this?
No, not at the moment.
Just wondering if this work has been planned? Trying to get a timeline estimate for our sprint.
I am currently working on this issue.
There are a lot of resources that do not do the state handling correctly at the moment and I would like to put all these changes together in a single PR.
The full PR will handle correct disable/enable operation for the following resources
My estimate is that I will have the PR ready by mid next week.
I will let you know if there are any delays.
Pull request #56 resolves the issue of correctly handling the state
attribute change after creation of the resource.
Release v0.12.2 is the first one that contains this fix.
@Priteshkal let us know if this works out for you.
Thank You @giorgos-nikolopoulos! This works perfectly. Appreciate it.
Hi,
I am trying to do blue-green application deployments using GSLB as my application switch between blue-green application stack.
To begin with, I have my blue stack (lb_vserver->lb_servicegroup->servers) set as a "Disabled" service making traffic going only to my green stack (lb_vserver->lb_servicegroup->servers) which is set as an "enabled" gslbservice.
Now when I want to go in and do a application switch, I am trying to use terraform to update the state of my blue stack to "enabled" but I am getting the following errors on apply:
From the log file I see that:
The plan for this update shows correct updates but while applying them it fails.
Please let me know what you think is happening here since this service enable-disable is an integral part of our blue-green application deployment.
Thanks