New-AzureBatchPool

Creates a pool in the Batch service.

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

PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -OSFamily "4" -TargetOSVersion "*" -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 2: Create a new pool using the AutoScale parameter set

PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -OSFamily "4" -TargetOSVersion "*" -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 3: Create a pool with nodes in a subnet

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" -OSFamily "4" -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context

Example 4: Create a pool with custom user accounts

PS C:\>$userAccount = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserAccount -ArgumentList @("myaccount", "mypassword")
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -OSFamily "4" -TargetDedicatedComputeNodes 3 -UserAccount $userAccount

Required Parameters

-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 Azure Active Directory 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:Microsoft.Azure.Commands.Batch.BatchAccountContext
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Id

Specifies the ID of the pool to create.

Type:String
Position:0
Default value:None
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 machineshttps://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/ (https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/) in the Microsoft Azure site.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-ApplicationLicenses

The list of application licenses the Batch service will make available on each compute node in the pool.

Type:System.Collections.Generic.List`1[System.String]
Aliases:ApplicationLicense
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplicationPackageReferences
Type:Microsoft.Azure.Commands.Batch.Models.PSApplicationPackageReference[]
Aliases:ApplicationPackageReference
Position:Named
Default value:None
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:System.Nullable`1[System.TimeSpan]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AutoScaleFormula

Specifies the formula for automatically scaling the pool.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
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:Microsoft.Azure.Commands.Batch.Models.PSCertificateReference[]
Aliases:CertificateReference
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CloudServiceConfiguration

Specifies configuration settings for a pool based on the Azure cloud service platform.

Type:Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

Specifies the display name of the pool.

Type:String
Position:Named
Default value:None
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:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxTasksPerComputeNode

Specifies the maximum number of tasks that can run on a single compute node.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-NetworkConfiguration

The network configuration for the pool.

Type:Microsoft.Azure.Commands.Batch.Models.PSNetworkConfiguration
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResizeTimeout

Specifies the time-out for allocating compute nodes to the pool.

Type:System.Nullable`1[System.TimeSpan]
Position:Named
Default value:None
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:Microsoft.Azure.Commands.Batch.Models.PSStartTask
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetDedicatedComputeNodes

Specifies the target number of dedicated compute nodes to allocate to the pool.

Type:System.Nullable`1[System.Int32]
Aliases:TargetDedicated
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetLowPriorityComputeNodes

Specifies the target number of low-priority compute nodes to allocate to the pool.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TaskSchedulingPolicy

Specifies the task scheduling policy, such as the ComputeNodeFillType.

Type:Microsoft.Azure.Commands.Batch.Models.PSTaskSchedulingPolicy
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserAccount

The list of user accounts to be created on each node in the pool.

Type:Microsoft.Azure.Commands.Batch.Models.PSUserAccount[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VirtualMachineConfiguration

Specifies configuration settings for a pool on the virtual machines infrastructure.

Type:Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

BatchAccountContext

Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline