Knowledgebase:
How to map drives to all Hosts in vSphere
Posted by Mike Kirk on 25 April 2016 02:14 PM

see the example script below:

Connect-VIServer -Server <IP or Name> -Protocol https -User <username> -Password <pass>

get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name TEMP-NE-01-NFS1 -Path /volumes/nex0003-vol01/nfs1 -nfshost 10.10.5.81
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name TEMP-NEX-01-NFS2 -Path /volumes/nex0003-vol01/nfs2 -nfshost 10.10.5.81
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name na101_nfs101 -Path /vols/vol_nfs_101 -nfshost 10.10.5.233
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name nex.pnap.sm01.NFS2 -Path /volumes/nex-sm01-vol2/share1 -nfshost 10.10.5.24
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name nex.pnap.sm01.NFS3 -Path /volumes/nex-sm01-vol2/share2 -nfshost 10.10.5.24
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name gvcb -Path /nfs/gvcb -nfshost 10.10.5.247
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name nex.pnap.sm02.NFS2 -Path /volumes/nex-sm02-vol2/share1 -nfshost 10.10.5.25
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name nex.pnap.sm02.NFS3 -Path /volumes/nex-sm02-vol2/share2 -nfshost 10.10.5.25
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name nex.pnap.sm02.NFS4 -Path /volumes/nex-sm02-vol2/share3 -nfshost 10.10.5.25
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name sm01c.nfs6 -Path /volumes/vol1/nfs6 -nfshost 10.10.5.30
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name sm02c.nfs5 -Path /volumes/vol1/nfs5 -nfshost 10.10.5.31
get-cluster phx-nap-102-Tier2 | get-vmhost | New-Datastore -NFS -Name na201_nfs_vol121 -Path /vol/nfs_vol121 -nfshost 10.10.7.234

 

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).