본문 바로가기

Compute

HA agent unreachable after upgrade from 6.7 to 7.0

vSphere 업그레이드 후 vCenter에서 호스트의 상태가 "HA 에이전트 연결 불가"로 떨어지는 현상에 대해서 다뤄봅니다.

## vCenter 7.0

 

고객사에서 vSphere를 업그레드 할 때 다음 2가지를 진행하였습니다.

1. vsphere 6.7 -> 7.0 업그레이드 : esxcli software profile update

2. vmtools 12.1 업그레이드 : esxcli software vib update

 

이 후 특정 호스트의 상태가 "HA 에이전트 연결 불가"인 것을 확인하신 후, FDM VIB를 제거 및 수동 설치 하였으나 설치 또한 실패하는 것까지 확인해주신 케이스입니다.

 

업데이트 로그를 확인해보면, 업데이트 과정에서 /lib64/python3.8/site-packages/vmware/esximage/ImageProfile.py 파일이 실행되면서 GetEsxVersion 함수가 호출될 때 오류가 발생하는 것을 알 수 있습니다.

## /var/log/esxupdate.log

2022-10-22T04:08:37Z esxupdate: 2101557: root: INFO: Command = profile.update 
2022-10-22T04:08:37Z esxupdate: 2101557: root: INFO: Options = {'rebooting': False, 'dryrun': False, 'pending': None, 'updateonly': False, 'nomaintmode': False, 'oktoremove': False, 'viburl': None, 'force': False, 'noliveinstall': False, 'downgrade': None, 'nohwwarning': False, 'level': None, 'nosigcheck': False, 'depot': ['/vmfs/volumes/xxx/ISO/VMware-ESXi-7.0.3-20036589-HPE-703.0.0.10.9.1.5-Jul2022-depot.zip'], 'nameid': None, 'profile': 'HPE-Custom-AddOn_703.0.0.10.9.1-5', 'proxy': None} 

2022-10-22T04:11:12Z esxupdate: 2101886: root: INFO: Command = vib.install 
2022-10-22T04:11:12Z esxupdate: 2101886: root: INFO: Options = {'nameid': None, 'profile': None, 'depot': ['/vmfs/volumes/xxx/ISO/VMware-Tools-12.1.0-core-offline-depot-ESXi-all-20219665.zip'], 'downgrade': None, 'updateonly': True, 'noliveinstall': False, 'proxy': None, 'dryrun': False, 'pending': None, 'nomaintmode': False, 'viburl': None, 'nohwwarning': False, 'nosigcheck': False, 'level': None, 'force': False, 'rebooting': False, 'oktoremove': False} 

2022-10-22T04:28:16Z esxupdate: 2109103: Transaction: INFO: Final list of VIBs being installed: VMware_bootbank_vmware-fdm_7.0.3-20146902

