How To Re-generate Certificates on LTS1 patch#13 if Hostagent Certificates are Expired

Problem

  • Hostagent certificate and other components certificates are expired and all nodes are marked as disconnected and unable to perform upgrades.

  • Performing Higher Version Upgrade is not re-generating hostagent certificates even when the certificates are not expired.

Environment

  • Platform9 Edge Cloud - v5.3 and Higher

  • Airctl

  • Hostagent Certificate

Procedure

circle-check
  • Login/SSH to Deployment Unit Host (DU Host).

  • Start MongoDB container and exec into it.

# docker start airctl-mongo
# docker exec -it airctl-mongo bash
  • Now inside airctl-mongo run the below commands:

circle-exclamation
  • Now open another terminal for Deployment Unit Host and start the pf9deployExec container using the below command and exec into it to export the mentioned env variables:

  • The above check-certs would show the certs version and denote if it's expiring.

  • Now generate certs and check using:

  • Now dump the MongoDB data using airctl:

  • Once the new certs are generated, you stop the pf9deployExec and airctl-mongo containers and delete the pf9deployExe container using:

  • Now we can start with the Same Version or Higher Version upgrade using the steps mentioned in the Upgradearrow-up-right documentation. Only follow steps in that page till the **Upgrade DU section** section.

triangle-exclamation
circle-exclamation
  • Copying new hostagent certificates to individual hosts:

  • Once these certificates are generated, they can be checked by the following steps:

    • SSH into the DU Host.

    • Then, SSH into the DU VM. The IP address of the DU VM is the dhcpEndIp in /opt/pf9/airctl/conf/airctl-config.yaml. The default value is 192.168.120.254.

    • Go to /etc/pf9/certs directory and check for v* certs which are created as a part of the upgrade or manually using the workaround above. If there is no such directory here, then the new certificates weren't generated successfully.

  • After verifying that these certificates are present in the DU VM, return to the DU host and then run the script mentioned below to copy these certificates from the DU VM to the individual DU hosts. The provided script will copy the new certificates to each individual host.

  • Once this script runs successfully, SSH into the individual hosts with centos user and then check the certificate validity in the /etc/pf9/certs directory. This certificate validity should match with the certificate validity of the new certificate /etc/pf9/certs/v*/ that was generated previously on the DU VM. Additionally, /etc/pf9/hostagent.conf should reflect the latest cert_version now.

  • The status of pf9-comms and pf9-hostagent services should also be up and running. This can be verified by running this command: systemctl status pf9-comms pf9-hostagent

  • The older host certificates (stored in /etc/pf9/certs/ before replacement) and hostagent.conf will be stored in /tmp/temp-date-XXXXXX directory for backup.

  • Final Step: Perform host upgrade using steps mentioned here Configure Host and HostAgent Upgradearrow-up-right.

Last updated