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.
- Back up / make note of any iSCSI initiator settings in ESXi
- Remove the iSCSI configuration from the ESXi host
- Reboot OMV
- Back up / make note of any iSCSI target configuration settings you have configured for OMV
- Uninstall the iSCSI plugin (openmediavault-iscsitarget) from OMV using the web GUI
- Reboot OMV
- Log in to the OMV console
- 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
- Install the OMV-Extras.org Plugin. This has to be downloaded and installed manually since it is not available by default within the web GUI. The official guide:
- Navigate to the plugin configuration page in the web GUI and confirm that the OMV-Extras.org main repository is enabled.
- Install the 3.16 backports kernel. At this point I configured it to be the default for OMV. The official guide:
- Reboot so that you are running 3.16 kernel
- 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 OMV-Extras.org repository (noted below for reference only).
- At this point you should then be able to configure the iSCSI target on OMV and have ESXi successfully connect to it.