Issue removing CNF from TCA UI when Delete and Terminate options are grayed out
search cancel

Issue removing CNF from TCA UI when Delete and Terminate options are grayed out

book

Article ID: 392643

calendar_today

Updated On:

Products

VMware Telco Cloud Automation VMware Telco Cloud Platform

Issue/Introduction

  • In TCA when you terminate the CNF from UI, the process will be successful, however the status sometimes is shown as "failed" or "Error" or stuck in "starting" state

  • Options:
  • The manual, out-of-band deletion of the Kubernetes namespace causes a state mismatch. The TCA database was left waiting for a status callback from a namespace that no longer existed, stranding the object.

  • CNF instantiation stuck at 10%

Environment

TCP: 5.0.1

TCA: 3.2

Cause

Mismatch between the status of the CNF at the UI and DB level after a failed upgrade attempt.

Resolution

Workaround:

Remove the CNF from the database

    1. Take a backup of the TCA Deployment. (Back Up a Deployment)

    2. Take a snapshot of TCA-M and TCA-CP appliances via vCenter

       

    3. SSH to the TCA-M

      1. To connect to Postgres DB:
        • Procedure For TCA 2.3.x
          connect-to-postgres

        • Procedure For TCA 3.x
          Run the below command:
          debug-tca-cluster

          Once new shell starts, then type
          debug-tca

          Then go to postgres
    4. From TCA UI, collect ID

    5. Go to CNF which is in "failed" / "error" state

    6. Select "General Properties" to collect ID. Example: "####1234"

    7. Once you have ID "####1234", run below command to make sure to get CNF list which you likely to remove

      select * from "Vnf" where (val->>'id') = '####1234';
    8. This will list the CNF matching ID, the output will look similar to below entry:

      989 | {"id": "####", "_links": {"self": {"href": "%svnflcm/%s/vnf_instances/e###############9"}}, "nfType": "CNF", "vnfdId": "nfd_############a", "rowType": "CNF", "vnfPkgId": "########-####-####-####-########", "isDeleted": false, "managedBy": {"extensionName": "####", "extensionSubtype": "####-####-####"}, "lastUpdated": "2024-09-25T18:51:07.108049", "vnfProvider": "####", "vnfdVersion": "1.0", "creationDate": "YYYY-MM-DDTHH:MM:SS", "creationUser": "[email protected]", "lcmOperation": "INSTANTIATE", "isolationMode": "permissive", "lastUpdateUser": "[email protected]", "vnfCatalogName": "####", "vnfProductName": "<Prod-Name>", "vnfInstanceName": "<Vnf_Name>", "lcmOperationState": "ROLLING_BACK", "vimConnectionInfo": {"id": "test_########", "extra": {"nodePoolName": ""<Nodepool_Name>}, "vimName": "<Vim_Name>"}, "creationEnterprise": "HybridityAdmin", "instantiatedNfInfo": {"test-data-####-####-####-####-########": {"vduId": "test-####-####", "repoUrl": "https://####/chartrepo/test_####-####", "entityId": "test-data-####-####-####-####-########", "password": "####", "username": "####", "chartName": "####-####-####", "namespace": "####-####", "extensionId": "########-####-####-########", "helmVersion": "v3", "chartVersion": "7.1.0+5", "dispatchType": "####.nodes.nfv.Vdu.Compute.Helm.####-####-####", "deploymentName": "########-####-####-########", "instantiationState": "SUCCESS"}}, "instantiationState": "NOT_INSTANTIATED", "vnfSoftwareVersion": "7.1.0+5", "creationOrganization": "HybridityAdmin", "lastUpdateEnterprise": "HybridityAdmin", "onboardedVnfPkgInfoId": "############", "lastUpdateOrgani
      zation": "HybridityAdmin", "vnfInstanceDescription": ""} | YYYY-MM-DDTHH:MM:SS | YYYY-MM-DDTHH:MM:SS

       

    9. In the output, make a note of "vnfInstanceName" , "lcmOperation" & "lcmOperationState", to make sure it matches with UI.

    10. Once, it is confirmed, run update command, replace ID_Value in below command with your ID

      UPDATE "Vnf" SET "val"="jsonb_set_recursive"( "jsonb_set_recursive"( val,'{lcmOperation}'::text[],'"Terminate"'::jsonb),'{lcmOperationState}'::text[],'"COMPLETED"'::jsonb) where (val ->>'id') = '<ID_Value>';
    11. In some cases we will have to set the instantiation status to "NOT_INSTANTIATED" using the below command : 

      UPDATE "Vnf" set val = val || '{"instantiationState": "NOT_INSTANTIATED"}' where (val ->>'id') = 'vnf-id';
    12. This command will update UI status as "Completed"; and you should now see option "delete" when clicking three icons of the CNF.