Error: "Step vsp_cluster_upgrade failed" during the VCFA upgrade
search cancel

Error: "Step vsp_cluster_upgrade failed" during the VCFA upgrade

book

Article ID: 462053

calendar_today

Updated On:

Products

VCF Automation

Issue/Introduction

While upgrading VCF Automation from 9.1.0 to 9.1.1, the upgrade fails with "Step vsp_cluster_upgrade failed", or the VCFA user interface is inaccessible because the Prelude apps are missing.

The trigger is the unexpected deletion of the vcfa-bundle PackageDeployment (PD) in the prelude namespace, which removes the VCFA apps. A PD recreated from an old backup does not restore them. One or more of the following symptoms may occur:

  1. The PD shows Failed with

    failed to generate helmrelease for template <name>: ... executing "tmpl" at <lower>: invalid value; expected string

    The template named in the message changes between reconciles.

  2. The vmsp-prelude-deployer Job fails with

    failed to perform "FetchReference" ... charts/prelude/<chart>:<version>: not found
  3. A HelmRelease fails with

    Helm upgrade failed ... "<release>" has no deployed releases
  4. The upgrade precheck fails on the Postgres on-demand WAL backup with

    curl: (56) OpenSSL SSL_read: ... ssl/tls alert unsupported certificate

Environment

VCF Automation 9.1.x

Cause

 

  • Incomplete PD values. The PD was recreated from a backup found in a support bundle. That backup was stale and carried only vcfa.debug and vcfa.fipsMode, with no vcfa.fqdn or ingress.vcfa.fqdn. The vcfa-common, vksm, and health-status release templates call <lower> on that FQDN, so rendering fails. Packages are rendered in random order and processing stops at the first error, which is why the failing template keeps changing.

  • Missing apps and artifacts. The images and charts are gone from the cluster registry, so the vmsp-prelude-deployer Job cannot pull charts and exits with status 1.

  • Stuck HelmRelease. The uninstall triggered by the PD deletion was interrupted. The Helm release history of vksm-stack was left with its last revision in uninstalling and no deployed revision, so Helm rejects every upgrade.

  • Postgres backup certificate error. The upgrade precheck fails on the on-demand WAL backup because of an unsupported SSL/TLS certificate.

 

Resolution

Follow the steps below to resolve the issue.

Step 1: Correct the PD values

  1. Restore the vcfa-bundle PD from a support bundle taken before the deletion, or from any previous backup of the PD. Check that the backup contains the deployment values, at least the FQDN (vcfa.fqdn or ingress.vcfa.fqdn):
    grep -n -i fqdn vcfa-bundle-pd.yaml
  2. Remove the server-populated metadata and the status section from the manifest, then restore it:
    kubectl apply -f vcfa-bundle-pd.yaml
  3. If a PD named vcfa-bundle already exists with incomplete values, do not delete it, because deleting a PD removes the apps. Replace it instead:

    kubectl replace -f vcfa-bundle-pd.yaml
    kubectl get pd vcfa-bundle -n prelude -o yaml

    The spec.values section should now hold the FQDN and ingress settings, and the <lower> render errors should stop.

Step 2: Re-stage the vcfa-bundle

  1. Re-staging restores the missing images and charts and recreates the deleted apps. Find the Bundle and check its package labels:
    kubectl get bundle -A
    kubectl get bundle <bundle-name> -n <namespace> -o jsonpath='{.spec.packages[0].labels}'
  2. Force the Bundle to re-push by adding the force-push label:
    kubectl patch bundle <bundle-name> -n <namespace> --type=json \
      -p="[{\"op\":\"add\",\"path\":\"/spec/packages/0/labels\",\"value\":{\"packages.vmsp.vmware.com/force-push-timestamp\":\"$(date +%s)\"}}]"
    Note: If the first command returned existing labels, include them in the value, because this patch replaces the whole labels map.
  3. Allow about 20 minutes, then check the status:
    kubectl get bundle -A
    kubectl get pd -n prelude
    kubectl get hr -n prelude
  4. Wait until the PD is Successful and the HelmReleases are Ready=True.

Step 3: Recover a HelmRelease stuck with "has no deployed releases"

  1. Check the release history and confirm no data is at risk:
    helm history vksm-stack -n prelude
    kubectl get kafka,pvc,sts,deploy -n prelude | grep -i vksm
    kubectl get pv | grep -i vksm
  2. If the latest revision is uninstalling (or every revision is failed or superseded), and no VKSM PersistentVolume is listed as Released or Available, back up and clear the Helm history:
    kubectl get secret -n prelude -l owner=helm,name=vksm-stack -o yaml > ~/vksm-stack-helm-secrets-backup.yaml
    kubectl patch hr vksm-stack -n prelude --type merge -p '{"spec":{"suspend":true}}'
    kubectl delete secret -n prelude -l owner=helm,name=vksm-stack
    kubectl patch hr vksm-stack -n prelude --type merge -p '{"spec":{"suspend":false}}'
    kubectl annotate hr vksm-stack -n prelude reconcile.fluxcd.io/requestedAt="$(date +%s)" --overwrite
  3. Flux will then perform a fresh installation. This can take upto 2 Hours. The HelmRelease will show Unknown ("Running 'install' action") while it runs.
    1. Important: If a VKSM PersistentVolume is listed as Released or Available, do not delete anything and contact Engineering.
    2. Do not use helm uninstall. It can remove the Kafka volumes.
    3. To undo this step, run: kubectl apply -f ~/vksm-stack-helm-secrets-backup.yaml

Step 4: Fix the Postgres backup certificate error

  1. Apply the fix documented in Broadcom KB 456307.
  2. To view the failure, run:
    kubectl logs <pg-backup-vcfapostgres-backup-pod> -n prelude

Step 5: Retry the upgrade to 9.1.1:

  • When the PD is Successful and all HelmReleases are Ready=True, restart the upgrade.

Verification:

  • Confirm the PD is Successful, all the HelmReleases are Ready=True, and vksm-stack has a deployed revision. Verify that the VCFA user interface is reachable.
    kubectl get pd vcfa-bundle -n prelude
    kubectl get hr -n prelude
    helm history vksm-stack -n prelude

Prevention:

  1. Restrict who can delete PackageDeployments in the prelude namespace.

  2. Keep a current copy of the PD, because a stale backup caused the missing FQDN issue

    kubectl get pd vcfa-bundle -n prelude -o yaml > ~/vcfa-bundle-pd-backup.yaml
  3. If a PD is deleted, check the Kubernetes audit logs to find out what/who deleted it.