Quantcast
Channel: VMware Communities: Message List - ESXi
Viewing all articles
Browse latest Browse all 28826

Re: Adding existing NFS datastores to new ESXi Host

$
0
0

PowerCLI would work great, especially if you use the Import-CSV command with files already populated with the ESXi hosts and NFS datastores.

 

nfs-datastores.txt - Datastores to map.

vmhosts.nfs - ESXi hosts to map datastores to.

 

Connect-VIServer -Server vcenter01
$dsin = Import-CSV nfs-datastores.txt

$hosts = Import-CSV vmhosts.nfs

foreach ($vmhost in $hosts){
 write-host Doing $vmhost.vmHost
 foreach ($ds in $dsin){

    $x = Get-VMHost -Name $vmhost.vmHost | New-Datastore -NFS -Path $ds.NfsPath -NfsHost $ds.NfsHost -Name $ds.NfsName    write-host $x     }
}

Viewing all articles
Browse latest Browse all 28826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>