Set-VMHostFirmware command fails with "The underlying connection was closed" error
search cancel

Set-VMHostFirmware command fails with "The underlying connection was closed" error

book

Article ID: 420639

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

When attempting to restore ESXi host configuration using the Set-VMHostFirmware command in PowerCLI, the operation may appear to fail with an error message similar to the following:

PowerCLI> Set-VMHostFirmware -VMHost <FQDN> -Restore -SourcePath <Path_to_Bundle> -Force

Set-VMHostFirmware : YYYY-MM-DDTHH:MM:SS    Set-VMHostFirmware    The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
At line:1 char:1
+ Set-VMHostFirmware -VMHost <FQDN> -Restore -SourcePath <Path_to_Bundle> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VMHostFirmware], ViError
    + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_RestoreVmHostFirmware_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVMHostFirmware

Environment

VMware vSphere ESXi

VMware PowerCLI

Cause

This issue occurs because the ESXi host initiates a reboot sequence immediately after the configuration restore process is completed. The connection is terminated by the server as part of the reboot process while the PowerCLI client expects the session to be kept alive. This behavior depends on the timing between the completion of the restore and the start of the reboot.

Resolution

This error message can be safely ignored. The configuration restore process has successfully completed by the time the error is displayed, and the ESXi host has entered the reboot cycle as expected. Verify that the configuration is correctly applied after the host finishes rebooting.

Additional Information

Japanese version: Set-VMHostFirmware コマンドの実行時に「接続が切断されました」エラーで失敗する(420638)