Yesterday I was witness of an exciting feature of VMware’s VMDirectPath Feature on ESXi. For those who don’t know: DirectPath allows you to directly attach PCI Devices to a VM.
In our case we installed a secondary SCSI Adapter to attach a tape drive to a VM. In ESX Host that is configured by using VMDirectPath. Unfortunately, fast hands have choosen the wrong adapter. In this case, where you only have two adapters, it’s the SCSI adapter of the disks where ESX ist installed on 😛 it isn’t possible to write down any configuration changes to disk now, because esx has no longer access to the SCSI Controller.
ESX boots up normally. After OS is up, the SCSI Adapter is passed trough to the DirectPath module. From this time on, you see error messages in the logs (ALT+F12 on console).
So, how to get back?
- Boot another Linux Live CD and change the configuration? Didn’t work in our case, why ever.
- Reinstall ESX: no.
- Change the configuration during ESX operation. But how if filesystem is read only?
Here’s my How-To
Run the following on ESX Console (dcui) to get a list of who owns which hba:
Now let’s assign vmhba1 back to vmkernel:
Now kernel owns the hba, but before changes can be written to disk, a rescan is required.
Now let’s modify the esx.conf to permanentely assign vmhba1 to vmkernel.
To search a String, use “/” in vi; just type “/vmhba1” and hit enter, vi will show up the right line where you can see vmhba1 is assigned to passtrough instead of vmkernel. Some other vi hints for editing:
- delete text using the DEL key
- before typing, enter insert mode by pressing key “i”
- after typing exit insert mode using ESC key
- to save and exit: “:wq” and ENTER
Now do a reboot to test the new setting. After all now we’re able to assign the next/right hba to the passtrough 😉