VMwareVMware ESXi

Datastore Path Raporu Nasıl Alınır?

Merhaba,

VMware ESXi üzerinde bulunan datastore’ların path’lernin durumlarını listelemek isteyebilirsiniz. Bunun için eğer komut satırını biliyorsanız SSH üzerinden gerekli kontrolleri sağlayabilirsiniz.

Ayrıca browser üzerindende isterseniz kontrol edebilirsiniz. Ancak bu işlem biraz zamanınızı alacaktır. Bunun için aşağıdaki script’i kullanabilirsiniz. Ek olarak eğer RVtools kullanıyorsanız RVtools ile de bunu basit bir şekilde alabilirsiniz.

[php]

Connect-VIServer -Server servername -User username -password password
$expotDSPathCount=@()
#Get list of ESXi Hosts
$esxihosts=gc C:\hosts.txt
$countofESXi=$esxihosts.Count
For($i = 1; $i -le $esxihosts.count; $i++)
{
ForEach ($esxihost in $esxihosts) {
$esxi = Get-VMHost -Name $esxihost
$hbas = $esxi | Get-VMH

ostHba
ForEach ($hba in $hbas) {
$scsiluns = $hba | Get-ScsiLun
ForEach ($scsilun in $scsiluns) {
$exportDSPaths=New-Object PSObject
$scsipaths =$scsilun | Get-Scsilunpath |Select-Object *
$LunPathPolicy=$scsilun.MultipathPolicy
$PathCount=$scsipaths.Count
$LunNaaID=$scsilun.CanonicalName
$DS=Get-Datastore |Get-View |Where-Object {$_.Info.vmfs.Extent.DiskName -eq $LunNaaID}
#Write-Host $DS.Name,$LunNaaID,$LunPathPolicy,$PathCount,$hba.Name,$esxi.Name
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “EsxiHost” -Value $esxi.Name
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “DatastoreName” -Value $DS.Name
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “LunNAAID” -Value $LunNaaID
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “MultipathPolicy” -Value $LunPathPolicy
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “LunPathCount” -Value $PathCount
$exportDSPaths|Add-Member -MemberType NoteProperty -Name “VmHBA Connected” -Value $hba.Name
$datastore=$DS.Name
$expotDSPathCount+=$exportDSPaths
Write-Progress -Activity “Now Scaning $datastore in $hba on $esxi” -status “Found $countofESXi esxi hosts and working on $esxi” -PercentComplete ($i / $esxihosts.count*100)
}
}
}
$expotDSPathCount| Export-Csv -NoTypeInformation ‘DSPathCountInformation.csv’
}

[/php]

Yukarıdaki script’i çalıştırdığınızda aşağıdaki bilgiler çekiyor olursunuz.

  • ESXi hostname
  • Datastore Name
  • LUNNAAID
  • Path Sellection Policy
  • Lun Path Count
  • HBA Status

Umarım faydalı olmuştur.

İyi çalışmalar.

0 0 votes
Makaleyi Oylamayı Unutmayın !

Tayfun DEĞER

Bu yazı blog üzerinde Tayfun DEĞER tarafından paylaşılmıştır. 2009 yılında açılan blog kısa zaman içerisinde büyük bir izleyici kitlesine sahip olmuştur. Tayfun DEĞER danışmanlık ve eğitimler vermektedir. vExpert 2013-2019, VCP4/5/6, VCP5-DT, VCP-Cloud ve MCSE sertifikalarına sahiptir.Twitter 'dan @tayfundeger veya RSS ile sitedeki değişiklikleri takip edebilirsiniz.

İlgili Makaleler

Subscribe
Bildir
guest

2 Yorum
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Uğur Yavuz
Uğur Yavuz

Tarayıcı üzerinden dediğiniz gibi biraz vakit alıyor, SSH ile de hızlı oluyor ama script ile daha hızlı oluyor. Teşekkürler script için.

İbrahim Aslan
İbrahim Aslan

Rvtools ile bakmak daha basit hocam aslında.

Başa dön tuşu
2
0
Görüşlerini belirtmek ister misin?x