norbs
Explorer
- Joined
- Mar 26, 2013
- Messages
- 91
I'm using freenas in a lab environment and what I am trying to do is get ESXi to rescan for iSCSI datastores right after FreeNAS boots. I set up ssh key authentication to the ESXi host so that FreeNAS has shell access without a password. Now I simply need to run a one like command on the FreeNAS box (which in turn calls it on the ESXi box) but I don't know a good place to drop the command into.
Is there a script in freenas that runs almost at the end of freenas boot? Better yet, a script that runs after iSCSI service is started?
Basically looking to run this once iSCSI is available:
or
The reason I am doing it this was is because if an esxi host boots while an iSCSI device is not available, the host does not automatically reconnect the luns after is becomes available.
Is there a script in freenas that runs almost at the end of freenas boot? Better yet, a script that runs after iSCSI service is started?
Basically looking to run this once iSCSI is available:
Code:
ssh root@esxihost 'esxcli storage core adapter rescan --all'
or
Code:
ssh root@esxihost 'esxcli storage core adapter rescan --adapter iSCSIadaptername'
The reason I am doing it this was is because if an esxi host boots while an iSCSI device is not available, the host does not automatically reconnect the luns after is becomes available.
Last edited: