ESXi 6.5 Host Initiator Unable to Connect to OpenMediaVault 2.x Guest iSCSI Target

I ran into a problem when trying to have an OpenMediaVault 2.x Guest machine act as an iSCSI target for an ESXi 6.5 Host iSCSI initiator. The goal was to have OMV share a datastore for the ESXi host using the iSCSI protocol.

To create iSCSI targets on OMV, the easiest way is to install the available plugin (openmediavault-iscsitarget) from the web GUI. However a major limitation with this plugin is that you are not able to create fileio targets using the web GUI. In another post I detail how to get around that limitation but at this point we’ll assume you have successfully created a target (either fileio or blockio) on OMV and are now trying to get an ESXi host to discover and connect to it.

You may find that ESXi successfully discovers the OMV target but then fails to connect to it. I happened to be logged in to the console of the OMV guest at the time and saw several console error messages appear when ESXi was attempting to connect to the OMV target. They were similar to the below. You may need to reboot OMV and then try to rediscover the target in ESXi in order to reproduce them.

Message from syslogd
kernel:[] invalid opcode: 0000 [#1] SMP
Message from syslogd
kernel:[] Stack:
Message from syslogd
kernel:[] Call Trace:

To flush the errors out I ended up having to reboot the OMV guest machine. The root cause appears to be a bugged version of iscsitarget that is installed from the OMV repositories when running the Linux 3.2 kernel. The solution is to install a backports kernel for OMV and then install updated iscsitarget packages that the OMV maintainers have made available.

The steps:

  1. Back up / make note of any iSCSI initiator settings in ESXi
  2. Remove the iSCSI configuration from the ESXi host
  3. Reboot OMV
  4. Back up / make note of any iSCSI target configuration settings you have configured for OMV
  5. Uninstall the iSCSI plugin (openmediavault-iscsitarget) from OMV using the web GUI
  6. Reboot OMV
  7. Log in to the OMV console
  8. Run several commands from the OMV console to fully remove and flush out the iSCSI configuration. One or more of these may not be necessary depending on your configuration:
    apt-get purge openmediavault-iscsitarget
    apt-get purge iscsitarget
    apt-get purge iscsitarget-dkms
    apt-get autoremove
    apt-get autoclean
  9. Install the Plugin. This has to be downloaded and installed manually since it is not available by default within the web GUI. The official guide:
  10. Navigate to the plugin configuration page in the web GUI and confirm that the main repository is enabled.
  11. Install the 3.16 backports kernel.  At this point I configured it to be the default for OMV. The official guide:
  12. Reboot so that you are running 3.16 kernel
  13. Now reinstall the openmediavault-iscsitarget plugin. With the 3.16 kernel running, the plugin will automatically use the newer packages of iscsitarget available from the repository (noted below for reference only).
  14. At this point you should then be able to configure the iSCSI target on OMV and have ESXi successfully connect to it.
This entry was posted in Uncategorized. Bookmark the permalink.