I'm in the process of building a home lab environment for Cisco and VMware that will also double as a NAS. The system runs ESXi v6.0 bare metal. Part of my design is that I have a Lenovo TS440 with LSI2008, which I've used VT-d to give to a guest, and that guest runs ZFS with LIO providing a LUN that I can then use as a datastore for other VMs.

This design was inspired by this:

Hosting a ZFS server as a virtual guest

The performance is amazing and it runs really well. However a problem that I'm running into is that if I ever reboot the ESXi host (which I do on occasion since this is a lab environment) then the VMs that are using the iSCSI datastore can't come up (they are greyed out and show inaccessible.)

I have to fix it every time after a reboot by re-adding the datastore, not only that but the boot stage takes longer because it tries to reach the iSCSI target and fails.

The main question is this:

Is it possible to configure ESXi to wait until a given VM is online before it attempts to load any datastores? If not, what are my alternatives? I understand I can just use a larger ESXi boot disk, but I'd rather be able to ZFSify the vmdisks.

closed as off-topic by EEAA, HBruijn, MadHatter, Ward, Joseph Kern Jul 3 '15 at 13:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – EEAA, HBruijn, MadHatter, Joseph Kern
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You should use NFS... but I don't have an answer for your iSCSI situation. – ewwhite Jun 26 '15 at 3:56
  • I originally used NFS, but didn't like the performance (Ubuntu server took about 10 times longer just to install.) NFS has the same issue, by the way. – user3841784 Jun 26 '15 at 14:44

AFAIK you cannot make ESXi to wait for a VM to start before mounting the datastores. I may be wrong though.

The datastores are mounted way before any VM can boot up.

In general iSCSI connects right away if you do a rescan on the iSCSI sw adapter after your storage VM boots up (and rescan it works way better than NFS, where if it gets disconnected/inactive for a while it may take quite some time until it even retries to connect)

You could try on your storage VM to write a bash script that after the guest OS & services are started it will connect via SSH to the ESXi and issue a iscsi adapter rescan command so that ESXi will see and mount the iscsi datastore.

Still though that won't be perfect as you would have to manually boot all the rest of the VMs that will be become accessible after that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.