Jump to content
Welcome to our new Citrix community!

Content Switch Policy Bind - Auto Increment Priority ?

Recommended Posts

I have a script that allows me to build out VIPs by filling out a few variables - it then spits out all the commands I need to run via CLI to build a VIP that meets our standard naming convention, rewrite policies, builds the GSLB hostnames, etc.


I can simply take this output, paste it in an SSH session and its online.


The problem I have is, when building content-switched services, I have to manually login to the GUI to bind the CS policy to the CS server, as there is no way via CLI to automatically select the next available priority. 99% of the time it is totally ok for the next service to be put at the bottom of the list.


If I knew the next available policy number, I could obviously add it to my command set before running, but that requires looking at the binding order first which takes away from the automation aspect of the script.

What would be a total life saver is if there was a way to have the -priority auto increment to the next available with a flag or by default.


bind cs vserver cs-ContentSwitch -policyName pol-cs-VirtualServer -targetLBVserver vst-VirtualServer -priority ++


While my workaround today is to perform the "last mile" configuration via GUI, if we move this to an automation platform like vRA/vRO than this becomes extremely tedious if not impossible.


In summary this is a feature request/feedback request from anyone else having this similar problem.

Link to comment
Share on other sites

57 minutes ago, Rhonda Rowland1709152125 said:

I think the problem is if you are adding policies to an existing entity as opposed to doing all the bindings in this particular script run, so your script would have to first retrieve last policy priority and then add the new value.  As opposed to a command parameter in the netscaler to automatically add to next.  


Rhonda is correct, these are policy bindings that are added at separate times, so I don't know what the next priority value would be without looking it up first.


In my example above the ++ is just an example of what would be a neat accepted value, to automatically pick the next priority number available on the CS.

Link to comment
Share on other sites

Anthony:  I think, you might have to write your script, where you can provide the starting priority to use as an input and it could then autonumber, but making it look up th evalue and then start priorities is tricky. But I do agree it would be nice if the priority parameter could take <integer> or <nextavailablepriority> as an accepted value.  I don't think there's going to be an easy way unless you can give the script something to work off of like the starting priority in the script inputs, or make the script check the current vserver, find the bound policies, and start from the last value.


Mathieu:  I agree with the challenge of making the cli fully scriptable due to complexity in policies.  I'm not sure stylebooks really help as any value they work off of is hardcoded, so it still can't "lookup" the last available priority and start from there (that I know of). You might be able to have it incr priorities in a given run, but not lookup a value that varies from run to run...however, I would love to be wrong about that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...