ESXi: persistent files you can edit to apply settings during boot
Posted by jpluimers on 2022/01/18
Since ESXi boots from RAM, most files in /etc
are not persisted after modification.
The files that are persisted, are only persisted once every hour by auto-backup.sh
, so better run auto-backup.sh
by hand if you want to reboot after changing them.
The auto-backup.sh
script is ran every hour at 1 minute past the hour as per below crontab.
Default ESXi crontab in
/var/spool/cron/crontabs/root
:#min hour day mon dow command 1 1 * * * /sbin/tmpwatch.py 1 * * * * /sbin/auto-backup.sh 0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py */5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh 00 1 * * * localcli storage core device purge
Schedules deciphered via [Wayback] Crontab.guru – The cron schedule expression editor:
- [Wayback] Every day at
01:01
: “This module removes stale temporary files”1 1 * * * /sbin/tmpwatch.py
- [Wayback] Every hour at
*:01
: saves backup to/bootbank/state.tgz
.1 * * * * /sbin/auto-backup.sh
- [Wayback] Every hour at
*:00
logs heartbeat messages to/var/log/vmksummary.log
like2021-02-23T19:00:02Z heartbeat: up 577d2h37m16s, 9 VMs; [[2802426 vmx 4194304kB] [6176344 vmx 4194304kB] [68997 vmx 8388608kB]] [[2802426 vmx 0%max] [6176344 vmx 0%max] [68997 vmx 0%max]]
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
- [Wayback] Every
5th
minute logs to/var/log/hostd-probe.log
.*/5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
- [Wayback] Every day at
01:00
: Removes storage devices which have not been seen in some time interval.00 1 * * * localcli storage core device purge
Note that
localcli
commands are the same asesxcli
; foresxcli
, a runninghostd
is required;localcli
can run withouthostd
. See:
- [Wayback] VCDX #200 Blog of one VMware Infrastructure Designer: ESXi localcli
- [Wayback/Archive.is] Overview of vSphere Command-Line Interfaces – Getting Started with vSphere Command-Line Interfaces – VMware {code}
localcli
commands Set of commands for use with VMware Technical Support.localcli
commands are equivalent toESXCLI
commands, but bypass the hoste daemon (hostd
). Thelocalcli
commands are only for situations when hostd is unavailable and cannot be restarted. After you run alocalcli
command, you must restarthostd
. Run ESXCLI commands after the restart.Warning: If you use alocalcli
command, an inconsistent system state and potential failure can result.- [Wayback] VMware ESXi 6.5 – ESXCLI Command Reference | virten.net
–jeroen
Leave a Reply