VMware ESXi: adding files which survive reboot
ESXi replace all manual added files, except datastores, at booting time.
Keeping a ssh key for passwordless login, e.g. for initiating a backup script or apc shutdown, is not possible without a little trick.
At booting time, the script /etc/rc.local is executed. Furthermore it’s possible to modify this script and it still survives the reboot.
1) Copy the needed files to /vmfs/volumes/datastore1/
2) edit /etc/rc.local to your needs
e.g. for copying ssh keys into the right place:
cp -r /vmfs/volumes/datastore1/.ssh/ /.ssh
This trick works for all data that won’t survive a regular reboot.
It’s also possible to customize the /bootbank/oem.tgz, but if it fails the ESXi won’t boot till the oem.tgz is recovered. Therefor, the solution above is really uncritical to me.
This trick only works if /etc/rc.local itself survives a reboot
Thus there may be other files which also survive a reboot.
Is there a list of files which survive and which don’t ?
The question is answered by looking at /sbin/backup.sh
It seems to include all files from /etc which happen to co-exist with a second (hidden) file with the prefix .# (dot-numbersign)
i.e. /etc/inetd.conf is backed up since /etc/.#inetd.conf exists.
With 5.5 /etc/rc.local dont survive but /etc/rc.local.d/local.sh does.