Ako skontrolovať ATS na datastoreoch?

Môžete dostať úlohu skontrolovať, či datastores maju naconfigurované používanie ATS-ONLY.

Pre použitie príkazov ako je vmkfstools na hoste, potrebujeme doinštalovať plugin na esx host, na ktorom chceme príkazy spúšťať. Postupoval som podľa webu v-front.de

Add-PSSnapin VMware.VimAutomation.Core

$vc = vc.yourcompany.com

Connect-VIServer -Server $vc

$esxcli = Get-EsxCli -VMhost esx1.yourcompany.com

$report = @()

$ats = "ATS-only"

(Get-Datastore -Server $vc).Name | ForEach-Object {

                    $row = "" | Select-Object "Datastore", "ATS-only"

                    $row."Datastore" = $_

             if (($esxcli.shell.cmd("vmkfstools -Ph -v1 /vmfs/volumes/$_",$null,$null,$null,$null)).contains("Error")){

             $row."ATS-only" = "Error"

             $report += $row

             }

             else{

             $row."ATS-only" = ($esxcli.shell.cmd("vmkfstools -Ph -v1 /vmfs/volumes/$_",$null,$null,$null,$null)).contains("$ats")}

             }

}
$report | Format-Table -AutoSize

Author: Martin

Infrastructure engineer | virtualization & cloud enthusiast | vSphere specialist | blogger | VMware vExpert 2017, 2018, 2019, 2020 | VMCE | Slovak VMUG Leader |  user group ambassador for kmug.sk | husband&father

Leave a Reply

Your email address will not be published. Required fields are marked *