Okay, I'm going to do a bad job of this but I do want to get some of this information out for those who want to use ESXi but I can't state this enough, These forums do not support ESXi use, meaning if you have a complaint about how it works, you will not get any sympathy. I may create a thread specifically pulling all this data together but someone else can do that as well if they want.
So, the first thing to know is backup your data if you are moving a previously existing pool into an ESXi environment. Be smart and methodical about what you are doing. Read everything before moving forward, and take your time.
First you need to have proper hardware, if you don't then you could be looking for trouble. Look at my ESXi System setup for my specific hardware choices and I'm not promoting that this is the preferred system configuration, it's just what I have. Keep in mind that with my specific motherboard I was unable to use the onboard SATA ports in pass-thru for ESXi which is why my configuration ended up the way it is and my boot device ended up on the motherboard SATA ports (not what I desired but what I ended up with).
Software desired:
MemTest86 (free)
The Ultimate Boot CD (contains MemTest86 and CPU Stress Tests)
Software required:
ESXi 6.0 Hypervisor (current iso)
ESXi 6.0 Hypervisor Update (if newer than the iso)
vSphere 6 Client
FreeNAS (whatever version you desire)
There are a few things to do once you have proper hardware:
1) Run MemTest86 (free version) for an extended period of time (72 hours at least).
2) Run a CPU stress test (any one will do) for at least 2 hours. Others will say you can run them longer however you can damage a CPU from excessive thermal stress and I feel 2 hours should throw an error if one is coming.
Setup your motherboard IP addresses to static values:
1) Enter the BIOS settings and set your IPMI to a static address and your LAN1 port to a static IP address. For this thread I will use IPMI set to 192.168.1.40 and LAN1 to 192.168.1.41.
2) Also in the BIOS set the Boot for Legacy.
Connect ONLY your boot hard drive to the motherboard SATA connectors. I used a 256GB SSD because it was available.
Install ESXi. I used the following link for most of my instructions. Do not use the VMXNET3 driver or worry about MTU 9000 settings, it will only set you behind if you're not willing to troubleshoot a lot.
https://b3n.org/freenas-9-3-on-vmware-esxi-6-0-guide/
So now you should have ESXi installed and possibly FreeNAS installed, it depends on how far you went with the tutorial using the link above. Things which will make it custom to your system is the pass-thru ports like the SATA ports for your FreeNAS hard drives for the pool(s). If you are also going to run Sophos or other software which will have direct control (pass-thru) of devices, ensure all the hardware is installed ahead of time.
WARNING: If you move or add on cards to the motherboard after you have setup ESXi pass-thru ports, you may and likely will change the addressing of those cards for ESXi and your system will fail to work. I found this out the hard way but since I was taking my time building my system and methodically testing it, it was obvious and I decided on my final layout rather quickly.
So with respect to the FreeNAS VM, I dedicated 16GB RAM, 2 CPU cores, and 10GB of boot drive space to my FreeNAS VM and all works very well. I used 10GB for the boot drive because I wanted to allocate more than enough space because that is the way that I am.
Automatic Shutdown isn't updated in the linked guide above to support USB connected devices so I'll provide the instructions here that worked fine for me. If you find something dosn't work, I would appreciate the feedback and if you figured out a better way, post it for all to see. This is a cut and paste from a Word document I started a few months ago:
--------------------------------------------------------------
How to setup ESXi, FreeNAS, and an APC UPS (USB Connection) to Control Shutdown
First of all, I cannot take any real credit except for basically combining a few sources and making things actually just work properly, and lastly, making the instructions easy to follow. Original Source:
http://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/
So the purpose of this guide is to provide step by step instructions on how to implement proper power shutdowns of your ESXi VM Machines and we are using FreeNAS 9.3x to host the APC UPS.
When reading this document, if something is in parenthesis, it is because there could be a space in the text or just to clearly identify what needs to be entered. Do not enter the parentheses unless specifically directed.
Before we start you need to have the following installed:
1) ESXi 5.x or greater (tested on 6.0U1b)
2) FreeNAS 9.3x running
3) Any other VMs, at least one more to prove to yourself it works properly
Software you will need:
1) NutClient-ESXi500-1.3.0.tar.gz (
http://rene.margar.fr/downloads/NutClient-ESXi500-1.3.0.tar.gz)
FreeNAS Configuration:
1) If FreeNAS is running, stop the machine.
2) Edit the profile to add a USB Controller and click Ok.
3) Edit the profile to add a USB Device and select the APC UPS, then click Ok.
4) Start FreeNAS.
5) Configure your UPS as follows:
a. UPS Mode: “Master”
b. Identifier: “ups”
c. Driver: (select the driver for your UPS)
d. Port: (select the correct port identified during bootup)
e. Auxiliary Parameters: “override.battery.charge.low = 20”
NOTE: In the above setting I am changing the default low threshold from 10% to 20% so that my system has lots of time to shutdown. You may want to set the value for 50 if you have a small UPS or a lot of VMs to shutdown. This is something that you need to test yourself, no one can tell you for certain what value you should set.
f. Shutdown mode: “UPS reaches low battery”
g. Monitor User: “upsmon”
h. Monitor Password: “upspassword”
i. Remote Monitor: checked
j. Send Email Status Updates: checked
k. To email: (enter your email address)
l. Power Off UPS: unchecked
m. Click OK
n. Turn ON the UPS Service
o. Open the Shell (left side of the screen)
p. Type “upsc ups” and you should get a long status response meaning your UPS is communicating properly. If you type “upsc ups | grep battery.charge.low” it should just output the level you entered in the step above (5e), if it doesn’t, stop and figure out why it’s not working.
q. Type “exit” to close the shell
6) Shutdown FreeNAS
ESXi NUT Installation & Configuration:
1) Enable SSH for ESXi and open an SSH connection (log on as root)
2) Copy the NutClient-ESXi500-1.3.0.tar.gz file to the /tmp directory
a. NOTE: I uploaded to the datastore and then moved it to the /tmp directory, but I don’t see why you couldn’t run this from the datastore itself either.
3) Type “cd /tmp”
4) Type “tar –xzf NutClient-ESXi500-1.3.0.tar.gz”
5) Type “sh upsmon-install.sh”
6) You should see the following results:
Installation Result
Message: Operation finished successfully.
Reboot Required: false
VIBs Installed: Margar_bootbank_upsmon_2.7.2-1.3.0vmw.500
VIBs Removed:
VIBs Skipped:
7) Type “exit” to close the SSH connection
8) Reboot the ESXi server
9) Once the ESXi server is back online under the Configuration Tab, in the Software box, select Advanced Settings
10) On left side scroll down to UserVars and select it
11) On the right side scroll down to the following values and enter as specified:
a. UserVars.NutFinalDelay = “0”
b. UserVars.NutMailTo = (enter your email address)
c. UserVars.NutPassword = “upspassword”
d. UserVars.NutSendMail = “1”
e. UserVars.NutUpsName = “ups@192.168.1.51” (enter the IP address of your FreeNAS)
f. UserVars.NutUser = “upsmon”
g. Click OK
12) Once again open an SSH connection and log in as root
13) Type “upsc
ups@192.168.1.51” (what was set is step 11e) and the UPS status should be displayed.
So this takes care of the UPS properly communicating with both FreeNAS and the ESXi system.
---------------------------------------------------------
ESXi Automated Shutdown Setup:
Now we will configure both automatic startup and shutdown of the VMs.
1) In vSphere Client open the Configuration tab for the ESXi server, under Software click on Virtual Machine Startup/Shutdown.
2) Now you can move your VMs around and establish the settings. I would set the delays for 120 seconds and check mark the "Allow virtual machines to start and stop automatically with the system".