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

Re: ESXCLI methods

$
0
0

This works I would like to share it in the community also.

 

Add-PSsnapin VMware.VimAutomation.Core

$defaultpsp = "VMW_PSP_RR"

$psp = "VMW_PSP_RR"

$satp1 = "VMW_SATP_DEFAULT_AA"

Connect-VIServer -Server "xxx" -User "xxx" -Password "xxx"

$esxhosts = get-cluster | Get-VMHost

foreach($esx in $esxhosts){

  $esxcli = Get-EsxCli -VMHost $esx -ErrorAction SilentlyContinue

  if($esxcli){

    $nmpdevlist = $esxcli.storage.nmp.device.list() | Where {$_.StorageArrayType -eq $satp1}

    foreach($dev in $nmpdevlist){

     $esxcli.storage.nmp.device.set($false, $dev.device, $psp) | Out-Null     

     }

     $esxcli.storage.nmp.satp.set($true, $defaultpsp, $satp1) | Out-Null   

     }

}

Disconnect-VIServer -Server "xxx" -Confirm:$false


Viewing all articles
Browse latest Browse all 236824

Trending Articles



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