Skip to content

Commit ebdff86

Browse files
Merge pull request #279558 from alfpark/alpark/batch
Update Batch autoscale and best practices docs
2 parents 2d2e687 + 44caaf0 commit ebdff86

File tree

3 files changed

+30
-39
lines changed

3 files changed

+30
-39
lines changed

articles/batch/batch-automatic-scaling.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Autoscale compute nodes in an Azure Batch pool
33
description: Enable automatic scaling on an Azure Batch cloud pool to dynamically adjust the number of compute nodes in the pool.
44
ms.topic: how-to
5-
ms.date: 06/11/2024
5+
ms.date: 06/27/2024
66
ms.custom: H1Hack27Feb2017, fasttrack-edit, devx-track-csharp
77
---
88

@@ -124,11 +124,6 @@ You can get the value of these service-defined variables to make adjustments tha
124124
| $UsableNodeCount | The number of usable compute nodes. |
125125
| $PreemptedNodeCount | The number of nodes in the pool that are in a preempted state. |
126126

127-
> [!WARNING]
128-
> Select service-defined variables will be retired after **31 March 2024** as noted in the table above. After the retirement
129-
> date, these service-defined variables will no longer be populated with sample data. Please discontinue use of these variables
130-
> before this date.
131-
132127
> [!NOTE]
133128
> Use `$RunningTasks` when scaling based on the number of tasks running at a point in time, and `$ActiveTasks` when scaling based on the number of tasks that are queued up to run.
134129
@@ -597,7 +592,7 @@ In Batch .NET, the [CloudPool.AutoScaleRun](/dotnet/api/microsoft.azure.batch.cl
597592
- [AutoScaleRun.Results](/dotnet/api/microsoft.azure.batch.autoscalerun.results)
598593
- [AutoScaleRun.Error](/dotnet/api/microsoft.azure.batch.autoscalerun.error)
599594

600-
In the REST API, the [Get information about a pool request](/rest/api/batchservice/get-information-about-a-pool) returns information about the pool, which includes the latest automatic scaling run information in the [autoScaleRun](/rest/api/batchservice/get-information-about-a-pool) property.
595+
In the REST API, [information about a pool](/rest/api/batchservice/get-information-about-a-pool) includes the latest automatic scaling run information in the [autoScaleRun](/rest/api/batchservice/get-information-about-a-pool) property.
601596

602597
The following C# example uses the Batch .NET library to print information about the last autoscaling run on pool *myPool*.
603598

articles/batch/best-practices.md

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Best practices
33
description: Learn best practices and useful tips for developing your Azure Batch solutions.
4-
ms.date: 05/31/2024
4+
ms.date: 06/27/2024
55
ms.topic: conceptual
66
---
77

@@ -20,15 +20,6 @@ This article discusses best practices and useful tips for using the Azure Batch
2020

2121
- **Pool allocation mode:** When creating a Batch account, you can choose between two pool allocation modes: **Batch service** or **user subscription**. For most cases, you should use the default Batch service mode, in which pools are allocated behind the scenes in Batch-managed subscriptions. In the alternative user subscription mode, Batch VMs and other resources are created directly in your subscription when a pool is created. User subscription accounts are primarily used to enable a small but important subset of scenarios. For more information, see [configuration for user subscription mode](batch-account-create-portal.md#additional-configuration-for-user-subscription-mode).
2222

23-
- **`virtualMachineConfiguration` or `cloudServiceConfiguration`:** While you can currently create pools using either
24-
configuration, new pools should be configured using `virtualMachineConfiguration` and not `cloudServiceConfiguration`.
25-
All current and new Batch features will be supported by Virtual Machine Configuration pools. Cloud Service Configuration
26-
pools don't support all features and no new capabilities are planned. You won't be able to create new
27-
`cloudServiceConfiguration` pools or add new nodes to existing pools
28-
[after February 29, 2024](https://azure.microsoft.com/updates/azure-batch-cloudserviceconfiguration-pools-will-be-retired-on-29-february-2024/).
29-
For more information, see
30-
[Migrate Batch pool configuration from Cloud Services to Virtual Machine](batch-pool-cloud-service-to-virtual-machine-configuration.md).
31-
3223
- **`classic` or `simplified` node communication mode:** Pools can be configured in one of two node communication modes,
3324
classic or [simplified](simplified-compute-node-communication.md). In the classic node communication model, the Batch service
3425
initiates communication to the compute nodes, and compute nodes also require communicating to Azure Storage. In the simplified
@@ -86,10 +77,17 @@ Before you recreate or resize your pool, you should download any node agent logs
8677
#### Operating system updates
8778

8879
It's recommended that the VM image selected for a Batch pool should be up-to-date with the latest publisher provided security updates.
89-
Some images may perform automatic updates upon boot (or shortly thereafter), which may interfere with certain user directed actions such
80+
Some images may perform automatic package updates upon boot (or shortly thereafter), which may interfere with certain user directed actions such
9081
as retrieving package repository updates (for example, `apt update`) or installing packages during actions such as a
9182
[StartTask](jobs-and-tasks.md#start-task).
9283

84+
It's recommended to enable [Auto OS upgrade for Batch pools](batch-upgrade-policy.md), which allows the underlying
85+
Azure infrastructure to coordinate updates across the pool. This option can be configured to be nondisrupting for task
86+
execution. Automatic OS upgrade doesn't support all operating systems that Batch supports. For more information, see the
87+
[Virtual Machine Scale Sets Auto OS upgrade Support Matrix](../virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade.md#supported-os-images).
88+
For Windows operating systems, ensure that you aren't enabling the property
89+
`virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates` when using Auto OS upgrade on the Batch pool.
90+
9391
Azure Batch doesn't verify or guarantee that images allowed for use with the service have the latest security updates.
9492
Updates to images are under the purview of the publisher of the image, and not that of Azure Batch. For certain images published
9593
under `microsoft-azure-batch`, there's no guarantee that these images are kept up-to-date with their upstream derived image.
@@ -122,7 +120,7 @@ Pools can be created using third-party images published to Azure Marketplace. Wi
122120

123121
### Container pools
124122

125-
When specifying a Batch pool with a [virtual network](batch-virtual-network.md), there can be interaction
123+
When you create a Batch pool with a [virtual network](batch-virtual-network.md), there can be interaction
126124
side effects between the specified virtual network and the default Docker bridge. Docker, by default, will
127125
create a network bridge with a subnet specification of `172.17.0.0/16`. Ensure that there are no conflicting
128126
IP ranges between the Docker network bridge and your virtual network.
@@ -215,7 +213,7 @@ Tasks that only run for one to two seconds aren't ideal. Try to do a significant
215213

216214
### Use pool scope for short tasks on Windows nodes
217215

218-
When scheduling a task on Batch nodes, you can choose whether to run it with task scope or pool scope. If the task will only run for a short time, task scope can be inefficient due to the resources needed to create the auto-user account for that task. For greater efficiency, consider setting these tasks to pool scope. For more information, see [Run a task as an auto-user with pool scope](batch-user-accounts.md#run-a-task-as-an-auto-user-with-pool-scope).
216+
When scheduling a task on Batch nodes, you can choose whether to run it with task scope or pool scope. If the task will only run for a short time, task scope can be inefficient due to the resources needed to create the autouser account for that task. For greater efficiency, consider setting these tasks to pool scope. For more information, see [Run a task as an autouser with pool scope](batch-user-accounts.md#run-a-task-as-an-auto-user-with-pool-scope).
219217

220218
## Nodes
221219

@@ -322,12 +320,6 @@ promotion into production use.
322320

323321
If you notice a problem involving the behavior of a node or tasks running on a node, collect the Batch agent logs prior to deallocating the nodes in question. The Batch agent logs can be collected using the Upload Batch service logs API. These logs can be supplied as part of a support ticket to Microsoft and will help with issue troubleshooting and resolution.
324322

325-
### Manage OS upgrades
326-
327-
For user subscription mode Batch accounts, automated OS upgrades can interrupt task progress, especially if the tasks are long-running. [Building idempotent tasks](#build-durable-tasks) can help to reduce errors caused by these interruptions. We also recommend [scheduling OS image upgrades for times when tasks aren't expected to run](../virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade.md#manually-trigger-os-image-upgrades).
328-
329-
For Windows pools, `enableAutomaticUpdates` is set to `true` by default. Allowing automatic updates is recommended, but you can set this value to `false` if you need to ensure that an OS update doesn't happen unexpectedly.
330-
331323
## Batch API
332324

333325
### Timeout Failures
@@ -360,10 +352,6 @@ Ensure that your Batch service clients have appropriate retry policies in place
360352

361353
Typically, virtual machines in a Batch pool are accessed through public IP addresses that can change over the lifetime of the pool. This dynamic nature can make it difficult to interact with a database or other external service that limits access to certain IP addresses. To address this concern, you can create a pool using a set of static public IP addresses that you control. For more information, see [Create an Azure Batch pool with specified public IP addresses](create-pool-public-ip.md).
362354

363-
### Testing connectivity with Cloud Services configuration
364-
365-
You can't use the normal "ping"/ICMP protocol with cloud services, because the ICMP protocol isn't permitted through the Azure load balancer. For more information, see [Connectivity and networking for Azure Cloud Services](../cloud-services/cloud-services-connectivity-and-networking-faq.yml#can-i-ping-a-cloud-service-).
366-
367355
## Batch node underlying dependencies
368356

369357
Consider the following dependencies and restrictions when designing your Batch solutions.

articles/batch/security-best-practices.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
---
22
title: Batch security and compliance best practices
33
description: Learn best practices and useful tips for enhancing security with your Azure Batch solutions.
4-
ms.date: 09/13/2023
4+
ms.date: 06/27/2024
55
ms.topic: conceptual
66
---
77

88
# Batch security and compliance best practices
99

1010
This article provides guidance and best practices for enhancing security when using Azure Batch.
1111

12-
By default, Azure Batch accounts have a public endpoint and are publicly accessible. When an Azure Batch pool is created, the pool is provisioned in a specified subnet of an Azure virtual network. Virtual machines in the Batch pool are accessed through public IP addresses that are created by Batch. Compute nodes in a pool can communicate with each other when needed, such as to run multi-instance tasks, but nodes in a pool can't communicate with virtual machines outside of the pool.
12+
By default, Azure Batch accounts have a public endpoint and are publicly accessible. When an Azure Batch pool is created,
13+
the pool is provisioned in a specified subnet of an Azure virtual network. Virtual machines in the Batch pool are accessed,
14+
by default, through public IP addresses that Batch creates. Compute nodes in a pool can communicate with each other when needed,
15+
such as to run multi-instance tasks, but nodes in a pool can't communicate with virtual machines outside of the pool.
1316

1417
:::image type="content" source="media/security-best-practices/typical-environment.png" alt-text="Diagram showing a typical Batch environment.":::
1518

@@ -21,9 +24,7 @@ Many features are available to help you create a more secure Azure Batch deploym
2124

2225
### Pool configuration
2326

24-
Many security features are only available for pools configured using [Virtual Machine Configuration](nodes-and-pools.md#configurations), and not for pools with Cloud Services Configuration. We recommend using Virtual Machine Configuration pools, which utilize [Virtual Machine Scale Sets](../virtual-machine-scale-sets/overview.md), whenever possible.
25-
26-
Pools can also be configured in one of two node communication modes, classic or [simplified](simplified-compute-node-communication.md).
27+
Pools can be configured in one of two node communication modes, classic or [simplified](simplified-compute-node-communication.md).
2728
In the classic node communication model, the Batch service initiates communication to the compute nodes, and compute nodes
2829
also require communicating to Azure Storage. In the simplified node communication model, compute nodes initiate communication
2930
with the Batch service. Due to the reduced scope of inbound/outbound connections required, and not requiring Azure Storage
@@ -35,14 +36,14 @@ node communication model will be
3536

3637
Batch account access supports two methods of authentication: Shared Key and [Microsoft Entra ID](batch-aad-auth.md).
3738

38-
We strongly recommend using Microsoft Entra ID for Batch account authentication. Some Batch capabilities require this method of authentication, including many of the security-related features discussed here. The service API authentication mechanism for a Batch account can be restricted to only Microsoft Entra ID using the [allowedAuthenticationModes](/rest/api/batchmanagement/batch-account/create) property. When this property is set, API calls using Shared Key authentication will be rejected.
39+
We strongly recommend using Microsoft Entra ID for Batch account authentication. Some Batch capabilities require this method of authentication, including many of the security-related features discussed here. The service API authentication mechanism for a Batch account can be restricted to only Microsoft Entra ID using the [allowedAuthenticationModes](/rest/api/batchmanagement/batch-account/create) property. When this property is set, API calls using Shared Key authentication is rejected.
3940

4041
### Batch account pool allocation mode
4142

4243
When creating a Batch account, you can choose between two [pool allocation modes](accounts.md#batch-accounts):
4344

44-
- **Batch service**: The default option, where the underlying Cloud Service or Virtual Machine Scale Set resources used to allocate and manage pool nodes are created on Batch-owned subscriptions, and aren't directly visible in the Azure portal. Only the Batch pools and nodes are visible.
45-
- **User subscription**: The underlying Cloud Service or Virtual Machine Scale Set resources are created in the same subscription as the Batch account. These resources are therefore visible in the subscription, in addition to the corresponding Batch resources.
45+
- **Batch service**: The default option, where the underlying Virtual Machine Scale Set resources used to allocate and manage pool nodes are created on Batch-owned subscriptions, and aren't directly visible in the Azure portal. Only the Batch pools and nodes are visible.
46+
- **User subscription**: The underlying Virtual Machine Scale Set resources are created in the same subscription as the Batch account. These resources are therefore visible in the subscription, in addition to the corresponding Batch resources.
4647

4748
With user subscription mode, Batch VMs and other resources are created directly in your subscription when a pool is created. User subscription mode is required if you want to create Batch pools using Azure Reserved VM Instances, use Azure Policy on Virtual Machine Scale Set resources, and/or manage the core quota on the subscription (shared across all Batch accounts in the subscription). To create a Batch account in user subscription mode, you must also register your subscription with Azure Batch, and associate the account with an Azure Key Vault.
4849

@@ -72,6 +73,13 @@ Batch supports both Linux and Windows operating systems. Batch supports Linux wi
7273
distributions. It's recommended that the operating system is kept up-to-date with the latest patches provided by the OS
7374
publisher.
7475

76+
It's recommended to enable [Auto OS upgrade for Batch pools](batch-upgrade-policy.md), which allows the underlying
77+
Azure infrastructure to coordinate updates across the pool. This option can be configured to be nondisrupting for task
78+
execution. Automatic OS upgrade doesn't support all operating systems that Batch supports. For more information, see the
79+
[Virtual Machine Scale Sets Auto OS upgrade Support Matrix](../virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade.md#supported-os-images).
80+
For Windows operating systems, ensure that you aren't enabling the property
81+
`virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates` when using Auto OS upgrade on the Batch pool.
82+
7583
Batch support for images and node agents phase out over time, typically aligned with publisher support timelines. It's
7684
recommended to avoid using images with impending end-of-life (EOL) dates or images that are past their EOL date.
7785
It's your responsibility to periodically refresh your view of the EOL dates pertinent to your pools and migrate your workloads
@@ -89,7 +97,7 @@ at any time. EOL dates can be discovered via the
8997
The Batch node agent doesn't modify operating system level defaults for SSL/TLS versions or cipher suite ordering. In Windows,
9098
SSL/TLS versions and cipher suite order is controlled at the operating system level, and therefore the Batch node agent adopts
9199
the settings set by the image used by each compute node. Although the Batch node agent attempts to utilize the
92-
most secure settings available when possible, it can still be limited by operating system level settings. We recommend that
100+
most secure settings available when possible, it can still be limited by operating system level settings. We recommend that
93101
you review your OS level defaults and set them appropriately for the most secure mode that is amenable for your workflow and
94102
organizational requirements. For more information, please visit
95103
[Manage TLS](/windows-server/security/tls/manage-tls) for cipher suite order enforcement and

0 commit comments

Comments
 (0)