Remove-AzBatchComputeNode
從集區中移除計算節點。
Syntax
Remove-AzBatchComputeNode
[-PoolId] <String>
[-Ids] <String[]>
[-DeallocationOption <ComputeNodeDeallocationOption>]
[-ResizeTimeout <TimeSpan>]
[-Force]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzBatchComputeNode
[[-ComputeNode] <PSComputeNode>]
[-DeallocationOption <ComputeNodeDeallocationOption>]
[-ResizeTimeout <TimeSpan>]
[-Force]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Remove-AzBatchComputeNode Cmdlet 會從集區中移除 Azure Batch 計算節點。
範例
範例 1:移除計算節點
Remove-AzBatchComputeNode -PoolId "Pool07" -Ids "tvm-2316545714_1-20150725t213220z" -DeallocationOption Terminate -ResizeTimeout ([TimeSpan]::FromMinutes(10)) -BatchContext $Context
此命令會從具有ID Pool07 的集區中移除具有指定標識碼的計算節點。 命令會指定終止解除分配選項。 重設大小逾時為10分鐘。
範例 2:使用管線移除計算節點
Get-AzBatchComputeNode -PoolId "Pool07" -Id "tvm-2316545714_1-20150725t213220z" -BatchContext $Context | Remove-AzBatchComputeNode -Force -BatchContext $Context
此命令會使用 Get-AzBatchComputeNode Cmdlet,從具有 ID Pool07 的集區取得具有指定標識符的計算節點。 命令會使用管線,將該節點傳遞至目前的 Cmdlet。 目前的 Cmdlet 會移除計算節點。 命令會 指定 Force 參數。 因此,命令不會提示您進行確認。
範例 3:移除多個節點
Remove-AzBatchComputeNode -PoolId "Pool07" @("tvm-1783593343_28-20151117t214257z","tvm-1783593343_29-20151117t214257z") -Force -BatchContext $Context
此命令會從具有ID Pool07 的集區中移除兩個計算節點。 命令不會提示您進行確認。
參數
-BatchContext
指定 此 Cmdlet 用來與 Batch 服務互動的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用 Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取密鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ComputeNode
指定 PSComputeNode 物件,代表這個 Cmdlet 移除的計算節點。
Type: | PSComputeNode |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
執行 Cmdlet 之前先提示您確認。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeallocationOption
指定此 Cmdlet 啟動之移除作業的解除分配選項。 預設值為 Requeue。
Type: | Nullable<T>[ComputeNodeDeallocationOption] |
Accepted values: | Requeue, Terminate, TaskCompletion, RetainedData |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
強制命令執行,而不要求使用者確認。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Ids
指定這個 Cmdlet 從集區中移除之計算節點的識別子陣列。
Type: | String[] |
Aliases: | Id |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PoolId
指定集區標識碼,其中包含此 Cmdlet 移除的計算節點。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResizeTimeout
指定從集區中移除計算節點的超時時間間隔。 預設值為 10 分鐘。 最小值為 5 分鐘。
Type: | Nullable<T>[TimeSpan] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
輸出
相關連結
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應