Assign-HpcNodeTemplate

Assign-HpcNodeTemplate

Assigns or reapplies a node template to one or more specified nodes. As a result, the cmdlet rebuilds the nodes with the information from the node template.

Syntax

Parameter Set: NodeName-Template
Assign-HpcNodeTemplate [[-Name] <String> ] -NodeName <String[]> [-Async] [-Comment <String> ] [-PassThru] [-Rebuild] [-Scheduler <String> ] [-Template <HpcNodeTemplate> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: Node-Maintain
Assign-HpcNodeTemplate -Maintain -Node <HpcNode[]> [-Async] [-Comment <String> ] [-PassThru] [-Scheduler <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NodeName-Maintain
Assign-HpcNodeTemplate -Maintain -NodeName <String[]> [-Async] [-Comment <String> ] [-PassThru] [-Scheduler <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: Node-Template
Assign-HpcNodeTemplate [[-Name] <String> ] -Node <HpcNode[]> [-Async] [-Comment <String> ] [-PassThru] [-Rebuild] [-Scheduler <String> ] [-Template <HpcNodeTemplate> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Assigns or reapplies a node template to one or more specified nodes. This cmdlet is equivalent to the clicking a node and then clicking Assign Node Template in HPC Cluster Manager.

Parameters

-Async

Applies or reapplies the node template asynchronously. The cmdlet exits without waiting for the nodes to finish provisioning.

If you specify the Async parameter, the PassThru parameter has no effect. Also, the return type is an HpcWorkItem object when you specify Async. You can use this HpcWorkItem object to track the status of the updates to the nodes.

Aliases

none

Required?

false

Position?

named

Default Value

not applicable

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Comment<String>

Specifies a comment to use when the cmdlet reimages the node. The comment appears in the Comments column of the operations lists that are available in HPC cluster manager.

The comment is not used if the other parameters for the cmdlet indicate that the cmdlet should not reimage the node. For example, the comment is not used if you specify the Maintain parameter.

Aliases

none

Required?

false

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Maintain

Updates the specified nodes by incrementally reapplying the Maintain section of the node templates that are already associated with the nodes. Specifying this parameter is equivalent to clicking the node and clicking Maintain in HPC Cluster Manager. You cannot specify the Maintain parameter if you also specify any of the following parameters: Name, Template, or Rebuild.

Aliases

none

Required?

true

Position?

named

Default Value

not applicable

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the node template to apply to the specified nodes. You cannot specify the Name parameter if you also specify either the Template or the Maintain parameter.

Aliases

none

Required?

false

Position?

1

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Node<HpcNode[]>

Specifies a list of one or more HpcNode objects for the nodes to which you want to assign or reapply the node templates. Use the Get-HpcNode cmdlet to get the HpcNode objects for the nodes. You cannot specify both the Node and NodeName parameters.

Aliases

none

Required?

true

Position?

named

Default Value

no default

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-NodeName<String[]>

Specifies a list of the names of one or more nodes to which you want to assign or reapply the node templates. You cannot specify both the NodeName and Node parameters. This parameter is a filter parameter, so you do not receive an error for specifying a node the does not exist in the HPC cluster as long as you specify at least one node that does exist.

Aliases

none

Required?

true

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Causes the cmdlet to return the HpcNode objects for the specified nodes after the cmdlet applies the node templates to the nodes, and displays information about those nodes if you do not redirect the output of the cmdlet to another cmdlet or save the output in a variable.

The PassThru parameter has no effect if you also specify the Async parameter. In that case, the cmdlet behaves as though you only specified the Async parameter. If you specify the PassThru parameter and do not specify the Async parameter, the return type for the cmdlet consists of one or more HpcNode objects.

Aliases

none

Required?

false

Position?

named

Default Value

not applicable

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Rebuild

Rebuilds the operating system of the specified nodes by using the operating system image specified in the operating system reinstallation steps in the node template. When you specify the Rebuild parameter, the Assign-HpcNodeTemplate cmdlet applies all of the steps in the node template, and not just the steps in the Maintain section of the node template. When you specify the Rebuild parameter, the node template must contain the steps to reinstall an operating system image.

You cannot specify both the Rebuild and the Maintain parameters.

Aliases

none

Required?

false

Position?

named

Default Value

not applicable

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Scheduler<String>

Specifies the host name or IP address of the head node for the cluster that includes the nodes and node templates. The value must be a valid computer name or IP address. If you do not specify the Scheduler parameter, this cmdlet uses the scheduler on the head node that the CCP_SCHEDULER environment variable specifies. To set this environment variable, run the following cmdlet:

Set-Content Env:CCP_SCHEDULER <head_node_name>

Aliases

none

Required?

false

Position?

named

Default Value

%CCP_SCHEDULER%

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Template<HpcNodeTemplate>

Specifies an HpcNodeTemplate object for the node template that you want to apply to the specified nodes. Use the Get-HpcNodeTemplate cmdlet to get the HpcNodeTemplate object for a node template. You cannot specify the Template parameter if you also specify either the Name or the Maintain parameter.

Aliases

none

Required?

false

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • One or more HpcNode objects.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None, except as described for the Async and PassThru parameters.

Notes

  • The specified nodes must be in the offline state before you can assign or reapply node templates to the nodes.

  • If you reassign the node template that is already associated with the node to the node by explicitly specifying the node template with the Name or Template parameter, the Assign-HpcNodeTemplate behaves the same as if you specified the Rebuild parameter without specifying a node template.

  • The built-in ConfirmImpact setting for this cmdlet is High. If this ConfirmImpact setting is equal to or higher than the value of the $ConfirmPreference variable for your environment, the cmdlet prompts for confirmation unless you specify –Confirm:$false. If this ConfirmImpact setting is lower than the value of the $ConfirmPreference variable for your environment, the cmdlet does not prompt for confirmation unless you specify –Confirm or –Confirm:$true.

  • You must be a cluster administrator to run this cmdlet successfully.

Examples

EXAMPLE 1

Applies a node template named DefaultNodeTemplate to all of the nodes in the unknown state.

PS C:\>Get-HpcNode -State Unknown | Assign-HpcNodeTemplate -Name DefaultNodeTemplate

EXAMPLE 2

Applies a node template named DefaultNodeTemplate asynchronously to all of the nodes in the unknown state. This example returns an operation work item that you can subsequently use to track the status of the operation.

PS C:\>$w = Get-HpcNode -State Unknown | Assign-HpcNodeTemplate -Name DefaultNodeTemplate -Async Get-HpcOperation -WorkItem $w

Get-HpcNode

Get-HpcNodeTemplate