New-AzureBatchPool
Creates a pool in the Batch service.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
New-AzureBatchPool
[-Id] <String>
-VirtualMachineSize <String>
[-DisplayName <String>]
[-ResizeTimeout <TimeSpan>]
[-TargetDedicatedComputeNodes <Int32>]
[-TargetLowPriorityComputeNodes <Int32>]
[-MaxTasksPerComputeNode <Int32>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-CloudServiceConfiguration <PSCloudServiceConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-UserAccount <PSUserAccount[]>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureBatchPool
[-Id] <String>
-VirtualMachineSize <String>
[-DisplayName <String>]
[-ResizeTimeout <TimeSpan>]
[-TargetDedicatedComputeNodes <Int32>]
[-TargetLowPriorityComputeNodes <Int32>]
[-MaxTasksPerComputeNode <Int32>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-UserAccount <PSUserAccount[]>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureBatchPool
[-Id] <String>
-VirtualMachineSize <String>
[-DisplayName <String>]
[-AutoScaleEvaluationInterval <TimeSpan>]
[-AutoScaleFormula <String>]
[-MaxTasksPerComputeNode <Int32>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-CloudServiceConfiguration <PSCloudServiceConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-UserAccount <PSUserAccount[]>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureBatchPool
[-Id] <String>
-VirtualMachineSize <String>
[-DisplayName <String>]
[-AutoScaleEvaluationInterval <TimeSpan>]
[-AutoScaleFormula <String>]
[-MaxTasksPerComputeNode <Int32>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-UserAccount <PSUserAccount[]>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzureBatchPool cmdlet creates a pool in the Azure Batch service under the account specified by the BatchContext parameter.
Examples
Example 1: Create a new pool using the TargetDedicated parameter set using CloudServiceConfiguration
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration" -ArgumentList @(4,"*")
PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -CloudServiceConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
Example 2: Create a new pool using the TargetDedicated parameter set using VirtualMachineConfiguration
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
This command creates a new pool with ID MyPool using the TargetDedicated parameter set. The target allocation is three compute nodes. The pool is configured to use small virtual machines imaged with the latest operating system version of family four.
Example 3: Create a new pool using the AutoScale parameter set
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -AutoScaleFormula '$TargetDedicated=2;' -BatchContext $Context
This command creates a new pool with ID AutoScalePool using the AutoScale parameter set. The pool is configured to use small virtual machines imaged with the latest operating system version of family four, and the target number of compute nodes are determined by the Autoscale formula.
Example 4: Create a pool with nodes in a subnet
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
PS C:\>$networkConfig = New-Object Microsoft.Azure.Commands.Batch.Models.PSNetworkConfiguration
PS C:\>$networkConfig.SubnetId = "/subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}"
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context
Example 5: Create a pool with custom user accounts
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
PS C:\>$userAccount = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserAccount -ArgumentList @("myaccount", "mypassword")
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -UserAccount $userAccount
Parameters
-ApplicationLicenses
The list of application licenses the Batch service will make available on each compute node in the pool.
Type: | List<T>[String] |
Aliases: | ApplicationLicense |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ApplicationPackageReferences
Type: | PSApplicationPackageReference[] |
Aliases: | ApplicationPackageReference |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AutoScaleEvaluationInterval
Specifies the amount of time, in minutes, that elapses before the pool size is automatically adjusted according to the AutoScale formula. The default value is 15 minutes, and the minimum value is 5 minutes.
Type: | Nullable<T>[TimeSpan] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AutoScaleFormula
Specifies the formula for automatically scaling the pool.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BatchContext
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 Microsoft Entra 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.
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CertificateReferences
Specifies certificates associated with the pool. The Batch service installs the referenced certificates on each compute node of the pool.
Type: | PSCertificateReference[] |
Aliases: | CertificateReference |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CloudServiceConfiguration
Specifies configuration settings for a pool based on the Azure cloud service platform.
Type: | PSCloudServiceConfiguration |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Specifies the display name of the pool.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies the ID of the pool to create.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InterComputeNodeCommunicationEnabled
Indicates that this cmdlet sets up the pool for direct communication between dedicated compute nodes.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxTasksPerComputeNode
Specifies the maximum number of tasks that can run on a single compute node.
Type: | Nullable<T>[Int32] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Metadata
Specifies the metadata, as key/value pairs, to add to the new pool. The key is the metadata name. The value is the metadata value.
Type: | IDictionary |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NetworkConfiguration
The network configuration for the pool.
Type: | PSNetworkConfiguration |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResizeTimeout
Specifies the time-out for allocating compute nodes to the pool.
Type: | Nullable<T>[TimeSpan] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StartTask
Specifies the start task specification for the pool. The start task is run when a compute node joins the pool, or when the compute node is rebooted or reimaged.
Type: | PSStartTask |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetDedicatedComputeNodes
Specifies the target number of dedicated compute nodes to allocate to the pool.
Type: | Nullable<T>[Int32] |
Aliases: | TargetDedicated |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetLowPriorityComputeNodes
Specifies the target number of low-priority compute nodes to allocate to the pool.
Type: | Nullable<T>[Int32] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TaskSchedulingPolicy
Specifies the task scheduling policy, such as the ComputeNodeFillType.
Type: | PSTaskSchedulingPolicy |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserAccount
The list of user accounts to be created on each node in the pool.
Type: | PSUserAccount[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualMachineConfiguration
Specifies configuration settings for a pool on the virtual machines infrastructure.
Type: | PSVirtualMachineConfiguration |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualMachineSize
Specifies the size of the virtual machines in the pool. For more information about virtual machine sizes, see Sizes for virtual machines in the Microsoft Azure site.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Parameters: BatchContext (ByValue)