Tag Archives: mount nfs

Ever had a bunch of vmware hosts that you want to add a NFS datastore on? It can be quite time consuming to say the least. In our environment we have a couple of NFS stores that should be available on all vmware hosts and I really don’t want to browse around all 50 or so hosts and check if they have them and then mount them if they’re not available. So, of course, I wrote a small powercli script to check if the NFS stores are mounted and then mount them if they’re not mounted: $vmhosts = Get-View -ViewType HostSystem -Filter @{“Runtime.ConnectionState” = “connected”} -Property name $progress = 1 $mounts = 1 foreach ($vmhost in $vmhosts) { Write-Progress -Activity “Checking $($vmhost.Name)” -PercentComplete ($progress/$vmhosts.count*100) if ((Get-Datastore -VMHost $vmhost.name | Where-Object {$_.name -eq “MGMT-ISO”}) -eq $NULL){ New-Datastore -vmhost $vmhost.name -Name MGMT-ISO -Nfs -NfsHost <nfsHost> -Path /MGMT-ISO $mounts++ } if ((Get-Datastore -VMHost…

Read more

1/1