2022-10-22T04:28:16Z esxupdate: 2109103: imageprofile: INFO: Adding VIB VMware_bootbank_vmware-fdm_7.0.3-20146902 to ImageProfile (Updated) HPE-Custom-AddOn_703.0.0.10.9.1-5
2022-10-22T04:28:16Z esxupdate: 2109103: imageprofile: DEBUG: VIBs {'VMware_bootbank_vmware-fdm_6.7.0-19300125'} are replaced by VIB VMware_bootbank_vmware-fdm_7.0.3-20146902, removing them from ImageProfile (Updated) HPE-Custom-AddOn_703.0.0.10.9.1-5
2022-10-22T04:28:16Z esxupdate: 2109103: imageprofile: DEBUG: VIB VMware_bootbank_vmware-fdm_6.7.0-19300125 is being removed from ImageProfile (Updated) HPE-Custom-AddOn_703.0.0.10.9.1-5
 
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR: An unexpected exception was caught:
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR: Traceback (most recent call last):
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/usr/sbin/esxupdate", line 222, in main
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:     cmd.Run()
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/lib64/python3.8/site-packages/vmware/esx5update/Cmdline.py", line 153, in Run
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/lib64/python3.8/site-packages/vmware/esximage/Transaction.py", line 965, in InstallVibsFromSources
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:     inst, removed, exitstate = self._installVibs(curprofile,
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/lib64/python3.8/site-packages/vmware/esximage/Transaction.py", line 1179, in _installVibs
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:     Transaction._checkEsxVersionDowngrade(newProfile)
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/lib64/python3.8/site-packages/vmware/esximage/Transaction.py", line 2195, in _checkEsxVersionDowngrade
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:     newVer = str(newProfile.GetEsxVersion(True).version)
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:   File "/lib64/python3.8/site-packages/vmware/esximage/ImageProfile.py", line 1873, in GetEsxVersion
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR:     for prov in self.vibs[vibid].provides:
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: ERROR: KeyError: 'VMware_locker_tools-light_12.0.0.19345655-20036586'
2022-10-22T04:28:16Z esxupdate: 2109103: esxupdate: DEBUG: <<<

 

해당 서버에서 component list를 조회할 때 다음과 같이 오류가 발생하는 것도 확인이 됩니다.

오류 로그를 보면, tools 관련 component가 사용자가 업그레이드 했다고 명시한 12.1이 아닌 12.0 버전으로 기재되어 있습니다.

# localcli software component list

Errors:

 [KeyError]
 'VMware_locker_tools-light_12.0.0.19345655-20036586'
 Please refer to the log file for more details.

 

정상적인 경우에는 다음처럼 결과가 확인됩니다.

[root@esxi1:/var/log] localcli software component list
Name                            Display Name                                                                Version                                Display Version         Vendor  Creation Date  Acceptance Level
------------------------------  --------------------------------------------------------------------------  -------------------------------------  ----------------------  ------  -------------  ----------------
Broadcom-ELX-IMA-plugin         Broadcom IMA plugin for Emulex OneConnect iSCSI Driver                      12.0.1200.0-4vmw.703.0.20.19193900     12.0.1200.0-4vmw        VMware  01-12-2022     VMwareCertified

<snippet>

esx-update                      ESXi Install/Upgrade Component                                              7.0.3-0.55.20328353                    7.0.3 Build 20328353    VMware  09-01-2022     VMwareCertified

 

하지만, 서버가 가지고 있는 VIB 목록에는 12.1이 조회됩니다.

# localcli software vib list | grep -i tools

tools-light                    12.1.0.20219665-20295239              VMware   VMwareCertified   2022-10-22

 

이러한 현상이 발생하는 이유은 ESXi 6.7에서는 Bulletins/Compnents Concept이 없었기 때문입니다.

https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere-lifecycle-manager.doc/GUID-32BD1915-01BF-4C10-A6C3-655B35F95F24.html

Bulletins
The bulletin is a grouping of one or more VIBs. Bulletins are defined within the metadata of the VIB. You use bulletins, and not individual VIBs, to create vSphere Lifecycle Manager baselines, which you attach to inventory objects and use to update and upgrade ESXi hosts.

Components
Starting with vSphere 7.0, the component becomes the basic packaging construct for VIBs. VMware, OEMs, and third-party software providers now deliver software in the form of components. The component is a bulletin with additional metadata specifying the name and the version of the component. Unlike the bulletin, the component is a logical grouping of VIBs that provides you with a complete and visible feature upon installation.

VMware and OEMs do not deliver components independently. VMware bundles components together into fully functional and bootable ESXi base images. OEMs bundle components together into vendor add-ons. Third-party software vendors create and ship software, for example drivers or adapters, as independent components.

 

7.0 부터는 /locker/packages/var 하위에 7.0 기준으로 이미지 데이터베이스를 작성하는 새로운 코드를 호출하게 됩니다.

문제는 재부팅 하기 전까지는 당연히 7.0의 코드가 호출되는 것이 아닌 6.7의 코드가 호출되는데요.

 

이 상황에서 /locker/packages/var에 있는 tools 관련된 VIB metadata를 12.0에서 12.1로 교체해야 하는데, 6.7 코드는 bulletin/component를 이해할 수가 없습니다.

이에 따라, 12.1 VIB에 12.0 metadata가 올바르지 않게 병합되는 이슈가 발생합니다.

 

즉, 이와 같은 이슈가 발생하지 않도록 하기 위해서는 7.0 코드가 호출되도록 해야 하는데 이는 7.0 으로 업그레이드 이후에 재부팅을 하였다면 자연스럽게 해결되는 문제입니다.

 

따라서, 6.7 에서 7.0으로 업그레이드를 할 때 다음 순서를 지켜서 진행하시면 됩니다.

1. 6.7에서 7.0으로 vSphere 업그레이드

2. 재부팅

3. tools VIB 업그레이드