Integrate external components to backup and restore Telco Cloud Automation (TCA) managed Tanzu Kubernetes Gid (TKG) workload clusters
search cancel

Integrate external components to backup and restore Telco Cloud Automation (TCA) managed Tanzu Kubernetes Gid (TKG) workload clusters

book

Article ID: 325373

calendar_today

Updated On:

Products

VMware Telco Cloud Automation Tanzu Kubernetes Grid

Issue/Introduction

To provide a guide for TCA customers who intend to backup and restore entire TKG workload clusters.

Environment

VMware Telco Cloud Automation 2.2

Cause

TCA provides Velero addon to backup and restore a workload cluster through TCA web interface 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.

Resolution

TCA provides 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 workaround below will demonstrate the solution about how to integrate an external backup/restore product or component with TCA API.

Workaround:
Note: Replace the following variables with the appropriate referring value:
VariableReferring Value
tca_m_ipTCA Manager IP
sso_vc_pwdSSO vCenter Password
mc_nameMaster Cluster Name
tcacp_idTCA CP IP
cluster_nameCluster Name
cnf_instance_idCNF Instance ID
vim_tenant_idVIM Tenant ID
 

Obtain TCA IDs using API:

tcacp_id: (will return tcacp_id for each cluster)

curl -X GET https://tca_m_ip/telco/api/caas/v2/clusters -H  "accept: application/json"

cnf_id (will return all CNF IDst):

curl -X GET https://tca_m_ip/telco/api/vnflcm/v2/extension/vnf_instances -H  "accept: application/json"

vim_tenant_id: (will return all VIM tenant IDs)

curl -X GET https://tca_m_ip/hybridity/api/vims/v1/tenants -H  "accept: application/json"

 

Procedure

  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 API details are described at https://tca_m_ip/hybridity/docs/index.html
  1. Backup the target cluster with the external backup/restore product or component.
  2. Create a new workload cluster with Copy Specification and Deploy new Cluster through the TCA UI or API:
    1. GET information of the 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
  3. Restore to new workload cluster with the external backup/restore product or component.
  4. Remedy CNF instances to new cluster:
    1. GET all CNF instances which belong to the 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
      Set new cluster as the target VIM and set below two attributes in payload:
          "disableGrant": True,
          "disableHelmInstall": True,
  5. Cleanup stale CNF instances and the old cluster:
    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