TCP: 5.0.1
TCA: 3.2
Mismatch between the status of the CNF at the UI and DB level after a failed upgrade attempt.
Remove the CNF from the database
Take a backup of the TCA Deployment. (Back Up a Deployment)
SSH to the TCA-M
connect-to-postgresdebug-tca-clusterdebug-tcaFrom TCA UI, collect ID
Go to CNF which is in "failed" / "error" state
Select "General Properties" to collect ID. Example: "####1234"
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';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
In the output, make a note of "vnfInstanceName" , "lcmOperation" & "lcmOperationState", to make sure it matches with UI.
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>';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';This command will update UI status as "Completed"; and you should now see option "delete" when clicking three icons of the CNF.