Straypenguins-Tips-Inventory

vCSA Certificate Replacement and Renewal Procedures

🧭 Overall policy

Pre-Renewal Checklist

Post-Renewal Checklist

After completing certificate renewal procedures, it is essential to verify the health and status of the vCenter Server and its certificates.


šŸ› ļø Procedures for vCert

vCert.py is primarily designed for use via its interactive menu. While it does support direct operations with the --run option by specifying the path to a particular YAML file, this usually requires more typing, and the other command-line options are quite limited.

However, depending on the situation, using the --run option for specific operations can be beneficial. For your convenience, the table vCert.py direct operation arguments in the separate file vcsa-cert-list-chart.md summarizes the available YAML file paths for each operation category.

Procedures

  1. Run vCert.py:
    Start by just ./vCert.py. If you pass --user <user@vphere> --password <pswd>, authentication prior to each authoritative operation is omitted.

  2. Check current certificate status:
    In the main menu, select ā€œ1. Check current certificate statusā€ and proceed.

  3. Try full-auto renewal first:
    Choose ā€œ6. Reset all certificates with VMCA-signed certificatesā€ in the main menu and proceed.

  4. Service restart prompt:
    Answer ā€œNā€ (default) to ā€œRestart VMware services [N]: ā€œ prompt, if succeeded or failed.

  5. Check logs for errors after vCert.py runs (optional, for extra caution):
    • Review /var/log/vmware/vmcad/ and /var/log/vmware/vmware/sso/ for signs of certificate renewal problems.
    • Check the own log files of vCert.py. Official Web document say (extract);

      The script will create /var/log/vmware/vCert/vCert.log (which will be included in a support bundle), and a directory in /root/vCert-master with the name format ā€˜YYYYMMDD’, which will include several sub-directories for staging, backups, etc. Other than certificate backup files, the temporary files are deleted when the vCert tool exits.

  6. Post-renewal verification and service restart:
    • If the recreation of certificates was successful, choose ā€œ8. Restart servicesā€ in the main menu. (This will take some time.)
    • After services restart, re-run the certificate status one-liner above to confirm expiry dates are updated.
    • Also check for any vCenter alerts or certificate-related warnings in the UI.
  7. If the recreation failed, fully or partially:
    1. Select ā€œ1. Check current certificate statusā€ in the main menu to check which certificates failed.
    2. Also, check with the one-liner command:
      for store in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list | grep -v TRUSTED_ROOT_CRLS); do echo "[*] Store :" $store; /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $store --text | grep -ie "Alias" -ie "Not Before" -ie "Not After"; done
      
    3. Try recreating certificates per Certificate-Type, by selecting ā€œ3. Manage certificatesā€ in the main menu and proceeding to the specific sub menu such as ā€œ2. Solution User certificatesā€. Check the status of the certificates again.

      Refer to the chart vCert.py Operation for each certificate in the separate file vcsa-cert-list-chart.md for correct menu entries.

    4. If any of the certificates were updated, check for consistency in Extension Thumbprints by selecting ā€œ3. Manage certificatesā€ in the main menu then ā€œ6. vCenter Extension thumbprintsā€ (or directly run ./vCert.py --run config/manage_cert/op_manage-vc-ext-thumbprints.yaml). If any MISMATCH are found, proceed with ā€œYā€ to solve.
    5. After complete renewal of all the failed certificates, go back to the main menu and select ā€œ8. Restart servicesā€. (This will take some time.)
  8. Final health check:
    Verify the vCSA service health and certificate validity. For detailed verification steps, refer to the ā€œPost-Renewal Checklistā€ section under ā€œOverall policyā€ at the beginning of this document.

šŸ’” Tips:


šŸ› ļø Procedures for fixcerts.py

fixcerts.py has occasionally been reported to have stability issues, where renewal may succeed for some certificate types but not others. However, in practice, it has proven to be reliable in many cases. To further reduce the possibility of renewal failures, it is recommended to perform staged renewals by certificate type rather than renewing all at once. Always use the latest version (fixcerts_3_2.py at the time of writing).

Procedures

  1. Run fixcerts.py per certificate-type:
    • Execute the script for each certificate-type individually, using appropriate command-line options. For example:
      ./fixcerts.py replace --certType machinessl --validityDays 3650 --serviceRestart False
      

      Key Points:

      • Change the --certType argument for each run to match the certificate-type.
        Refer to the chart fixcerts.py Operation for each certificate in the separate file vcsa-cert-list-chart.md for correct values (e.g. machinessl, solutionusers, etc.).
      • Use the --validityDays option to extend certificate validity, if desired.
        šŸ’” The actual period of generated certificates cannot exceed the expiry of the root CA—even if a longer value is specified, the certificates will expire at the root CA’s end date.
      • Always set --serviceRestart False for each run. You will restart services after all renewals are complete.
      • Consider passing the --debug option to increase verbosity and aid troubleshooting.
      • Consider running the script in an SSH session with logging enabled to capture all console output.
      • šŸ’” fixcerts.py does not provide an interactive menu; all operations are done via command-line arguments.
  2. Verify certificate renewal after each type:
    • After each certificate-type renewal, run the certificate status one-liner (or the dedicated script file) to confirm expiry dates have changed:
      for store in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list | grep -v TRUSTED_ROOT_CRLS); do echo "[*] Store :" $store; /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $store --text | grep -ie "Alias" -ie "Not Before" -ie "Not After"; done
      
    • Especially after renewal of STS or lookupservice related certificates, check by running;
      ./vCert.py --run config/view_cert/op_view_11-sts.yaml
      
    • Review for any certificates that were not updated.
  3. Check logs for errors after each run (optional, for extra caution):
    • Check standard system logs for issues:
      • /var/log/vmware/vmcad/
      • /var/log/vmware/vmware/sso/
    • Check fixcerts.py’s own log file:
      • fixcerts.log (found in the current working directory where the script was executed).
  4. Troubleshoot and retry failed renewals:
    • If any certificate-type fails to renew, attempt rerunning fixcerts.py for that type.
    • Use the --debug option for more detailed error output.
    • If failures persist, consider manual renewal using vecs-cli or consult official product support documentation.
    • If any of the certificates were updated, check for consistency in Extension Thumbprints by running;
      ./vCert.py --run config/manage_cert/op_manage-vc-ext-thumbprints.yaml
      

      If any MISMATCH are found, proceed with ā€œYā€ to solve.

  5. Restart services after all renewals:
    • Once all certificate-types have been renewed successfully, restart vCSA services to apply changes by running:
      service-control --stop --all && service-control --start --all
      

      This is the recommended and safe method to restart services, as used internally by fixcerts.py itself.

  6. Final health check and post-renewal verification:
    Verify the vCSA service health and certificate validity. For detailed verification steps, refer to the ā€œPost-Renewal Checklistā€ section under ā€œOverall policyā€ at the beginning of this document.

šŸ’” Tips: