How to backup/restore a workload cluster and remedy associated Container Network Functions (CNFs)
search cancel

How to backup/restore a workload cluster and remedy associated Container Network Functions (CNFs)

book

Article ID: 325360

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

The purpose of this KB is to provide a guide for customers using Telco Cloud Automation (TCA) who intend to backup and restore Tanzu Kubernetes Grid (TKG) workload clusters.

TCA provides the Velero addon to backup and restore a workload cluster through the TCA web and command line interface. Besides that, customer may require some external components (for example a commercial backup product) to be included for cluster backup and restore as part of the overall solution.
 
TCA provides a REST API to backup and restore a TKG workload cluster and remedy CNFs in addition to TCA web interface. It’s supported to use the API to integrate required external components and TCA as a backup and restore solution. For example, when integrating with another backup/restore product, a solution is to backup or restore the TKG workload clusters directly with backup/restore product and then call TCA API to handle rest procedures such as creating new workload clusters and remedying CNFs in the restored clusters. The instructions below will demonstrate the solution about how to integrate an external backup/restore product or component with TCA API.

Environment

2.x, 3.x

Resolution

The following variables are used throughout the following commands. Ensure the variable is replaced with the corresponding values.

$tca_m_ip
$sso_vc_pwd
$tca_m_ip
$mc_name
$tcacp_id
$cluster_name
$cnf_instance_id
$vim_tenant_id
  1. Obtain the TCA API authorization token y running the following command:
curl -X POST "https://$tca_m_ip/hybridity/api/sessions" -H "accept: application/json" -H "Accept: application/json" -H "Content-Type: application/json" -d "{ \"username\": \"[email protected]\", \"password\": \"$sso_vc_pwd\"}" -k -D - | grep x-hm-authorization: | awk '{print $2}' | sed 's/\r$//'

 

Note: All APIs details are described in

 https://$tca_m_ip/hybridity/docs/index.html
  1. Backup target clusters with external components.
  2. Create a new workload cluster with Copy Specification and Deploy new Cluster through TCA UI or API.
    1. GET information of old target clusters
      https://$tca_m_ip/telco/api/caas/v2/clusters

    2. POST to create new cluster
      https://$tca_m_ip/telco/api/caas/v2/clusters?mgmtClusterName=$mc_name&tcaCpId=$tcacp_id

    3. POST to create all Addons in new cluster
      https://$tca_m_ip/telco/api/caas/v2/clusters/$cluster_name/addons?mgmtClusterName=$mc_name&tcaCpId=$tcacp_id

    4. POST to create all node pools in new cluster
      https://$tca_m_ip/telco/api/caas/v2/clusters/$cluster_name/nodepools?mgmtClusterName=$mc_name&tcaCpId=$tcacp_id

  1. Restore to new workload cluster with 3rd partner product.
  2. Remedy CNF instances to new cluster
    1. GET all CNF instances which belong to old cluster and need to be remedied to new cluster
      https://$tca_m_ip/telco/api/vnflcm/v2/extension/vnf_instances

    2. POST to remedy a CNF instance to new cluster
      https://$tca_m_ip/telco/api/vnflcm/v2/vnf_instances

    3. Set new cluster as target VIM and set below two attributes in payload:
          "disableGrant": True,
          "disableHelmInstall": True,

  3. Cleanup stale CNF instances and old clusters
    1. POST to terminate stale CNF instances
      https://$tca_m_ip/telco/api/vnflcm/v2/vnf_instances/$cnf_instance_id/terminate

    2. DELETE stale CNF instances
      https://$tca_m_ip/telco/api/vnflcm/v2/vnf_instances/$cnf_instance_id?isForce=true
    3. DELETE stale WC from Virtual Infrastructure
      https://$tca_m_ip/hybridity/api/vims/v1/tenants/$vim_tenant_id

    4. DELETE stale WC from Caas Infrastructure
      https://$tca_m_ip/telco/api/caas/v2/clusters/%s?mgmtClusterName=$mc_name&tcaCpId=$tcacp_id