Accident Prone (.com)

ESXi 5, Old Hardware, and You

Posted On: November 7th, 2011 by tom

ESXi 5.0 was released a shot 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:

  1. cd /tmp
  2. mkdir tweak
  3. cd tweak
  4. vmtar -x /bootbank/sata-ahc.v00 -o sata-ahc.tar
  5. 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:

  1. rm sata-ahc.tar
  2. tar cvf sata-ahc.tar etc usr
  3. vmtar -c sata-ahc.tar -o sata-ahc.vgz
  4. 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!

Joe Muscat

  HOMEPAGE  | November 27th, 2011 at 10:13 AM
Joe Muscat Hi there. Thank you So much for this. The tar magic error was driving me potty. Now thankfully my ESXi 5 is properly recognising my D-Link DGE-528T nics as I can see that vmnic2 and vmnic3 is being bound to them when I run lspci -n. My only remaining problem now is that they are still not showing in the vsphere client. I have edited the corresponding ids file with no success. Don't suppose you have any ideas as to where I should be editing it? Many thanks once again, Joe.

HericopterPirate

  HOMEPAGE  | November 28th, 2011 at 09:28 AM
HericopterPirate Great post!!!!! I kept trying to follow the Andy's World post and thought I must be taking crazy pills because I couldn't find anyone else having the same problem. For me it was HBAs ( QLE220). Anyway... your my hero, thanks for doing all the leg work.

HericopterPirate

  HOMEPAGE  | November 28th, 2011 at 09:28 AM
HericopterPirate Great post!!!!! I kept trying to follow the Andy's World post and thought I must be taking crazy pills because I couldn't find anyone else having the same problem. For me it was HBAs ( QLE220). Anyway... your my hero, thanks for doing all the leg work.