Delen via


New-AzBatchPool

Hiermee maakt u een pool in de Batch-service.

Syntaxis

New-AzBatchPool
   [-Id] <String>
   -VirtualMachineSize <String>
   [-DisplayName <String>]
   [-ResizeTimeout <TimeSpan>]
   [-TargetDedicatedComputeNodes <Int32>]
   [-TargetLowPriorityComputeNodes <Int32>]
   [-TaskSlotsPerNode <Int32>]
   [-UpgradePolicy <PSUpgradePolicy>]
   [-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
   [-ResourceTag <IDictionary>]
   [-Metadata <IDictionary>]
   [-InterComputeNodeCommunicationEnabled]
   [-StartTask <PSStartTask>]
   [-CertificateReferences <PSCertificateReference[]>]
   [-ApplicationPackageReferences <PSApplicationPackageReference[]>]
   [-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
   [-CloudServiceConfiguration <PSCloudServiceConfiguration>]
   [-NetworkConfiguration <PSNetworkConfiguration>]
   [-MountConfiguration <PSMountConfiguration[]>]
   [-UserAccount <PSUserAccount[]>]
   [-CurrentNodeCommunicationMode <NodeCommunicationMode>]
   [-TargetNodeCommunicationMode <NodeCommunicationMode>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBatchPool
   [-Id] <String>
   -VirtualMachineSize <String>
   [-DisplayName <String>]
   [-ResizeTimeout <TimeSpan>]
   [-TargetDedicatedComputeNodes <Int32>]
   [-TargetLowPriorityComputeNodes <Int32>]
   [-TaskSlotsPerNode <Int32>]
   [-UpgradePolicy <PSUpgradePolicy>]
   [-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
   [-ResourceTag <IDictionary>]
   [-Metadata <IDictionary>]
   [-InterComputeNodeCommunicationEnabled]
   [-StartTask <PSStartTask>]
   [-CertificateReferences <PSCertificateReference[]>]
   [-ApplicationPackageReferences <PSApplicationPackageReference[]>]
   [-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
   [-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
   [-NetworkConfiguration <PSNetworkConfiguration>]
   [-MountConfiguration <PSMountConfiguration[]>]
   [-UserAccount <PSUserAccount[]>]
   [-CurrentNodeCommunicationMode <NodeCommunicationMode>]
   [-TargetNodeCommunicationMode <NodeCommunicationMode>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBatchPool
   [-Id] <String>
   -VirtualMachineSize <String>
   [-DisplayName <String>]
   [-AutoScaleEvaluationInterval <TimeSpan>]
   [-AutoScaleFormula <String>]
   [-TaskSlotsPerNode <Int32>]
   [-UpgradePolicy <PSUpgradePolicy>]
   [-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
   [-ResourceTag <IDictionary>]
   [-Metadata <IDictionary>]
   [-InterComputeNodeCommunicationEnabled]
   [-StartTask <PSStartTask>]
   [-CertificateReferences <PSCertificateReference[]>]
   [-ApplicationPackageReferences <PSApplicationPackageReference[]>]
   [-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
   [-CloudServiceConfiguration <PSCloudServiceConfiguration>]
   [-NetworkConfiguration <PSNetworkConfiguration>]
   [-MountConfiguration <PSMountConfiguration[]>]
   [-UserAccount <PSUserAccount[]>]
   [-CurrentNodeCommunicationMode <NodeCommunicationMode>]
   [-TargetNodeCommunicationMode <NodeCommunicationMode>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBatchPool
   [-Id] <String>
   -VirtualMachineSize <String>
   [-DisplayName <String>]
   [-AutoScaleEvaluationInterval <TimeSpan>]
   [-AutoScaleFormula <String>]
   [-TaskSlotsPerNode <Int32>]
   [-UpgradePolicy <PSUpgradePolicy>]
   [-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
   [-ResourceTag <IDictionary>]
   [-Metadata <IDictionary>]
   [-InterComputeNodeCommunicationEnabled]
   [-StartTask <PSStartTask>]
   [-CertificateReferences <PSCertificateReference[]>]
   [-ApplicationPackageReferences <PSApplicationPackageReference[]>]
   [-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
   [-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
   [-NetworkConfiguration <PSNetworkConfiguration>]
   [-MountConfiguration <PSMountConfiguration[]>]
   [-UserAccount <PSUserAccount[]>]
   [-CurrentNodeCommunicationMode <NodeCommunicationMode>]
   [-TargetNodeCommunicationMode <NodeCommunicationMode>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

De cmdlet New-AzBatchPool maakt een pool in de Azure Batch-service onder het account dat is opgegeven door de parameter BatchContext .

Voorbeelden

Voorbeeld 1: Een nieuwe pool maken met behulp van de TargetDedicated-parameterset met behulp van CloudServiceConfiguration

$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration" -ArgumentList @(4,"*")
New-AzBatchPool -Id "MyPool" -VirtualMachineSize "STANDARD_D1_V2" -CloudServiceConfiguration $configuration  -TargetDedicatedComputeNodes 3 -BatchContext $Context

De pool is geconfigureerd voor het gebruik van STANDARD_D1_V2 virtuele machines met de besturingssysteemversie van familie vier.

Voorbeeld 2: Een nieuwe pool maken met behulp van de TargetDedicated-parameterset met behulp van VirtualMachineConfiguration

$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
New-AzBatchPool -Id "MyPool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context

Met deze opdracht maakt u een nieuwe pool met id MyPool met behulp van de parameterset TargetDedicated. De doeltoewijzing is drie rekenknooppunten. De pool is geconfigureerd voor het gebruik van STANDARD_D1_V2 virtuele machines met de installatiekopieën van het besturingssysteem Windows-2016-Datacenter.

Voorbeeld 3: Een nieuwe pool maken met behulp van de parameterset Voor automatisch schalen

$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -AutoScaleFormula '$TargetDedicated=2;' -BatchContext $Context

Met deze opdracht maakt u een nieuwe pool met id AutoScalePool met behulp van de parameterset AutoScale. De pool is geconfigureerd voor het gebruik van STANDARD_D1_V2 virtuele machines met de installatiekopieën van het besturingssysteem Windows-2016 Datacenter en het doelaantal rekenknooppunten wordt bepaald door de formule Voor automatisch schalen.

Voorbeeld 4: Een pool maken met knooppunten in een subnet

$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
$networkConfig = New-Object Microsoft.Azure.Commands.Batch.Models.PSNetworkConfiguration
$networkConfig.SubnetId = "/subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}"
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context

Voorbeeld 5: Een pool maken met aangepaste gebruikersaccounts

$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
$userAccount = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserAccount -ArgumentList @("myaccount", "mypassword")
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -UserAccount $userAccount

Parameters

-ApplicationLicenses

De lijst met toepassingslicenties die de Batch-service beschikbaar maakt op elk rekenknooppunt in de pool.

Type:List<T>[String]
Aliassen:ApplicationLicense
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ApplicationPackageReferences

Type:PSApplicationPackageReference[]
Aliassen:ApplicationPackageReference
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-AutoScaleEvaluationInterval

Hiermee geeft u de hoeveelheid tijd in minuten op die is verstreken voordat de poolgrootte automatisch wordt aangepast volgens de formule Voor automatisch schalen. De standaardwaarde is 15 minuten en de minimumwaarde is 5 minuten.

Type:Nullable<T>[TimeSpan]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-AutoScaleFormula

Hiermee geeft u de formule voor het automatisch schalen van de pool.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-BatchContext

Hiermee geeft u het BatchAccountContext-exemplaar op dat door deze cmdlet wordt gebruikt om te communiceren met de Batch-service. Als u de Cmdlet Get-AzBatchAccount gebruikt om uw BatchAccountContext op te halen, wordt Microsoft Entra-verificatie gebruikt bij interactie met de Batch-service. Als u in plaats daarvan gedeelde sleutelverificatie wilt gebruiken, gebruikt u de cmdlet Get-AzBatchAccountKey om een BatchAccountContext-object op te halen waarin de bijbehorende toegangssleutels zijn ingevuld. Wanneer u verificatie met gedeelde sleutels gebruikt, wordt de primaire toegangssleutel standaard gebruikt. Als u de sleutel wilt wijzigen die u wilt gebruiken, stelt u de eigenschap BatchAccountContext.KeyInUse in.

Type:BatchAccountContext
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-CertificateReferences

Hiermee geeft u certificaten die aan de pool zijn gekoppeld. De Batch-service installeert de certificaten waarnaar wordt verwezen op elk rekenknooppunt van de pool.

Type:PSCertificateReference[]
Aliassen:CertificateReference
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-CloudServiceConfiguration

Hiermee geeft u configuratie-instellingen voor een pool op basis van het Azure-cloudserviceplatform.

Type:PSCloudServiceConfiguration
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliassen:cf
Position:Named
Default value:False
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-CurrentNodeCommunicationMode

De huidige groepscommunicatiemodus.

Type:NodeCommunicationMode
Geaccepteerde waarden:Default, Classic, Simplified
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DefaultProfile

De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliassen:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DisplayName

Hiermee geeft u de weergavenaam van de pool.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Id

Hiermee geeft u de id van de pool die moet worden gemaakt.

Type:String
Position:0
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-InterComputeNodeCommunicationEnabled

Geeft aan dat met deze cmdlet de pool wordt ingesteld voor directe communicatie tussen toegewezen rekenknooppunten.

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Metadata

Hiermee geeft u de metagegevens, als sleutel/waardeparen, op die moeten worden toegevoegd aan de nieuwe pool. De sleutel is de naam van de metagegevens. De waarde is de metagegevenswaarde.

Type:IDictionary
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-MountConfiguration

Een lijst met bestandssystemen die op elk knooppunt in de pool moeten worden gekoppeld. Dit ondersteunt Azure Files, NFS, CIFS/SMB en Blobfuse.

Type:PSMountConfiguration[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-NetworkConfiguration

De netwerkconfiguratie voor de pool.

Type:PSNetworkConfiguration
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ResizeTimeout

Hiermee geeft u de time-out op voor het toewijzen van rekenknooppunten aan de pool.

Type:Nullable<T>[TimeSpan]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ResourceTag

De door de gebruiker gedefinieerde tags die moeten worden gekoppeld aan de Azure Batch-pool. Wanneer deze tags zijn opgegeven, worden deze tags doorgegeven aan de back-up van Azure-resources die aan de pool zijn gekoppeld. Deze eigenschap kan alleen worden opgegeven wanneer het Batch-account is gemaakt met de eigenschap poolAllocationMode ingesteld op UserSubscription.

Type:IDictionary
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-StartTask

Hiermee geeft u de begintaakspecificatie voor de pool. De begintaak wordt uitgevoerd wanneer een rekenknooppunt lid wordt van de pool of wanneer het rekenknooppunt opnieuw wordt opgestart of opnieuw wordt gemaakt.

Type:PSStartTask
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-TargetDedicatedComputeNodes

Hiermee geeft u het doelaantal toegewezen rekenknooppunten op dat moet worden toegewezen aan de pool.

Type:Nullable<T>[Int32]
Aliassen:TargetDedicated
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-TargetLowPriorityComputeNodes

Hiermee geeft u het doelaantal rekenknooppunten met lage prioriteit op dat moet worden toegewezen aan de pool.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-TargetNodeCommunicationMode

De gewenste communicatiemodus voor knooppunten voor de pool.

Type:NodeCommunicationMode
Geaccepteerde waarden:Default, Classic, Simplified
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-TaskSchedulingPolicy

Hiermee geeft u het taakplanningsbeleid op, zoals het ComputeNodeFillType.

Type:PSTaskSchedulingPolicy
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-TaskSlotsPerNode

Het aantal taaksites dat kan worden gebruikt om gelijktijdige taken uit te voeren op één rekenknooppunt in de pool. De standaardwaarde is 1. De maximumwaarde is de kleinste van 4 keer het aantal kernen van de vmSize van de pool of 256.

Type:Nullable<T>[Int32]
Aliassen:MaxTasksPerComputeNode
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-UpgradePolicy

Het upgradebeleid voor de pool in NewBatchPoolCommand.cs .

Type:PSUpgradePolicy
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-UserAccount

De lijst met gebruikersaccounts die op elk knooppunt in de pool moeten worden gemaakt.

Type:PSUserAccount[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-VirtualMachineConfiguration

Hiermee geeft u configuratie-instellingen voor een pool op de infrastructuur van de virtuele machines.

Type:PSVirtualMachineConfiguration
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-VirtualMachineSize

Hiermee geeft u de grootte van de virtuele machines in de pool. Zie Grootten voor virtuele machines op de Microsoft Azure-site voor meer informatie over grootten van virtuele machines .

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliassen:wi
Position:Named
Default value:False
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

Invoerwaarden

BatchAccountContext

Uitvoerwaarden

Void