Kyle Gleed, Sr. Technical Marketing Manager, VMware
A couple weeks back I wrote about booting from USB/SD and made the comment that ESXi will routinely save the host configuration to the boot device once every 10 minutes. This generated a lot of questions and it quickly became evident that people wanted to understand more about how a running ESXi hosts interacts with the boot device, especially when booting off of USB/SD. As such I did some research and here’s a bit more detail on how frequently ESXi writes to the boot device.
Outside of the initial installation, when the binaries are first laid out on the boot device, there are four scenarios where the ESXi configuration will be saved to the boot device:
1. At shutdown. Each time a host shutdown is initiated the /sbin/backup.sh script is invoked from the /etc/inittab. This backup ensures any outstanding host configuration changes will be flushed to the disk and available on reboot. Note that a backup only occurs when changes are found. If there are no changes there is no backup.
2. At a fixed rate of once an hour. Once an hour the /sbin/auto-backup.sh scripts is invoked from the root user’s crontab. This script first checks for any outstanding changes and if detected will invoke the /sbin/backup.sh script to perform a backup. Again, a backup only occurs when changes are found. If there are no changes there is no backup.
3. On demand by ‘hostd’. The ESXI ‘hostd’ will initiate an immediate backup following certain types of configuration changes, such as changing the root password or changing settings on the management network. One thing to note about the ‘hostd’ initiated backups is that in an effort to avoid performing too many backups in short succession the ‘hostd’ backups are throttled to no more than 6 backups an hour. If you make multiple changes in a short 20 minute window causing ‘hostd’ to reach it’s limit of 6, the ‘hostd’ will stop performing backups and the outstanding configuration changes will then get saved with the next hourly backup.
4. By VMware HA. VMware HA will also trigger a backup when HA is (re)configured and anytime there is a change in the cluster membership. Like the on demand backups initiated by ‘hostd’, the VMware HA initiated backups are also throttled so they occur no more than once every 10 minutes.
Trying to narrow down a specific number of times the ESXi host will write to the boot device is difficult as there are many factors to consider. In a worst case scenario, ESXi has the potential to write its configuration at a rate of once every 10 minutes. However, the reality is that in most cases it will write far less. In a stable environment where there are relatively few changes being made you could go several hours, if not days, without having any I/O to the boot device (assuming your logs are on a separate device). However, anytime you make configuration changes these updates will get saved either immediately via ‘hostd’ or at the next scheduled hourly backup. Also, anytime there is a change in the HA configuration (host placed in/out of maintenance mode for example) or there is a change in cluster membership additional backups will occur.