Procedure to Backup and Restore NetScalers in HA Pair without Downtime

Procedure to Backup and Restore NetScalers in HA Pair without Downtime

book

Article ID: CTX235555

calendar_today

Updated On:

Description

The objective is to restore the configuration on a NetScaler HA pair, without causing any downtime for the users.


Instructions

When you take a backup of an instance in HA, the HA Propagation and Sync states get saved in this backup.
This means, that when you restore from backup, the restored appliance will either start syncing from the Primary, or propagating to the Secondary.

This can also be seen if you attempt to preform a backup via the SVM, on an SDX. or MAS

To get around this, you can either:
1.    Disable HA prop and Sync on the Primary and Secondary and save the config on both before taking backups
a.    This will mean that you will need to take backups of both instances in the HA
2.    Take the backup from the Primary
a.    Extract its contents
b.    Add the line “set HA node -haSync DISABLED -haProp DISABLED” to the ns.conf in the nsconfig folder, under the “add ns ip6” line
c.    Re-compress it in .tgz format and restore

After doing this, the below procedure will allow you to restore the HA pair, without any downtime.
•    Disable HA prop and sync on both nodes (VPX1 and VPX2)
•    Restore the configuration on the Secondary and reboot (VPX2)
•    Force failover so that VPX2 is Primary and VPX1 is Secondary
•    Restore the configuration on the Secondary and reboot (VPX1)
•    Re-enable HA prop and sync on both nodes (VPX1 and VPX2)
•    Optional: Force failover again so VPX1 is Primary again

Alternatively, you could set the Primary to STAYPRIMARY and Secondary to STAYSECONDARY, then restore only the Primary appliance.
This will be the simplest method, but would result in down time during the restore of the Primary.
 

Environment

The above mentioned 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 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 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 sample code. In no event should the code be used to support 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 SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

If you have 2 NetScalers in HA deployment, preforming a restore on either the Primary or Secondary can result in overwrites of the "correct" configuration, with the "incorrect" config, due to HA propagation and synchronization. This article looks at a manual way to override this behavior.

Additional Information

https://docs.citrix.com/en-us/netscaler/12/system/basic-operations/backup-restore-netscaler-appliance.html