Create a VMFS datastore via powershell
Due to limitations in ESX4, I recently needed to create several 2TB VMFS volumes. I can easily automate this on the SAN configuration, but creating the VMFS datastores has always been a manual process. I came across sample code at http://snipplr.com/view.php?codeview&id=48048 that showed how to perform this via powershell.
I modified it a bit to work in my environment and posted the code below
Syntax to run: New-DatastoreByLun “myESXHost” “SANB” 9 0 “Datastore01”