Skip to content

Commit 0a4e546

Browse files
committed
updating topics with current info
1 parent f31598b commit 0a4e546

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

articles/batch/batch-custom-images.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Provision a custom pool from a managed image
33
description: Create a Batch pool from a managed image resource to provision compute nodes with the software and data for your application.
4-
ms.topic: article
5-
ms.date: 09/16/2019
4+
ms.topic: conceptual
5+
ms.date: 05/18/2020
66
---
77

88
# Use a managed image to create a pool of virtual machines
@@ -16,7 +16,7 @@ To create a custom image for your Batch pool's virtual machines (VMs), you can u
1616

1717
- **A managed image resource**. To create a pool of virtual machines using a custom image, you need to have or create a managed image resource in the same Azure subscription and region as the Batch account. The image should be created from snapshots of the VM's OS disk and optionally its attached data disks. For more information and steps to prepare a managed image, see the following section.
1818
- Use a unique custom image for each pool you create.
19-
- To create a pool with the image using the Batch APIs, specify the **resource ID** of the image, which is of the form `/subscriptions/xxxx-xxxxxx-xxxxx-xxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage`. To use the portal, use the **name** of the image.
19+
- To create a pool with the image using the Batch APIs, specify the **resource ID** of the image, which is of the form `/subscriptions/xxxx-xxxxxx-xxxxx-xxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage`.
2020
- The managed image resource should exist for the lifetime of the pool to allow scale-up and can be removed after the pool is deleted.
2121

2222
- **Azure Active Directory (AAD) authentication**. The Batch client API must use AAD authentication. Azure Batch support for AAD is documented in [Authenticate Batch service solutions with Active Directory](batch-aad-auth.md).
@@ -54,29 +54,42 @@ A snapshot is a full, read-only copy of a VHD. To create a snapshot of a VM's OS
5454

5555
To create a managed image from a snapshot, use Azure command-line tools such as the [az image create](/cli/azure/image) command. You can create an image by specifying an OS disk snapshot and optionally one or more data disk snapshots.
5656

57-
## Create a pool from a custom image in the portal
57+
## Create a pool from a Shared Image using C#
5858

59-
Once you have saved your custom image and you know its resource ID or name, create a Batch pool from that image. The following steps show you how to create a pool from the Azure portal.
59+
Once you have saved your custom image and you know its resource ID or name, create a Batch pool from that image. The following steps show you how to create a pool from a Shared Image using the C# SDK.
6060

6161
> [!NOTE]
62-
> If you are creating the pool using one of the Batch APIs, make sure that the identity you use for AAD authentication has permissions to the image resource. See [Authenticate Batch service solutions with Active Directory](batch-aad-auth.md).
62+
> Make sure that the identity you use for Azure AD authentication has permissions to the image resource. See [Authenticate Batch service solutions with Active Directory](batch-aad-auth.md).
6363
>
6464
> The resource for the managed image must exist for the lifetime of the pool. If the underlying resource is deleted, the pool cannot be scaled.
6565
66-
1. Navigate to your Batch account in the Azure portal. This account must be in the same subscription and region as the resource group containing the custom image.
67-
2. In the **Settings** window on the left, select the **Pools** menu item.
68-
3. In the **Pools** window, select the **Add** command.
69-
4. On the **Add Pool** window, select **Custom Image (Linux/Windows)** from the **Image Type** dropdown. From the **Custom VM image** dropdown, select the image name (short form of the resource ID).
70-
5. Select the correct **Publisher/Offer/Sku** for your custom image.
71-
6. Specify the remaining required settings, including the **Node size**, **Target dedicated nodes**, and **Low-priority nodes**, as well as any desired optional settings.
72-
73-
For example, for a Microsoft Windows Server Datacenter 2016 custom image, the **Add Pool** window appears as shown below:
74-
75-
![Add pool from custom Windows image](media/batch-custom-images/add-pool-custom-image.png)
76-
77-
To check whether an existing pool is based on a custom image, see the **Operating System** property in the resource summary section of the **Pool** window. If the pool was created from a custom image, it is set to **Custom VM Image**.
78-
79-
All custom images associated with a pool are displayed on the pool's **Properties** window.
66+
```csharp
67+
private static VirtualMachineConfiguration CreateVirtualMachineConfiguration(ImageReference imageReference)
68+
{
69+
return new VirtualMachineConfiguration(
70+
imageReference: imageReference,
71+
nodeAgentSkuId: "batch.node.windows amd64");
72+
}
73+
74+
private static ImageReference CreateImageReference()
75+
{
76+
return new ImageReference(
77+
virtualMachineImageId: "/subscriptions/{sub id}/resourceGroups/{resource group name}/providers/Microsoft.Compute/images/{image definition name}");
78+
}
79+
80+
private static void CreateBatchPool(BatchClient batchClient, VirtualMachineConfiguration vmConfiguration)
81+
{
82+
try
83+
{
84+
CloudPool pool = batchClient.PoolOperations.CreatePool(
85+
poolId: PoolId,
86+
targetDedicatedComputeNodes: PoolNodeCount,
87+
virtualMachineSize: PoolVMSize,
88+
virtualMachineConfiguration: vmConfiguration);
89+
90+
pool.Commit();
91+
}
92+
```
8093

8194
## Considerations for large pools
8295

articles/batch/batch-sig-images.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Use the Shared Image Gallery to create a custom pool
3-
description: Create a Batch pool with the Shared Image Gallery to provision custom images to compute nodes that contain the software and data that you need for your application. Custom images are an efficient way to configure compute nodes to run your Batch workloads.
4-
ms.topic: article
5-
ms.date: 08/28/2019
3+
description: Custom images are an efficient way to configure compute nodes to run your Batch workloads.
4+
ms.topic: conceptual
5+
ms.date: 05/18/2020
66
---
77

88
# Use the Shared Image Gallery to create a custom pool
@@ -47,6 +47,9 @@ In Azure, you can prepare a managed image from:
4747
* A generalized Azure VM with managed disks
4848
* A generalized on-premises VHD uploaded to the cloud
4949

50+
> [!NOTE]
51+
> Currently, Batch only supports generalized custom images. You can't create a custom image from a specialized image at this time.
52+
5053
To scale Batch pools reliably with a custom image, we recommend creating a managed image using *only* the first method: using snapshots of the VM's disks. See the following steps to prepare a VM, take a snapshot, and create an image from the snapshot.
5154

5255
### Prepare a VM

0 commit comments

Comments
 (0)