vCert 使い方 その1

最近、vCenter の証明書更新をするのに、fixcert をよく使っていたのですが、気がついたら以下の文章が追記されていました。

Replace certificates on vCenter server using the Fixcerts script

Replace certificates on vCenter server using the Fixcerts script
Replacing certificates using the script attached to this article is deprecated. Use the new improved certificate management tool  vCert - Scripted vCenter Expired Certificate Replacement for all certificate management/replacement workflow. 

とりあえず今後は vCert が推奨とされるらしいので、使い方に慣れておいたほうがよさそうです。

vCert – Scripted vCenter Expired Certificate Replacement

vCert - Scripted vCenter Expired Certificate Replacement

導入方法

The tool can be downloaded from this article and uploaded to vCenter Server. The script is executable by running the following command in the same directory the script is loaded:

# unzip -q vCert-6.0.0-20250218.zip
# cd vCert-6.0.0-20250218
# ./vCert.py

最新の vCert を KB のページからダウンロードしてきて、vCenter にアップロードすることが必要です。
一点注意事項として、SCP 等でアップロードする場合にエラーが発生してアップロード出来ない場合があるので KB 324261 の手順は確認して設定をしておいたほうがよいです。

WinSCP を使用してvCenter Server Appliance に接続すると、次のエラーで接続に失敗する:Received too large (1433299822 B) SFTP packet. Max supported packet size is 1024000 B(日本語KB)

WinSCP を使用してvCenter Server Appliance に接続すると、次のエラーで接続に失敗する:Received too large (1433299822 B) SFTP packet. Max supported packet size is 1024000 B

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

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

vCert.py を実行すると以下のようになりました。

------------------------!!! Attention !!!------------------------

This script is intended to be used at the direction of Broadcom Global Support.

Changes made could render this system inoperable. Please ensure you have a valid
VAMI-based backup or offline snapshots of ALL vCenter/PSC nodes in the SSO domain
before continuing. Please refer to the following Knowledge Base article:
https://knowledge.broadcom.com/external/article?legacyId=85662

Do you acknowledge the risks and wish to continue? [y/n]:

日本語訳してみた。

このスクリプトは、Broadcom グローバルサポートの指示に従って使用することを目的としています。
変更を加えると、このシステムが動作しなくなる可能性があります。
有効な VAMI ベースのバックアップまたは SSO ドメイン内のすべての vCenter/PSC ノードのオフラインスナップショットがあることを確認してください。
を確認してください。以下のナレッジベースの記事を参照してください:
https://knowledge.broadcom.com/external/article?legacyId=85662

リスクを認識し、続行しますか? [y/n]:

KB の内容は、以下の内容ですね。

VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice

VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice
スナップショットのベストプラクティスについて書かれている内容になります。

あとは、このスクリプト自体、Broadcom のグローバルサポートの指示に従って使用しないと駄目だよってのも書かれている。
編集したりしてしまうと正しく動かなくなってしまったりするので、指示をしっかり確認して実施する必要がありますね。
とりあえず、注意事項を認識したら y を入力。

VCF/VVF Certificate Management Utility (version 6.0.0)
-----------------------------------------------------------------
 1. Check current certificate status
 2. View certificate info
 3. Manage certificates
 4. Manage SSL trust anchors
 5. Check configurations
 6. Reset all certificates with VMCA-signed certificates
 7. ESXi certificate operations
 8. Restart services
 9. Generate certificate report
 E. Exit

Select an option [1]: 

y で進めると、メニューが表示されます。
今回はとりあえず、1 を押して進めてみます。

Please enter a Single Sign-On administrator account [administrator@vsphere.local]:
Please provide the password for administrator@vsphere.local:

Single Sign-on のアカウントでログインする必要がある。Enter で Administrator でログインして入ってみる。

Checking Certificate Status
-----------------------------------------------------------------
Checking Machine SSL certificate                            VALID
Checking Solution User certificates:
   machine                                                  VALID
   vsphere-webclient                                        VALID
   vpxd                                                     VALID
   vpxd-extension                                           VALID
   hvc                                                      VALID
   wcp                                                      VALID
