ESXi upgrade fails with LockingError due to vSphere Replication HBR agent
search cancel

ESXi upgrade fails with LockingError due to vSphere Replication HBR agent

book

Article ID: 413533

calendar_today

Updated On:

Products

VMware NSX VMware Live Recovery

Issue/Introduction

Symptoms

  • ESXi host upgrade fails with the following error in the UI: Unexpected error while upgrading upgrade unit: Upgrade not attempted because dry-run of upgrade on host [UUID] failed with message: [LockingError] Another process is updating the ESX image. Please try again later.
  • This issue occurs in environments with VxRail, VMware NSX, and vSphere Replication installed.
  • In /var/log/esxupdate.log, a VibDownloadError or LockingError is observed: esximage.Errors.VibDownloadError: ('https://[FQDN]:443/vib/vmware-hbr-agent.vib', ...) Error locking file /var/run/esximg.pid: [Errno 11] Resource temporarily unavailable, the file is currently locked by process with PID ####
  • During NSX Transport Node upgrade the ESX logs show vSphere Replication agent (HBR) is also attempting an upgrade in /var/log/esxupdate.log:

[Timestamp] In(14)[+] esxupdate[12345678]: Command: update
[Timestamp] In(14)[+] esxupdate[12345678]: Args: ['update']
[Timestamp] In(14)[+] esxupdate[12345678]: Options:
[Timestamp] In(14) esxupdate[12345678]: viburls = ['https://[FQDN]:443/vib/vmware-hbr-agent.vib']

  • In /var/log/esxupdate.log ,the NSX upgrade process attempting to access the ESX image.

[Timestamp] In(14) esxupdate[123456789]: Installers initiated are {'quickpatch': <vmware.esximage.Installer.QuickPatchInstaller.QuickPatchInstaller object at [HEX]>, 'live': <vmware.esximage.Installer.LiveImageInstaller.LiveImageInstaller object at [HEX]>, 'boot': <vmware.esximage.Installer.BootBankInstaller.BootBankInstaller object at [HEX]>, 'locker': <vmware.esximage.Installer.LockerInstaller.LockerInstaller object at [HEX]>}
[Timestamp] Er(11) esxupdate[123456789]: Error locking file /var/run/esximg.pid: [Errno 11] Resource temporarily unavailable, the file is currently locked by process with PID 12345678
[Timestamp] Wa(12) esxupdate[12345678]: Failed to acquire lock: ('/var/run/esximg.pid', 'Error locking file /var/run/esximg.pid: [Errno 11] Resource temporarily unavailable, the file is currently locked by process with PID 12345678')

  • Without making any changes, retrying the host upgrade may succeed without issue. Subsequent hosts may fail with the same error.

Environment

  • VMware ESXi 8.x/9.x
  • VMware NSX 4.x
  • vSphere Replication 8.x
  • VxRail Cluster

Cause

The failure occurs because the vSphere Replication Appliance attempts to automatically push or update the Host-Based Replication (HBR) agent VIB simultaneously with the ESXi/VxRail upgrade process. This creates a resource lock on the ESX image manager (esxupdate), preventing the primary upgrade from proceeding. In some cases, DNS resolution failures on the host may also prevent the HBR VIB from downloading, extending the duration of the lock.

Resolution

Verify that the ESXi host can resolve the FQDN of the vSphere Replication Appliance. If the resource lock persists, follow these steps:

  1. SSH to the vSphere Replication Appliance.
  2. Disable the HBR VIB auto-install property by running: /opt/vmware/hms/bin/hms-configtool -cmd reconfig -property hms-auto-install-hbragent-vib=false
  3. Restart the HMS service: systemctl restart hms
  4. Complete the ESXi or Transport Node upgrade.
  5. Re-enable the HBR VIB auto-install property: /opt/vmware/hms/bin/hms-configtool -cmd reconfig -property hms-auto-install-hbragent-vib=true
  6. Restart the HMS service again to return to standard configuration.

Note: vSphere Replication traffic for existing VMs is handled by the agent already loaded in memory and is not disrupted by disabling the auto-deployment mechanism during the upgrade window.

Additional Information