1.Get-ResourcePool
功能:检索在vSphere服务器上的资源池。
语法:
Get-ResourcePool [-VM <VirtualMachine[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-Id <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>]
例子:
$server = Connect-VIServer -Server 10.23.112.235 Get-ResourcePool -Server $server -VM VM
2.Set-ResourcePool
功能:更改指定资源池的属性。
语法:
Set-ResourcePool [-ResourcePool] <ResourcePool[]> [-Name <String>] [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemReservationMB <Int64>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
例子:
Set-ResourcePool -Resourcepool Resourcepool -NumCpuShares 512 -MemLimitMB 256
3.New-ResourcePool
功能:创建一个新的资源池。
语法:
New-ResourcePool -Location <VIContainer> -Name <String> [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemReservationMB <Int64>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
例子:
$resourcepool1 = Get-ResourcePool -Location Cluster -Name ResourcePool1 New-ResourcePool -Location $resourcepool1 -Name ResourcePool2 -CpuExpandableReservation $true -CpuReservationMhz 500 -CpuSharesLevel high -MemExpandableReservation $true -MemReservationMB 500 -MemSharesLevel high
4.Move-ResourcePool
功能:移动资源池从一个位置到另一个位置。
语法:
Move-ResourcePool [-ResourcePool] <ResourcePool[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
例子:
Move-ResourcePool -ResourcePool ResourcePool -Destination Host
5.Remove-ResourcePool
功能:删除指定的资源池。
语法:
Remove-ResourcePool [-ResourcePool] <ResourcePool[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
例子:
Remove-ResourcePool -ResourcePool ResourcePool
转载于:https://blog.51cto.com/370135415/592669