Checking SMS self-signed certificate                        VALID
Checking SMS VMCA-signed certificate                        VALID
Checking data-encipherment certificate                      VALID
Checking Authentication Proxy certificate                   VALID
Checking Auto Deploy CA certificate                       NO SKID
Checking BACKUP_STORE entries:
   bkp___MACHINE_CERT                                       VALID
Checking VMCA certificate                                   VALID

Checking STS Signing Certs & Signing Chains
-----------------------------------------------------------------
Checking TenantCredential-1:
   TenantCredential-1 signing certificate                   VALID
   TenantCredential-1 CA certificate                        VALID
Checking TrustedCertChain-1:
   TrustedCertChain-1 signing certificate                   VALID
   TrustedCertChain-1 CA certificate                        VALID

Checking CA certificates in VMDir [by CN(id)]
-----------------------------------------------------------------
hogehogehogehogehogehogehogehogehogehoge                    VALID

Checking CA certificates in VECS [by Alias]
-----------------------------------------------------------------
hogehogehogehogehogehogehogehogehogehoge                    VALID

Checking VECS Stores
-----------------------------------------------------------------
Checking status and permissions for VECS stores:
   MACHINE_SSL_CERT                                            OK
   TRUSTED_ROOTS                                               OK
   TRUSTED_ROOT_CRLS                                           OK
   machine                                                     OK
   vsphere-webclient                                           OK
   vpxd                                                        OK
   vpxd-extension                                              OK
   SMS                                                         OK
   APPLMGMT_PASSWORD                                           OK
   data-encipherment                                           OK
   hvc                                                         OK
   wcp                                                         OK

Checking Service Principals
-----------------------------------------------------------------
Node hogehogehogehogehogehogehogehogehogehoge:
   machine                                                PRESENT
   vsphere-webclient                                      PRESENT
   vpxd                                                   PRESENT
   vpxd-extension                                         PRESENT
   hvc                                                    PRESENT
   wcp                                                    PRESENT

Checking Certificate Revocation Lists
-----------------------------------------------------------------
Number of CRLs in VECS                                          1

Checking SSL Trust Anchors
-----------------------------------------------------------------
vc.nesk.style                                               VALID

Checking vCenter Extension Thumbprints
-----------------------------------------------------------------
com.vmware.vcIntegrity (vpxd-extension)                   MATCHES
com.vmware.vim.eam (vpxd-extension)                       MATCHES
com.vmware.vlcm.client (vpxd-extension)                   MATCHES
com.vmware.vmcam (Authentication Proxy)                   MATCHES
com.vmware.vsan.health (Machine SSL)                      MATCHES

Checking VMCA Configurations in VCDB
-----------------------------------------------------------------
vpxd.certmgmt.certs.cn.country                  'US'
vpxd.certmgmt.certs.cn.email                    'vmca@vmware.com'
vpxd.certmgmt.certs.cn.localityName             'Palo Alto'
vpxd.certmgmt.certs.cn.organizationalUnitName   'VMware Engineering'
vpxd.certmgmt.certs.cn.organizationName         'VMware'
vpxd.certmgmt.certs.cn.state                    'California'
vpxd.certmgmt.mode                              'vmca'

Checking STS Server Configuration
-----------------------------------------------------------------
Checking VECS store configuration                              OK
Checking STS ConnectionStrings                                 OK

出力結果は上記の感じです。検証環境のやつでやったので多少マスクしてますけど、特に問題がない環境だったらこんな感じでした。
Fixcert のときは期限が一覧で見えたんですけど 1 を選択した場合だと問題が無いかどうかしかわからないんですね。

前よりもちょっとややこしくなっているのでしっかり手順を確認してみようと思います。

追記 

そんなに文量多くないだろって思ったら機能性が多すぎて全然1コンテンツに入りきらないほどの内容だったのでつらつら続編を書こうと思います。。。。。

vCert 一つで ESXi の証明書もいじれるとはもはや何でも屋になりつつあるけど操作はちゃんと手順を踏まないと更新出来ないので注意するところ多めです。。。。

タイトルとURLをコピーしました