用命令来操作vSphere:十六 PowerCLI命令--群集操作

1.Get-Cluster

功能:检索在vSphere的服务器上的集群。

语法:

Get-Cluster [-VM <VirtualMachine[]>] [-VMHost <VMHost[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-Id <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>]

例子:

Get-Cluster -Location Folder

2.Set-Cluster

功能:更改群集配置。

语法:

Set-Cluster [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-Cluster] <Cluster> [[-Name] <String>] [-HAEnabled [<Boolean>]] [-HAAdmissionControlEnabled [<Boolean>]] [-HAFailoverLevel <Int32>] [-DrsEnabled [<Boolean>]] [-DrsMode <DrsMode>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Profile <VMHostProfile>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]

例子:

$cluster1 = New-Cluster -Name Cluster1 -Location Datacenter $cluster2 = Set-Cluster -Cluster $cluster1 -Name Cluster2

3.New-Cluster

功能:创建一个新的群集。

语法:

New-Cluster [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-Name] <String> -Location <VIContainer> [-HAEnabled] [-HAAdmissionControlEnabled] [-HAFailoverLevel <Int32>] [-DrsEnabled] [-DrsMode <DrsMode>] [-DrsAutomationLevel <DrsAutomationLevel>] [-WhatIf] [-Confirm] [<CommonParameters>]

例子:

$engineeringFolder = Get-Folder Engineering New-Cluster -Location Folder -Name Cluster -DRSEnabled -DRSMode FullyAutomated

4.Move-Cluster

功能:移动集群从vSphere的一个位置到另一个位置。

语法:

Move-Cluster [-Cluster] <Cluster[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]

例子:

Move-Cluster -Cluster Cluster -Destination Folder

5.Remove-Cluster

功能:删除指定的集群。

语法:

Remove-Cluster [-Cluster] <Cluster[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]

例子:

$cluster = New-Cluster -Name Cluster -Location Datacenter Remove-Cluster $cluster -Confirm:$false

你可能感兴趣的:(职场,服务器,休闲,vsphere,PowerCLI)