I have an ESXi host, but it does not have local hard disk. It use disks which are shared via fibre channel. Afterthat, I setup passthrough for the fibre channel. After rebooting ESXi host, we cannot find any datastores. And I also cannot remove passthrough setup (after removing and reboot, it's still there). Does anyone know how to fix it?
The following best practice prevents this problem from occurring:
The following workaround describes how to force the change from passthrough mode to non-passthrough mode:
Edit the /etc/vmware/esx.conf file by changing the owner of the PCI device from passthru to vmkernel. The following is an example of the necessary edit: Change from: /device/000:02.0/owner = "passthru" Change to: /device/000:02.0/owner = "vmkernel"
Reboot the ESX/ESXi host.
Using the Vsphere Client select your host, then the Configuration tab, select Advanced Settings in the Hardware section, then Configure Passthrough and de-select the PCI device you're concerned about and reboot the host.
I ran into this issue this evening as I had 2 identical SAS controllers. PhungHV's information was correct, however when you are in this mode you also cannot access the disks to change the file to get out of the mode. An annoying catch 22 at best. What happens is that VMware boots and reads the settings, then marks the device as a passthrough which causes VMWARE to loose access to it.
To resolve this issue I booted to an Ubuntu live disk. I mapped partition #5
Mount Boot Drive Partition #5
Make temp folder to work in
Copy State.tgz
Extract local.tgz from state.tgz
Extract etc from local.tgz
Edit the Config File
Find appropriate reference (or all if your not sure) of passthrough and change to vmkernel
Create new local.tgz
create new State.tgz
Copy to partition
Reboot
In vmware esxi 6.5, editing the esx.conf contained in the state.tgz didn't change the esx.conf file used during boot. The file extracted from state.tgz and local.tgz did not contain a reference to the device assigned to passthru (in my case /device/00000:003:00.0/vmkname = "vmhba0" ). Adding the device entry to the file and copying back to the vmware partition did not change the settings - the esx.conf file was edited or overwritten from another location.
I had to re-install 6.5 from the vmware installer and then recreate the network and register the vms. All the datastores can be preserved with the (Install ESXi, Preserve VMFS Datastore) option.
I realize that this is an old post but for all those that may end up here anyway, this may be helpful...
I believe the answer from John Doe (edited by Thomas) is the correct one but if your ESXi had a chance to create a backup of the config before you enabled passthrough, there may be an even simpler solution.
Reboot ESXi and at the boot screen press Shift-R to enter ESXi Recovery Mode. If you have a backup of the config, you can select it on that screen and it should fix the issue.
Some more details from http://pleasework.robbievance.net/howto-the-wrong-way-to-use-vmware-directpath/: