Resource icon

Utility scripts for FreeNAS and VMware ESXi

I've created a GitHub repository containing the scripts I've written for use with my FreeNAS-on-ESXi All-In-One systems:

These might be handy for folks who haven't already cooked up their own solutions to the standard issues:
  • Forcing ESXi to rescan datastores so it will see the ones provided by FreeNAS
  • Starting up selected VMs when FreeNAS boots
  • Shutting down VMs gracefully when FreeNAS is shut down
  • Configuring FreeNAS to poll a UPS and shut down the ESXi host when needed
Scripts include:
  • : Issue a poweroff command to the ESXi host
  • : Instruct the ESXi host to rescan its datastores (call from your FreeNAS startup script)
  • : Start selected virtual machines
  • : Start a virtual machine given its vmx name
  • : Gracefully shut down all running VMs in a given datastore
  • : Shut down all virtual machines on datastores provided by FreeNAS (call from your FreeNAS shutdown script)
  • : Shut down a virtual machine given its vmx name
  • : Sample startup script for use as a FreeNAS postinit Init/Shutdown Task
  • : Sample shutdown script for use as a FreeNAS shutdown Init/Shutdown Task
  • host.config : Sample host configuration settings
  • esxi.config : Common code for ESXi support

NOTE: The Network UPS Tools daemon on FreeNAS is unable to execute scripts because of permissions issues. So just specify the SSH command - ssh root@esxihostname poweroff - as the UPS Shutdown command, instead of using
First release
Last update
5.00 star(s) 3 ratings

More resources from Spearfoot

Latest reviews

Robust and commented code :)
Just looking at the list of aspects you have covered is helpful in understanding the challenges of getting ESXi host with FreeNAS up and running. Thanks for sharing the results of your hard work!
Thank you for putting these all in one location Sir!