Enable-AzBatchAutoScale
啟用集區的自動調整。
語法
Enable-AzBatchAutoScale
[-Id] <String>
[[-AutoScaleFormula] <String>]
[[-AutoScaleEvaluationInterval] <TimeSpan>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Enable-AzBatchAutoScale Cmdlet 可自動調整指定的集區。
範例
範例 1:啟用集區的自動調整
$Formula = 'totalNodes=($CPUPercent.GetSamplePercent(TimeInterval_Minute*0,TimeInterval_Minute*10)<0.7?5:(min($CPUPercent.GetSample(TimeInterval_Minute*0, TimeInterval_Minute*10))>0.8?($CurrentDedicated*1.1):$CurrentDedicated));$TargetDedicated=min(100,totalNodes);';
Enable-AzBatchAutoScale -Id "MyPool" -AutoScaleFormula $Formula -BatchContext $Context
第一個命令會定義公式,然後將它儲存至$Formula變數。 第二個命令會使用 $Formula 中的公式,在名為 MyPool 的集區上啟用自動調整。
參數
-AutoScaleEvaluationInterval
指定集區大小根據自動調整公式自動調整之前經過的時間量(以分鐘為單位)。 默認值為 15 分鐘,最小值為 5 分鐘。
類型: | Nullable<T>[TimeSpan] |
Position: | 2 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-AutoScaleFormula
指定集區中所需計算節點數目的公式。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-BatchContext
指定此 Cmdlet 用來與 Batch 服務互動的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取金鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
類型: | BatchAccountContext |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Id
指定要啟用自動調整之集區的物件識別碼。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |