Add API to rescan storage (#162)
* Add API to rescan storage Sync-VMhostStorage API is added to enable rescanning VMHostStorage * Fix typo
This commit is contained in:
Родитель
1b882ef600
Коммит
81ed929c2b
|
@ -72,7 +72,8 @@
|
|||
"New-VmfsDatastore",
|
||||
"Dismount-VmfsDatastore",
|
||||
"Resize-VmfsVolume",
|
||||
"Restore-VmfsVolume"
|
||||
"Restore-VmfsVolume",
|
||||
"Sync-VMHostStorage"
|
||||
)
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
|
|
|
@ -448,3 +448,35 @@ function Restore-VmfsVolume {
|
|||
|
||||
$Esxi | Get-VMHostStorage -RescanVMFS -ErrorAction stop | Out-Null
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Rescans host storage
|
||||
|
||||
.PARAMETER VMHostName
|
||||
Name of the VMHost (ESXi server)
|
||||
|
||||
|
||||
.EXAMPLE
|
||||
Sync-VMHostStorage -VMHostName "vmhost1"
|
||||
|
||||
.INPUTS
|
||||
VMHostName.
|
||||
|
||||
.OUTPUTS
|
||||
None.
|
||||
#>
|
||||
function Sync-VMHostStorage {
|
||||
[CmdletBinding()]
|
||||
[AVSAttribute(10, UpdatesSDDC = $false)]
|
||||
Param (
|
||||
[Parameter(
|
||||
Mandatory=$true,
|
||||
HelpMessage = 'VMHost name')]
|
||||
[ValidateNotNull()]
|
||||
[String]
|
||||
$VMHostName
|
||||
)
|
||||
|
||||
Get-VMHost $VMHostName | Get-VMHostStorage -RescanAllHba -RescanVMFS | Out-Null
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче