Part 1: Introduction and getting started.

Part 2: Basic operations and initial configuration.

Part 3: SSL certificates and StoreFront load balancing.

Part 4: NetScaler Gateway with StoreFront configuration.

Part 5: High Availability configuration.

After configuring all of the use cases in the previous parts of this blog post series, we’re going to make it all highly available. The use case we’ll be looking at is high availability (HA) pairing.

Configuring High Availability for NetScaler

Two common methods to use for high availability in NetScaler are High Availability (HA) pairing or Clustering. HA pairing that we’ll go over uses two NetScaler appliances where the fully configured one is the primary and active one while the secondary one is passive. For the automation that we’ll cover (and high availability) to work requires that the second appliance has:

  • The same version and model of NetScaler as the primary node.
  • The initial startup configuration set up such as NetScaler IP (NSIP) address for management, along with the subnet mask and gateway.
  • The same licensing added (which requires a reboot to read it) as the primary node.

For additional details, visit the latest High Availability documentation in edocs. As of this writing, the latest available is here.

Creating a new NetScaler HA configuration
(New-NSHighAvailabilityPair example)

To create an HA pair, ensure that you have fully configured the items discussed in the previous parts of this blog series on the first node and follow the requirements outlined above for the second node. After this, you can call the function from the NetScaler Configuration example PS module as follows:

New-NSHighAvailabilityPair -PrimaryNSSession $PrimarySession -SecondaryNSSession $SecondarySession -SaveAfterSync

The SaveAfterSync parameter is recommended because it waits until the NetScaler appliances have synchronized and saves the NetScaler configuration to ensure that both nodes have the necessary ns.conf settings to be able to start up in the case of a reboot.

Get the example PowerShell Module and scripts (Part 5)

NetScalerConfiguration PS module and example scripts (and it includes all previous parts!)

Conclusion

In the 5 parts of this blog series we went over how the NITRO REST API can be wrapped with a multi-purpose function using PowerShell. We also used that function to configure various resources and combined them into use cases where we continued using PowerShell to automate them. Now, you can take this module and build it up as needed with new functions that apply to other use cases. Be sure to review the API reference (through the NITRO API Documentation link found on the Downloads page in the NetScaler web console) to learn more about other functionality.

Happy Scripting!
Santiago Cardenas

Citrix Solutions Lab

Disclaimer:

This software / sample code is provided to you “AS IS” with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software / sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software / sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software / sample code. In no event should the software / code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE / SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.