< Back

Disable-AzureBatchComputeNodeScheduling

Tue Jan 29, 2019 9:34 pm

NAME Disable-AzureBatchComputeNodeScheduling



SYNOPSIS

Disables task scheduling on the specified compute node.





SYNTAX

Disable-AzureBatchComputeNodeScheduling [[-ComputeNode] <PSComputeNode>] -BatchContext <BatchAccountContext> [-DefaultProfile

<IAzureContextContainer>] [-DisableSchedulingOption {Requeue | Terminate | TaskCompletion}] [<CommonParameters>]



Disable-AzureBatchComputeNodeScheduling [-PoolId] <String> [-Id] <String> -BatchContext <BatchAccountContext> [-DefaultProfile

<IAzureContextContainer>] [-DisableSchedulingOption {Requeue | Terminate | TaskCompletion}] [<CommonParameters>]





DESCRIPTION

The Disable-AzureBatchComputeNodeScheduling cmdlet disables task scheduling on the specified compute node. A compute node is an Azure virtual

machine dedicated to a specific application workload. When you disable task scheduling on a compute node you will also have the option of

determining what to do about jobs currently in the node's task queue. Disable-AzureBatchComputeNodeScheduling lets you do the following:



- Terminate the tasks and put them back in the job queue. This enables those tasks to be rescheduled on another compute node. - Terminate the

tasks and remove them from the job queue. Tasks stopped in this manner will not be rescheduled. - Wait for all the tasks currently being executed

to complete and then disable task scheduling on the compute node.



- Wait for all the running tasks to complete and all the data retention periods to expire, and then disable task scheduling on the compute node.





PARAMETERS

-BatchContext <BatchAccountContext>

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzureRmBatchAccount

cmdlet to get your BatchAccountContext, then Azure Active Directory authentication will be used when interacting with the Batch service. To

use shared key authentication instead, use the Get-AzureRmBatchAccountKeys cmdlet to get a BatchAccountContext object with its access keys

populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the

BatchAccountContext.KeyInUse property.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ComputeNode <PSComputeNode>

Specifies an object reference to the compute node where task scheduling is disabled. This object reference is created by using the

Get-AzureBatchComputeNode cmdlet and storing the returned compute node object in a variable.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableSchedulingOption <DisableComputeNodeSchedulingOption>

Specifies how this cmdlet deals with any tasks currently running on the computer node where scheduling is being disabled. The acceptable

values for this parameter are:



- Requeue. Tasks are stopped immediately and returned to the job queue. This enables the tasks to be rescheduled on another compute node. This

is the default value. - Terminate. Tasks are stopped immediately and removed from the job queue. These tasks will not be rescheduled. -

TaskCompletion. Currently running tasks will be able to complete before task scheduling is disabled on the compute node. No new tasks will be

scheduled on this node. - RetainedData. Currently running tasks will be able to complete and data retention periods will be able to expire

before task scheduling is disabled on the compute node. No new tasks will be scheduled on this node.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Id <String>

Specifies the ID of the compute node where task scheduling is disabled.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PoolId <String>

Specifies the ID of the batch pool that contains the compute node where task scheduling is disabled.



If you use the PoolId parameter, do not use the ComputeNode parameter in that same command.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

BatchAccountContext

Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline



PSComputeNode

Parameter 'ComputeNode' accepts value of type 'PSComputeNode' from the pipeline





OUTPUTS



NOTES









Example 1: Disable task scheduling on a compute node



PS C:\\>$Context = Get-AzureRmBatchAccountKeys -AccountName "contosobatchaccount"

PS C:\\> Disable-AzureBatchComputeNodeScheduling -PoolId "myPool" -Id "tvm-1783593343_34-20151117t222514z" -BatchContext $Context



These commands disable task schedule on the compute node tvm-1783593343_34-20151117t222514z. To do this, the first command in the example creates

an object reference to the account keys for the batch account contosobatchaccount. This object reference is stored in a variable named $context.



The second command then uses this object reference and the Disable-AzureBatchComputeNodeScheduling cmdlet to connect to the pool myPool and

disable task scheduling on node tvm-1783593343_34-20151117t222514z.



Because the DisableComputeNodeSchedulingOptions parameter was not included any tasks currently running on the compute node will be requeued.





Example 2: Disable task scheduling on all compute nodes in a pool



PS C:\\>$Context = Get-AzureRmBatchAccountKeys -AccountName "contosobatchaccount"

PS C:\\> Get-AzureBatchComputeNode -PoolId "Pool06" -BatchContext $Context | Disable-AzureBatchComputeNodeScheduling -BatchContext $Context



These commands disable task scheduling on all the computer nodes in the batch pool Pool06. To perform this task, the first command in the example

creates an object reference to the account keys for the batch account contosobatchaccount. This object reference is stored in a variable named

$context.



The second command in the example then uses this object reference and Get-AzureBatchComputeNode to return a collection of all the compute nodes

found in Pool06. That collection is then piped to then Disable-AzureBatchComputeNodeScheduling cmdlet to disable task scheduling on each compute

node in the collection.



Because the DisableComputeNodeSchedulingOptions parameter was not included any tasks currently running on the compute nodes will be requeued.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... scheduling

Get-AzureRmBatchAccountKeys

Enable-AzureBatchComputeNodeScheduling