你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Enable-AzureBatchComputeNodeScheduling
在指定的计算节点上启用任务计划。
警告
截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。
尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源。
语法
Enable-AzureBatchComputeNodeScheduling
[-PoolId] <String>
[-Id] <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Enable-AzureBatchComputeNodeScheduling
[[-ComputeNode] <PSComputeNode>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Enable-AzureBatchComputeNodeScheduling cmdlet 在指定的计算节点上启用任务计划。 计算节点是专用于特定应用程序工作负荷的 Azure 虚拟机。
示例
示例 1:在计算节点上启用任务计划
PS C:\>$Context = Get-AzureRmBatchAccountKeys -AccountName "contosobatchaccount"
PS C:\> Enable-AzureBatchComputeNodeScheduling -PoolId "myPool" -Id "tvm-1783593343_34-20151117t222514z" -BatchContext $Context
这些命令在计算节点 tvm-1783593343_34-20151117t222514z 上启用任务计划。 为此,示例中的第一个命令将创建一个对象引用,其中包含批处理帐户 contosobatchaccount 的帐户密钥。 此对象引用存储在名为$context的变量中。 然后,第二个命令使用此对象引用和 Enable-AzureBatchComputeNodeScheduling cmdlet 连接到池 myPool,并在 tvm-1783593343_34-20151117t222514z 上启用任务计划。
示例 2:在池中的计算节点上启用任务计划
PS C:\>$Context = Get-AzureRmBatchAccountKeys -AccountName "contosobatchaccount"
PS C:\> Get-AzureBatchComputeNode -PoolId "Pool06" -BatchContext $Context | Enable-AzureBatchComputeNodeScheduling -BatchContext $Context
这些命令在池池06 中找到的所有计算节点上启用任务计划。 若要执行此任务,示例中的第一个命令将创建一个对象引用,其中包含批处理帐户 contosobatchaccount 的帐户密钥。 此对象引用存储在名为$context的变量中。 然后,示例中的第二个命令使用此对象引用和 Get-AzureBatchComputeNode 返回 Pool06 中找到的所有计算节点的集合。 然后,该集合通过管道传递给 Enable-AzureBatchComputeNodeScheduling cmdlet,该 cmdlet 可在集合中的每个计算节点上启用任务计划。
参数
-BatchContext
指定 此 cmdlet 用于与 Batch 服务交互的 BatchAccountContext 实例。 如果使用 Get-AzureRmBatchAccount cmdlet 获取 BatchAccountContext,则在与 Batch 服务交互时将使用 Microsoft Entra 身份验证。 若要改用共享密钥身份验证,请使用 Get-AzureRmBatchAccountKeys cmdlet 获取包含其访问密钥的 BatchAccountContext 对象。 使用共享密钥身份验证时,默认使用主访问密钥。 若要更改要使用的密钥,请设置 BatchAccountContext.KeyInUse 属性。
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ComputeNode
指定对启用任务计划计算节点的对象引用。 此对象引用是使用 Get-AzureBatchComputeNode cmdlet 创建的,并将返回的计算节点对象存储在变量中。
Type: | PSComputeNode |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
指定启用任务计划的计算节点的 ID。
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PoolId
指定包含启用任务计划的计算节点的批处理池的 ID。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输入
参数:ComputeNode (ByValue)
参数:BatchContext (ByValue)