VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

How can I refresh storage devices on ESXi host using PowerCLI ?

How can I refresh storage devices on ESXi host using PowerCLI ?

ganapa2000_0-1623145042661.png

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could use the Get-VMHostStorage cmdlet, but that does more than just refresh.
It also returns the storage information.

To only do a Refresh, you could do

$esxName = 'MyEsx'
$esx = Get-VMHost -Name $esxName
$storSys = Get-view -Id $esx.ExtensionData.ConfigManager.StorageSystem
$storSys.RefreshStorageSystem()

 


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

View solution in original post

0 Kudos
3 Replies
amohammadimir
Hot Shot
Hot Shot
Jump to solution

You can use this command:

Get-VmHostStorage -VMHost < Specifiy the host > -Refresh

For Example:

Get-VmHostStorage -VMHost 10.23.112.234 -Refresh

Retrieves storage information from the virtual machine host with IP address 10.23.112.234.

Please remember to mark the replies as answers if they helped.
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You could use the Get-VMHostStorage cmdlet, but that does more than just refresh.
It also returns the storage information.

To only do a Refresh, you could do

$esxName = 'MyEsx'
$esx = Get-VMHost -Name $esxName
$storSys = Get-view -Id $esx.ExtensionData.ConfigManager.StorageSystem
$storSys.RefreshStorageSystem()

 


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Thank you very much. 🙂

0 Kudos