【VMware vCenter】vCenter Server 各版本證書有效期及過期解決辦法。

JUNIOR_MU發表於2024-09-14

這篇(VMware vCenter Server(VCSA) 5.5 版本證書過期問題處理過程。)文章闡述了有關 vCenter Server 證書過期的處理過程,整個過程相對來說比較複雜並且有的地方可能也沒有說清楚,因此我想在此篇文章中重新做一個針對 vCenter Server 證書相關的彙總,以方便有需要的朋友進行查閱和參考。當然,不是說這篇文章會把這個事情講清楚,肯定沒法一次性說清楚並且也不一定完全正確,所以,有關更多內容和細節建議還是請檢視 VMware 官方產品文件《vSphere Authentication》

一、vCenter Server 所使用的證書型別

vCenter Server 中使用了各種各樣的證書來確保相關元件服務能夠互相驗證以及加密通訊,預設情況下,vSphere 使用 VMware Certificate Authority (VMCA) 證書頒發機構置備 vCenter Server 的相關證書,並且這些證書儲存在 VMware Endpoint Certificate Store (VECS)端點證書儲存中。雖然 vCenter Server 支援使用自簽名證書來替換 vSphere 證書管理模式中由 VMCA 置備的證書,比如計算機 SSL 證書,但是這樣會大大增加 vSphere 證書管理的複雜度,因為必須人工安裝和管理這些證書,除非企業內部有嚴格的證書管理要求,否則使用 VMCA 就已經足夠安全和值得信賴了。

vCenter Server 證書型別 置備方式 VECS 證書庫 備註
根證書 VMCA TRUSTED_ROOTS 包含所有受信任的根證書。
計算機 SSL 證書 VMCA MACHINE_SSL_CERT 計算機 SSL 證書用於計算機的安全 SSL 連線。
解決方案使用者證書 VMCA

machine

vpxd

vpxd-extension

vsphere-webclient

wcp

Machine 解決方案使用者證書用於進行 SAML 令牌交換,與計算機 SSL 證書沒有任何關係。
其他證書

VMCA

SMS

BACK_STORE

......

vSphere Certificate Manager 實用程式的備份庫 (BACKUP_STORE)。
內部證書 VMCA STS (*)

Security Token Service (STS) 是一項釋出、驗證和續訂安全令牌的 Web 服務。

注*:作為令牌頒發者,Security Token Service (STS) 使用私鑰對令牌進行簽名,併發布公用證書供服務驗證令牌簽名。vCenter Server 管理 STS 簽名證書並將其儲存在 VMware Directory Service (vmdir) 中。

二、vCenter Server 各版本證書有效期

當 vCenter Server 初始安裝過後,這些證書已經預設由 VMCA 置備到系統當中,並且不同型別的證書具有不同的有效期,如下表所示(來源於 SS-Engineer)。我們在使用 vCenter Server 時,最好將這些證書的監控管理加入到運維工作當中,如果在證書過期前沒有得到處理, vCenter Server 相關服務可能會出現故障。

vCenter Server 版本 根證書 計算機 SSL 證書 解決方案使用者證書 STS 證書
6.5 10 年 10 年 10 年 10 年
6.5 U1 10 年 10 年 10 年 10 年
6.5 U2 10 年 2 年 2 年 2 年
6.5 U3 10 年 2 年 2 年 2 年
6.7 10 年 10 年 10 年 10 年
6.7 U1 10 年 10 年 10 年 10 年
6.7 U2 10 年 10 年 10 年 10 年
6.7 U3F及更低 10 年 10 年 10 年 10 年
6.7 U3G及更高 10 年 2 年 2 年 10 年
7.0 10 年 2 年 10 年(*) 10 年
7.0 U1 10 年 2 年 10 年(*) 10 年
7.0 U2 10 年 2 年 10 年(*) 10 年
7.0 U3 10 年 2 年 10 年 10 年
8.0 10 年 2 年 10 年 10 年
8.0 U1 10 年 2 年 10 年 10 年
8.0 U2 10 年 2 年 10 年 10 年
8.0 U3 10 年 2 年 10 年 10 年

注*:從 vCenter Server 7.0 開始,WCP 證書已經新增至解決方案使用者證書當中,並且在 7.0、7.0 U1 以及 7.0 U2 版本中,WCP 證書的有效期為 2 年,而從 7.0 U3 版本開始,WCP 證書的有效期為 10 年。如果從 7.0、7.0 U1 以及 7.0 U2 版本升級到 7.0 U3 及之後的版本,WCP 證書的有效期自動延長至 10 年。除此證書之外,如果 vCenter Server 從當前版本升級到更新的版本,升級後的版本依然會繼承之前舊版本的證書到期日期,這一點需要特別注意。

三、vCenter Server 證書過期解決辦法

