Applying vSphere host configuration changes after an unclean shutdown
search cancel

Applying vSphere host configuration changes after an unclean shutdown

book

Article ID: 313072

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article explains how ESX and ESXi persist configuration information across reboots, and the ramifications of an unclean shutdown or reboot.

Troubleshooting the cause of the unclean shutdown or restart is outside the scope of this article, but should be investigated separately.


Symptoms:

An ESX/ESXi host may not retain its configuration in the event of an unclean shutdown or reboot resulting from a power outage or loss, hard power off or reset, software or hardware hang, or the reboot -f command executed on the host. Shutdowns or restarts of a host performed gracefully from the vSphere Client or console persist configuration state to disk prior to completing.


Environment

VMware ESX 4.0.x
VMware vSphere ESXi 5.1
VMware ESXi 4.0.x Embedded
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 5.0
VMware ESXi 4.0.x Installable
VMware vSphere ESXi 6.7
VMware vSphere ESXi 6.5
VMware vSphere ESXi 5.5
VMware ESXi 4.1.x Embedded
VMware ESXi 4.1.x Installable
VMware ESX Server 3.5.x
VMware vSphere ESXi 6.0
VMware ESX Server 3.0.x
VMware ESX 4.1.x
VMware ESXi 3.5.x Embedded

Resolution

Configuration information for an ESX/ESXi host are saved in different locations depending on the version:

  • ESXi Installable and Embedded store all configuration information in a state.tgz file on the boot device.
  • ESX stores configuration information required for boot within the initial ramdisk (initrd) on the boot device. Other configuration information is stored on disk in the service console.

VMware ESXi Installable and Embedded

Configuration information for the host is available in several configuration files within the /etc/ directory on an ESXi host. If changes are made to these configuration files, they do not persist across reboots.

Configuration changes to files on an ESXi Installable or Embedded host installation are retained in the state.tgz file on the boot device. The state.tgz file contains a copy of the configuration file /etc/vmware/esx.conf, which is consulted early in the startup process, prior to loading drivers.

The state.tgz file is regenerated automatically under two conditions:

  • After an hour, a periodic cron job /var/spool/cron/crontabs/root runs the command /sbin/auto-backup.sh, which updates the state.tgz file if any configuration has changed.
  • During a graceful shutdown or restart, the script /sbin/shutdown.sh runs the command /sbin/backup.sh 1, which updates the state.tgz file.

If the state.tgz file is not updated automatically following a configuration change, and the host is shutdown or restarted uncleanly, the state.tgz file contains the previous configuration. Reapply the configuration changes to the host and backup the configuration to state.tgz automatically or manually.

To manually regenerate the state.tgz file after a configuration change:

  1. Open a console to the ESXi host. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
  2. Run this command:

    /sbin/auto-backup.sh
Note: To remove the state.tgz file and to reset the system configuration to software defaults, use the console menu option Reset System Configuration, or run the firmwareConfig.sh --reset command.

VMware ESX

Configuration information for the host is available in several configuration files within the /etc/ directory on an ESX host. If changes are made to these configuration files, they persist across reboots.

Configuration changes that affect early startup of the ESX host, such as loading of drivers, require persisting some configuration information to the initial ramdisk (initrd). The initial ramdisk contains a copy of the configuration file /etc/vmware/esx.conf, which is consulted early in the startup process, prior to loading drivers.

The initial ramdisk is regenerated automatically under two conditions:

  • After an hour, a periodic cron job /etc/cron.hourly/refreshrd updates the initial ramdisk.
  • During a graceful shutdown or restart, the init script /etc/init.d/vmware updates the initial ramdisk.

If the initial ramdisk is not regenerated automatically following a configuration change, and the host is shutdown or restarted uncleanly, the initial ramdisk contains the previous configuration. Reapply the configuration changes to the host and backup the configuration to the initial ramdisk automatically or manually.

To manually regenerate the initial ramdisk after a configuration change:

  1. Open a console to the ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
  2. Run this command:

    esxcfg-boot --rebuild


Additional Information

クリーン シャットダウンできなかった場合に、vSphere ホストの構成変更を適用する
在非正常关机后应用 vSphere 主机配置更改