Tag Archives: LUNs

Add multiple VMware datastores using PowerCLI

The other day I had to add 60+ new VMware datastores, rather than doing this manually using the vSphere web client wizard, I used a basic PowerCLI script (in a foreach loop) to create the datastores in one big bang!

Before carrying out these steps make sure new LUNs are presented to the ESXi host.  And make a note of the LUN id of first new LUN you created.  

NOTE – You can acquire the LUN id by analyzing “Runtime Name” of LUN.  Or alternatively the storage array may have this information also.  

Continue reading