如何監控和管理 vCenter Server 的各種證書,確實是一件麻煩並且令人困惑的事情。當證書快要過期時,有的證書會提前在 vSphere Client 告警,但是有的證書卻又不會,比如 STS 證書(早期 vSphere 版本)。有的證書可以透過 vSphere Client 檢視其狀態並管理更新,而有的證書又只能透過 CLI 命令列檢視狀態和管理更新。這個確實沒有什麼比較好的辦法,可以完美的同時解決 vCenter Server 所有證書的統一監控管理,因此,下面為大家收集歸納了相關連結,希望能夠幫助並解決 vCenter Server 證書過期問題。

在執行證書替換或更新操作時,可能需要停止和啟動 vCenter Server 相關服務,參考以下連結瞭解如何管理 vCenter Server 相關服務;也許還會用到相關連結中的指令碼檔案,如果將檔案上傳至 vCenter Server 遇到問題,以下連結也許可以幫助到你。

  • Stop, Start or Restart Services on vCenter Server 6.x or Higher (KB 2109881)
  • Connecting to vCenter Server Virtual Appliance using WinSCP fails with the error: Received too large (1433299822 B) SFTP packet. Max supported packet size is 1024000 B (KB 2107727)

由於證書過期問題,vCenter Server 服務會變得不可用,無法登入 vSphere Client 檢視執行狀態,以下連結可以幫助你如何透過命令列檢視 vCenter Server 證書的狀態,並確定是否由證書過期而導致的服務不可用。

  • Checking the expiration date of vCenter Server certificates (KB 2015600)
  • Checking the expiration date of ESXi certificates (KB 2015600)
  • Verify and resolve expired vCenter Server certificates using command line interface. (KB 318973)
  • Manually reviewing certificates in VMware Endpoint Certificate Store for vSphere 6.x and 7.x (KB 2111411)

如果檢查確定有證書出現過期,以下連結可以幫助你解決 vCenter Server 證書過期問題,比如使用 vSphere Certificate Manager 實用程式和 Python 指令碼來統一更新 vCenter Server 過期證書。

  • CertificateStatusAlarm - There are certificate that expired or about to expire/Certificate Status Change Alarm Triggered on VMware vCenter Server (KB 68171)
  • How to use vSphere Certificate Manager to Replace SSL Certificates (KB 318946)
  • How to Replace Expired Certificates on vCenter Server using Fixcerts Python Script (KB 90561)

除了上面連結中的方法可以統一管理 vCenter Server 證書以外,也可以參考下面的連結對 vCenter Server 中的某類證書單獨進行管理,但還是建議最好將這些連結綜合查閱後再執行更新或替換操作。

1)根證書

  • Removing Expired CA Certificates from the TRUSTED_ROOTS store in the VMware Endpoint Certificate Store(VECS) (KB 2146011)
  • How to use vSphere Certificate Manager to Replace SSL Certificates (KB 318946)

2)計算機 SSL 證書

  • Determining expired SSL certificates in vCenter Server and ESXi 6.x and 7.0.x (KB 2015600)
  • How to use vSphere Certificate Manager to Replace SSL Certificates (KB 318946)
  • Replacing a vSphere 6.x /7.x/8.x Machine SSL certificate with a Custom Certificate Authority Signed Certificate (KB 316601)
  • Replacing the vSphere 6.x Machine SSL certificate with a VMware Certificate Authority issued certificate (KB 2112279)

3)解決方案使用者證書

  • How to replace the vSphere 6/7/8.x Solution User certs with VMCA issued certs (KB 2112281)
  • How to replace the vSphere 6.0 Solution User certs with CA signed certs (KB 2112278)
  • How to use vSphere Certificate Manager to Replace SSL Certificates (KB 318946)

4)STS 證書

  • Checking Expiration of STS Certificate on vCenter Servers (KB 79248)
  • Managing the vCenter Server Security Token Service (VMware Docs)
  • "Signing certificate is not valid" error in vCenter Server Appliance (KB 76719)
  • "Signing certificate is not valid" error in vCenter Server 6.5.x and 6.7.x on Windows (KB 79263)

5)SMS 證書

  • vSAN Providers display the status as disconnected in the vSphere Web Client (KB 2126810)
  • "VasaServiceException: org.apache.axis2.AxisFault: certificate has expired", SMS Certificate Expiry Alarm after upgrading vCenter Server from 5.x to 6.x (KB 2120105)

6)data-encipherment 資料加密證書

  • How to replace an expired data-encipherment certificate on vCenter Server (KB 88548)

7)BACUP_STORES 備份證書

  • Certificate alarm - Clearing BACKUP_STORES certificates in the VCSA (KB 82560)

注意,當你在處理 vCenter Server 證書過期問題時,不能僅考慮過期證書的更新或替換,因為實際環境中可能還部署了其他解決方案(如NSX、SRM等)或第三方解決方案,如果沒有進行綜合的判斷而執行了上述操作,可能會導致業務的中斷甚至資料的丟失。

相關文章