Perform Backup

Scenario Overview

Crosswork Network Controller backup process depends on having SCP access to a server with sufficient storage space. The storage required for each backup will vary based on your cluster size, applications in the cluster, and scale requirements. The time taken for the backup or restore processes will vary based on the type of backup, your cluster size, and the applications in the cluster.

Prerequisites

Before running this example, ensure to obtain access token. Refer 'Getting Started' section. Make sure below steps are performed:

  1. Configure a destination SCP server for storing backup files during your first login. This is a one-time setup and must be completed before taking backups or initiating restore operations.

  2. Perform backup or restore operations during a scheduled maintenance window. Users should not access the system during these operations. Backups will take the system offline for about 10 minutes, while restore operations can be lengthy and pause other applications, affecting data-collection jobs.

  3. Only one backup or restore operation can run at a time.

  4. Ensure both the Crosswork Network Controller cluster and the SCP server are in the same IP environment (e.g., both using IPv6).

  5. By default, backups are not allowed if the system is not considered healthy, but this can be overridden for troubleshooting purposes.

Perform Backup

Run the script _perform_backup from the example directory.

cd cnc-bnr-api-examples;./perform_backup.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

perform_backup() {
    # assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
    # read from jwt file and export it as AUTH_TOKEN_HDR
     export_jwt

    # STEP 1 :  User to update input json with details of job to be created in the file CNC_API_INPUT
    # STEP 2 :  trigger perform backup API
    # STEP 3 :  store the output in CNC_API_OUTPUT file

    CNC_BNR_API=$CNC_BNR_API_CTX/user
    CNC_API_INPUT="@$PRJ/input/perform_backup.json"	 
    CNC_API_OUTPUT="$PRJ/output/perform_backup_response.json"
    http_post $CNC_API_URL $CNC_API_INPUT $CNC_API_OUTPUT
    
}
perform_backup