ESXi, Old Hardware, and You

ESXi 5.0 was released a short while ago. I run a small datacenter in my basement, some of which is virtualized using ESXi. The hardware is unfortunately a bit dated and has never been officially supported by VMware so, needless to say, some customizations are in order. For those struggling with old hardware and incomplete documentation, here’s a bit of help.

VIB? Do I need that?

ESXi 5.0 introduces a new concept for packaging and installing third-party drivers (among other things): VIBs. You can read a bit more about them here. I won’t go into the details except to say that, for the most part, you probably won’t be creating your own. I spent quite a bit of time exploring that option only to finally resolve that it simply wasn’t the right approach for me.

The reason behind this is simple: I don’t actually need to install a new driver, I just need ESXi to recognize the older hardware as supported by existing drivers. To this end, after much searching, I found this article, which forms the foundation of everything you’ll see here. The author had a similar problem- hardware going unrecognized by drivers that otherwise would have offered full support. His suggestion was to modify the existing driver packages and add the relevant entries to the driver’s map file. Ingenious!

So how is it done?

If you’ve tried to follow along with the above article’s suggested steps, you’ll hit a serious snag: you can’t unpack the driver packages with tar. You’ll get an “Invalid tar magic” error, among other things. The extracted files also will not be usable. If you try and transfer it to a different host and unpack it, you’ll notice that tar complains loudly about corruption and, to end it all, the extracted files are unusable. In short, DON’T TRY IT.

With that said, the approach is solid. After a bit more research, I discovered that the driver packages are actually vmtar archives, not vanilla tar archives. You can convert these to standard tar files with a simple command:

vmtar -x [file] -o [output.tar]

With that done, you can use tar to extract the archive, make any necessary changes (or additions), then tar it back up and use the following vmtar command to get it into the necessary VGZ format:

vmtar -c [file.tar] -o [output.vgz]

The specifics

In my case, I have an old SB600 SATA controller built-in to the motherboard that I would very much like to use. First step in the process is identifying it using lspci:

lspci -v

You’ll get some output like this:

You can see my particular controller on the first line. Below, you can also see the PCI class association (Class: 0106: 1002:4380). The latter set (1002:4380) is used to map the device to a driver in a standard linux distro’s standard.map file. In the case of ESXi, these maps are driver-specific, supplied in the VGZ packages we’ve discussed. Once you’ve identified the hardware using lspci, the next step is to map the class declaration to a driver. Here’s how I did it:

Since my example deals with a SATA AHCI controller, I looked in the /bootbank folder for a corresponding driver package. I found sata-ahc.v00. To make the necessary change, I did as the article referenced above suggests:

cd /tmp  
mkdir tweak  
cd tweak  
vmtar -x /bootbank/sata-ahc.v00 -o sata-ahc.tar  
tar xvf sata-ahc.tar  

Now I had both the etc and usr directories, provided by the driver package, in the /tmp/tweak folder- available for me to change! Note that I used vmtar first- this is the step overlooked in the original article. Next, I opened the etc/vmware/driver.map.d/ahci.map using vi and added the following line:

regtype=linux,bus=pci,id=1002:4380 0000:0000,driver=ahci,class=storage

Finally, I closed up shop and re-packaged everything using the following steps:

rm sata-ahc.tar  
tar cvf sata-ahc.tar etc usr  
vmtar -c sata-ahc.tar -o sata-ahc.vgz  
mv sata-ahc.vgz /bootbank/sata-ahc.v00  

Last step: reboot

That’s it. The ESXi host came alive, the storage device was recognized, and I was on my way.

This is a pretty easy way to get new drivers on your ESXi host without having to create a VIB (which can be lengthy). You can add your specific driver file (compiled for ESXi) to the usr folder, add the map declaration as indicated above, vmtar it up, and go on your way.

Good luck- ping me with questions!