VMware Cloud Community
emlock
Contributor
Contributor

Auto mount iscsi datastore esxi 6

Good morning everyone,

I bought a used primergy tx200 s7 with xeon e5 quad core and 32gb of ram, 4 sata disks in total and one of them used as esxi 6 installation and the 2 main vms: sophos utm home and freenas 9.10.1.

Freenas is installed in the same disk of the esxi and it has a passthrough going to the other 3 sata disks that i use for cifs and iscsi datastore.

Next i created a virtual storage network with vmkernel port address 172.16.0.1/24 then attached to a virtual nic of freenas with ip 172.16.0.2/24, set up mtu 9000 to the vswitch, vmkernel and on the freenas interface dedicated to iscsi.

The setup is fine in fact i can attach the iscsi datastore to the host and install vm on it, the issue comes when i have to reboot the host.

when the host reboots the freenas vm automatically restart with host but the vm stored inside the iscsi datastore are unknown and if i go to check if the datastore is mounted in fact it isn't, so i have to rescan datastores and then the iscsi datastore shows up again with all the vms.

So it seems to be an automount issue of the iscsi datastore. my version of esxi is 6u2 and freenas is the latest 9.10.1. I have setup only the dynamic discover on the storage adapter do i have to set also the static discovery?

Is there anyone with the same issue? I've been searching for a while and i can't find a good solution for my problem.

Thanks to everyone

0 Kudos
2 Replies
hussainbte
Expert
Expert

Hi emlock,

As part of ESXi boot procedure, the step to verify the storage connectivity of all datastore and mount them comes before powering on the VMs hosted on them.

So obviously when the host is booting up it cannot find the NAS/iSCSI as it is exported of a VM which is hosted by the ESXi.

Configuring Static discovery for iSCSI will also not help.

Every time the host boots you have to manually mount the LUNs.

OR

We have to look for cron job in ESXi which mounts the datastores after a time gap on boot(to make sure the VMs have powered on)

If you found my answers useful please consider marking them as Correct OR Helpful Regards, Hussain https://virtualcubes.wordpress.com/
0 Kudos
emlock
Contributor
Contributor

Thanks for the answer, i think that the second solution is the way. now i'm very noob in esxi and i never schedule a cron job on it, is it possible to add a cron job with "if the freenas vm is on then do a rescan datastore" or something like that? can you help me?

0 Kudos