Are you sure that datastore is reachable from all the ESXi nodes in the cluster?
Get-Datastore -Name T3-Data | Get-VMHost
Get-Cluster -Name CLS01 | Get-VMHost
show the same ESXi nodes?
it's reachable from my both hosts, and I'm already have vms on this datastore. also as mentioned the script sometimes work and sometimes partially not working as it could create a vm and fail in the rest.
one thing I tried failed too I did sleep-start 5 after foreach loops.
thanks and appreciate your support
Another possibility might be that you have some "ghost" folders on that datastore.
In other words, a folder with the name of the VM you are trying to create.
Can you check with the Browse Files option in the Web Client?
The output seems to indicate that datastore 'FN_OS' is not found.
Are you still using the original script from earlier in this thread?
Or can you attach the newer version?
still the same script just changed the $ds="FN_OS" another datastore i have as the following
Name FreeSpaceGB CapacityGB
---- ----------- ----------
TIER_I_DS 780.404 838.250
TIER_II_DS 147.476 465.500
datastore1 0.483 0.500
datastore1 (1) 0.483 0.500
FN_OS 225.430 249.500
T1_CRITICAL 48.550 49.500
T2-Data 98.550 99.500
T3-Data 24.018 72.750
the attached output shows that it successfully created 2 vms and failed in the last one on the same datastore.
Are you sure there is sufficient free space on that datastore to accomdate these VMs?
yes, there is enough space for the vms