New-XenClusterHost
Creates a new ClusterHost object.
Syntax
New-XenClusterHost -HashTable <hashtable> [-PassThru] [-BestEffort]
[-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenClusterHost -Record <Cluster_host> [-PassThru] [-BestEffort]
[-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenClusterHost [-PassThru] [-Cluster <XenRef[Cluster]>] [-XenHost <XenRef[Host]>]
[-PIF <XenRef[PIF]>] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm]
[-Async] [<CommonParameters>]
Description
Creates a new ClusterHost object.
Cluster\_host.create: Add a new host to an existing cluster.
ClusterHost: Cluster member metadata.
Parameters
-Async
If set, the operation runs asynchronously and returns a Task object that can be used to track its progress.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-BestEffort
If set, the cmdlet continues processing further objects instead of throwing a terminating error when an operation fails for one object.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Cluster
Cluster to join
| Attribute | Value |
|---|---|
| Type | XenRef[Cluster] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Confirm
Prompts for confirmation before running the cmdlet.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Aliases | cf |
-HashTable
A hashtable of field names to values, from which to create the ClusterHost.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-PIF
Network interface to use for communication
| Attribute | Value |
|---|---|
| Type | XenRef[PIF] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-PassThru
If set, the cmdlet returns the affected object. By default the cmdlet does not generate any output.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Record
An existing ClusterHost record whose fields are used to create the new object.
| Attribute | Value |
|---|---|
| Type | Cluster_host |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-SessionOpaqueRef
The session object on which to run the cmdlet. This overrides the default session and lets you target a specific open XenServer connection.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Aliases | wi |
-XenHost
new cluster member
| Attribute | Value |
|---|---|
| Type | XenRef[Host] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
Inputs
-
None
Outputs
-
Cluster_host -
Task -
void
Examples
Example 1: Create a ClusterHost
PS> $cluster = Get-XenCluster | Select-Object -First 1
PS> $xenHost = Get-XenHost | Select-Object -First 1
PS> $pif = Get-XenPIF | Select-Object -First 1
PS> New-XenClusterHost -Cluster $cluster -XenHost $xenHost -PIF $pif -PassThru
New-XenClusterHost takes the arguments of the create call rather than a record of fields, and needs all of them. -PassThru returns the new ClusterHost.
Example 2: Create a ClusterHost and wait for the task
PS> $cluster = Get-XenCluster | Select-Object -First 1
PS> $xenHost = Get-XenHost | Select-Object -First 1
PS> $pif = Get-XenPIF | Select-Object -First 1
PS> New-XenClusterHost -Cluster $cluster -XenHost $xenHost -PIF $pif -Async -PassThru |
Wait-XenTask -ShowProgress
-Async hands the work to the server and returns the Task that represents it, which pipes into Wait-XenTask.
Example 3: See what would be created
PS> $cluster = Get-XenCluster | Select-Object -First 1
PS> $xenHost = Get-XenHost | Select-Object -First 1
PS> $pif = Get-XenPIF | Select-Object -First 1
PS> New-XenClusterHost -Cluster $cluster -XenHost $xenHost -PIF $pif -WhatIf
Reports what would be created without creating it. Every cmdlet that changes the server takes -WhatIf and -Confirm.
Related links
-
Class: ClusterHost
-
Using the XenServer PowerShell module