Home > it > VMware ESXi: adding files which survive reboot

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.

Categories: it Tags:
  1. Peter
    May 31st, 2011 at 15:09 | #1

    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 ?

  2. JM
    June 22nd, 2011 at 16:19 | #2

    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.

  3. mururoa
    October 10th, 2014 at 13:11 | #3

    With 5.5 /etc/rc.local dont survive but /etc/rc.local.d/local.sh does.

  1. No trackbacks yet.

Spam protection by WP Captcha-Free