Generate Log bundle of the VCFA from the UI erroed out with the following Error :
Error Code: OnCreateLogBundleFailed
OnCreateLogBundleFailed
API failed with response: {"statusCode":404,"responseMessage":"Not Found","outputData":"404 page not found\n","token":null,"contentLength":19,"allHeaders":null}
VMware Cloud Foundation 9.0
Support bundle is an asynchronous task. When it is triggered, a task id is returned, so that LCM could monitor progress. Caused by an error , an incorrect task id was returned, causing LCM to report the error 404.
As a workaround generate the logbundle using the following ' breakglass ' method.
Requirements:
Steps:
ssh vmware-system-user@${NODE_IP} sudo -su root
export KUBECONFIG=/etc/kubernetes/admin.conf K8S_TOKEN=$(kubectl get secrets synthetic-checker-krp -n vmsp-platform -ojsonpath={.data.token} | base64 -d) PRIMARY_VIP=$(kubectl get gateway/vmsp-gateway -n istio-ingress -ojsonpath={.status.addresses[0].value})
curl -k -XPOST -H "Authorization: Bearer ${K8S_TOKEN}" "https://${PRIMARY_VIP}:30005/webhooks/vmsp-platform/supportbundle/list"
Output will look like this:
{"statusCode":200,"output":"File list length: 2\n","running":false,"outputValues":{"bundles":[{"mtime":"xxx, xx xxx xxxx hh:mm:ss GMT","name":"supportbundles/core-bundle-xxxxxxxx-xxxxxxxxx-xxxxx.tar.gz","size":xxxxxxxxxx},{"mtime":"xxx, xx xxx xxxx xx:xx:xx GMT","name":"supportbundles/vcfa-bundle-xxxxxxxx-xxxxxxxxx- xxxxx.tar.gz","size":xxxxxxxxxx}]},"id":"cqlrzx","completedAt":"xxxx-xx-xxxx:xx:xx"}
You can download any of these bundles from your machine. Make sure to set SSH_PASSWORD and PRIMARY_VIP accordingly. Bundle name is in the "name" field in the output above, like this:
curl -X GET -k -v -u -O "vmware-system-user:${SSH_PASSWORD}" https://${PRIMARY_VIP}/supportbundles/core-bundle-xxxxxxxx-xxxxxxxxx-xxxxx.tar.gz
curl -k -XPOST -H "Authorization: Bearer ${K8S_TOKEN}" https://${PRIMARY_VIP}:30005/webhooks/vmsp-platform/supportbundle/generate -d '{"component": "vcfa"}'
It will collect data for the last 2 days.
Output of this command has an "id" field that will be used to query the status of the command, i.e. "#####" here:
{ "running": true, "id": "#####", "statusURI": "/webhooks/vmsp-platform/supportbundle/generate/#####", "completedAt": null }
id="#####" curl -k -XGET -H "Authorization: Bearer ${K8S_TOKEN}" https://${PRIMARY_VIP}:30005/webhooks/vmsp-platform/supportbundle/generate/${id}
Repeat this command until the output looks like
{ "output": "<logs from the job>", "running": false, "outputValues": { "download_url": "https://<IP>/supportbundles/vcfa-bundle-xxxxxxxx-xxxxxxxxx.tar.gz", "expires_at": "xxxx-xx-xxxxxx:xx:xxx", "status": { "message": "Successful", "success": true } }, "id": "#####", "completedAt": "xxxx-xx-xxxxx:xx:xxx" }
If the job takes longer than 80 minutes, it will fail. If that happens, retry the generation from previous step with payload '{"component": "vcfa", "duration": "1"}'
curl -X GET -k -v -u "vmware-system-user:${SSH_PASSWORD}" -O ${download_url}