现象说明

  • 很长时间没用 vCenter 了,一直是关机状态,开机之后发现 443 端口的服务一直显示 no healthy upstream,等了很久也是这样。
  • 登录 vCenter 5480 端口,查看到 vcenter server、vsphere web client 服务均未能启动。
  • 重启系统问题依旧存在
  • 手动启动 vcenter server服务,提示服务启动失败,让查看 https://vcenter7.corp.local/appliance/support-bundle 日志


现象分析及解法

问题出现后有预感是和 vCenter 证书过期有关,于是看了下 5480 端口的证书,果然显示已经过期。

在进行下列操作前,务必先给 vCenter 打快照!

在网上找到下列文章,里面讲解了如何处理证书过期的问题:

https://vkasaert.com/2023/02/13/expired-vcenter-certificates-how-to-get-back-in-the-game/

我运行里面的命令后,发现一堆证书过期:

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 After";done;

小提示:vCenter no healthy upstream 问题_无法登陆

继续按照提示运行下列命令:

/usr/lib/vmware-vmca/bin/certificate-manager

小提示:vCenter no healthy upstream 问题_证书过期_02

本来想使用选项 3 只去替换 Machine 证书,后来提示有其他证书也过期,需要使用选项 8:


 ERROR: The following solution user certificates are expired [machine, vsphere-webclient, vpxd, vpxd-extension, hvc]

 SOLUTION: Please use option 8 from the certificate-manager utility menu to reset the certificates

小提示:vCenter no healthy upstream 问题_no healthy upstream_03

虽然运行时有些报错,但最后还是执行完毕了

小提示:vCenter no healthy upstream 问题_证书过期_04

vCenter 访问也正常:

小提示:vCenter no healthy upstream 问题_证书过期_05

最后再次运行了证书检查命令,看到之前过期的证书都已被替换,而且还做了备份(bkp)

小提示:vCenter no healthy upstream 问题_no healthy upstream_06