Error 'ModuleNotFoundError' during ESXi Host Upgrade/Patch via CLI
search cancel

Error 'ModuleNotFoundError' during ESXi Host Upgrade/Patch via CLI

book

Article ID: 403544

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vSphere ESX 8.x

Issue/Introduction

  • When upgrading or patching an ESXi 7.X to 8.XU3 (onwards) host via the CLI using the command: esxcli software vib update -d /vmfs/volumes/#############/VMware-ESXi-8.0-20513097-depot.zip 

    The following error message is encountered:

    esxcli software vib update -d /vmfs/volumes/##########/VMware-ESXi-8.0-20513097-depot.zip  
    [ModuleNotFoundError]  
    spec not found for the module 'systemStorage. errors'  
    Please refer to the log file for more details.
     
  • From the log file /var/run/log/esxupdate.log

    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: Transaction: DEBUG: Added /tmp/esx-update-2100819/lib64/python3.8/site-packages, /tmp/esx-update-2100819/lib64/python3.8/site-packages/vmware, /tmp/esx-update-2100819/usr/lib/vmware/esxupdate/systemStorage.zip, /tmp/esx-update-2100819/usr/lib/vmware to sys.path
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR: Traceback (most recent call last):
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/usr/lib/vmware/esxcli-software", line 772, in <module>
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     main()
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/usr/lib/vmware/esxcli-software", line 763, in main
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     ret = CMDTABLE[command](options)
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/usr/lib/vmware/esxcli-software", line 599, in VibInstallCmd
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     with livePatcher as t:
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/lib64/python3.8/site-packages/vmware/esximage/Transaction.py", line 2190, in __enter__
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     from esximage.Transaction import Transaction as NewTransaction
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/tmp/esx-update-2100819/lib64/python3.8/site-packages/vmware/esximage/__init__.py", line 302, in <module>
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     _configurePatcher()
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/tmp/esx-update-2100819/lib64/python3.8/site-packages/vmware/esximage/__init__.py", line 116, in _configurePatcher
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     _reImportSystemStorage()
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/tmp/esx-update-2100819/lib64/python3.8/site-packages/vmware/esximage/__init__.py", line 83, in _reImportSystemStorage
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:     importlib.reload(module)
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR:   File "/lib64/python3.8/importlib/__init__.py", line 168, in reload
    YYYY-MM-DDThh:mm:ssZ esxupdate: 2100819: root: ERROR: ModuleNotFoundError: spec not found for the module 'systemStorage.errors'

Environment


VMware vSphere ESXi 8.0.x

Cause

Starting with ESXi 8.0 Update 2, upgrading or updating ESXi using the esxcli software vib update or esxcli software vib install commands is no longer supported.

For more details, refer to the official KB article:

Error "ESXi version change is not allowed using esxcli software vib commands..."

Resolution

To patch the ESXi host (i.e., version 8.0U3 and onwards), administrators should use the esxcli software profile update command.

To update the host using the esxcli software profile:

  • Apply the Patch Using esxcli software profile (Recommended for profile-based updates):

    • Run the following command to list the profile name from the image:

      esxcli software sources profile list -d /vmfs/volumes/Datastore/DirectoryName/PatchName.zip

      Example output:

      Name                          Vendor        Acceptance Level  Creation Time        Modification Time
      ----------------------------  ------------  ----------------  -------------------  -------------------
      ESXi-8.0U3-24022510-no-tools  VMware, Inc.  PartnerSupported  2024-06-11T13:40:11  2024-06-11T13:40:11
      ESXi-8.0U3-24022510-standard  VMware, Inc.  PartnerSupported  2024-06-11T13:40:11  2024-06-11T13:40:11


  • Update the existing image profile by running the following command:

    esxcli software profile update -p <profile_name> -d <location of ZIP file>

  • To install the patch using esxcli software profile, replace esxcli software profile update with esxcli software profile install

 

Additional Information

For further information, refer to the following KB article:

Patching ESXi host using Command Line