Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 210400

Re: Mount Replicated LUNs

$
0
0

Here's the updated script:

 

#prompt for ClusterName

$clustername = Read-Host "Please enter the Cluster name"

$cluster = Get-Cluster -name $clustername

Get-Cluster $cluster | Get-VMHost | Get-VMHostStorage -RescanAllHba

 

 

$hostsincluster = Get-VMHost -Location $cluster

ForEach($esx in $hostsincluster){

     

   # Check for unresolved UUID

      $VMHost = $esx

      $HstSys = Get-View $esx.id

      $HstDsSys = Get-View $HstSys.ConfigManager.DatastoreSystem

      $UnresVols = @($HstDsSys.QueryUnresolvedVmfsVolumes())

 

 

      # Resolve UUID for each on each ESXi host in the cluster

   $HstSSys = Get-view $esx.StorageInfo

      $UnresVols | %{

           $Extent = $_.Extent

           $DevicePath = $Extent.DevicePath

           $ResSpec = New-Object Vmware.Vim.HostUnresolvedVmfsResolutionSpec[](1)

           $ResSpec[0].ExtentDevicePath = $DevicePath

           $ResSpec[0].UuidResolution = “forceMount”

           $HstSSys.ResolveMultipleUnresolvedVmfsVolumes($ResSpec)

      }

 

 

      # Rescan for VMFS volumes

      $VMHost | Get-VMHostStorage -RescanVmfs

  

}


Viewing all articles
Browse latest Browse all 210400

Trending Articles



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