VMware Cloud Community
mtrohde
Enthusiast
Enthusiast
Jump to solution

How to disable SCSI Cache with power cli?

 
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you use the V2 switch on the Get-EsxCli cmdlet?
Then you could use a hash table with the arguments.
Something like this for example

$esxcli.storage.core.device.inquirycache.set.Invoke(@{device=$naa;ignore=$true})


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
3 Replies
mtrohde
Enthusiast
Enthusiast
Jump to solution

I love that I can't seem to edit the main post....

This would be the ESXICLI command 
esxcli storage core device inquirycache set --device device id --ignore true

storage core device inquirycache set

Manipulate inquiry cache settings of storage devices.

--apply-all

Operate on all existing devices.

--device | -d

NAA ID of the device upon which to operate.

--ignore

Ignore device inquiry cache. (required)

--help

Show the help message.


I thought it would be something like below but it not.

$myesxcli.storage.core.device.inquirycache.set ($NAA, $ignore)

Any suggestions?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you use the V2 switch on the Get-EsxCli cmdlet?
Then you could use a hash table with the arguments.
Something like this for example

$esxcli.storage.core.device.inquirycache.set.Invoke(@{device=$naa;ignore=$true})


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
mtrohde
Enthusiast
Enthusiast
Jump to solution

Thank you again Sir!  As always you are a rockstar.

The snippet of code to perform this bit of configuration.  

##Connect to vCenter
Connect-VIServer "<your vcenter>"

##Outer Loop

Foreach ($EsxiHost in (Get-Content -Path C:\PowerShellScripts\esxi-host-list.txt))
{
$myesxcli = Get-EsxCli -VMHost $esxihost -V2
#Inner Loop
Write-Host "Working on host $esxihost"
Foreach ($RDMNAA in (Get-Content -Path C:\PowerShellScripts\RDM-NAA-list.txt))
{
##Enable
$myesxcli.storage.core.device.inquirycache.set.Invoke(@{device=$RDMNAA;ignore=$true})
##Disable
#$myesxcli.storage.core.device.inquirycache.set.Invoke(@{device=$RDMNAA;ignore=$falese})
}

}


Michael

Reply
0 Kudos