Skip to content

Commit 1cab343

Browse files
Merge pull request #238062 from Padmalathas/Padmalathas-patch-3
Updates Custom Image Creation using Portal
2 parents d2a353f + 97d2664 commit 1cab343

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

articles/batch/batch-sig-images.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use the Azure Compute Gallery to create a custom image pool
33
description: Custom image pools are an efficient way to configure compute nodes to run your Batch workloads.
44
ms.topic: conceptual
5-
ms.date: 03/04/2021
5+
ms.date: 05/12/2023
66
ms.devlang: csharp, python
77
ms.custom: devx-track-python, devx-track-azurecli
88
---
@@ -60,7 +60,14 @@ The following steps show how to prepare a VM, take a snapshot, and create an ima
6060

6161
### Prepare a VM
6262

63-
If you are creating a new VM for the image, use a first party Azure Marketplace image supported by Batch as the base image for your managed image. Only first party images can be used as a base image. To get a full list of Azure Marketplace image references supported by Azure Batch, see the [List node agent SKUs](/java/api/com.microsoft.azure.batch.protocol.accounts.listnodeagentskus) operation.
63+
If you are creating a new VM for the image, use a first party Azure Marketplace image supported by Batch as the base image for your managed image. Only first party images can be used as a base image.
64+
65+
To get a full list of current Azure Marketplace image references supported by Azure Batch, use one of the following APIs to return a list of Windows and Linux VM images including the node agent SKU IDs for each image:
66+
67+
- PowerShell: [Azure Batch supported images](/powershell/module/az.batch/get-azbatchsupportedimage)
68+
- Azure CLI: [Azure Batch pool supported images](/cli/azure/batch/pool/supported-images)
69+
- Batch service APIs: [Batch service APIs](batch-apis-tools.md#batch-service-apis) and [Azure Batch service supported images](/rest/api/batchservice/account/listsupportedimages)
70+
- List node agent SKUs: [Node agent SKUs](/java/api/com.microsoft.azure.batch.protocol.accounts.listnodeagentskus)
6471

6572
> [!NOTE]
6673
> You can't use a third-party image that has additional license and purchase terms as your base image. For information about these Marketplace images, see the guidance for [Linux](../virtual-machines/linux/cli-ps-findimage.md#check-the-purchase-plan-information) or [Windows](../virtual-machines/windows/cli-ps-findimage.md#view-purchase-plan-properties)VMs.
@@ -83,6 +90,11 @@ A snapshot is a full, read-only copy of a VHD. To create a snapshot of a VM's OS
8390

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

93+
To create an image from a VM in the portal, see [Capture an image of a VM](../virtual-machines/capture-image-portal.md).
94+
95+
To create an image using a source other than a VM, see [Create an image](../virtual-machines/image-version.md).
96+
97+
8698
### Create an Azure Compute Gallery
8799

88100
Once you have successfully created your managed image, you need to create an Azure Compute Gallery to make your custom image available. To learn how to create an Azure Compute Gallery for your images, see [Create an Azure Compute Gallery](../virtual-machines/create-gallery.md).
@@ -94,12 +106,15 @@ To create a pool from your Shared Image using the Azure CLI, use the `az batch p
94106
> [!NOTE]
95107
> You need to authenticate using Azure AD. If you use shared-key-auth, you will get an authentication error.
96108
109+
> [!IMPORTANT]
110+
> The node agent SKU id must align with the publisher/offer/SKU in order for the node to start.
111+
97112
```azurecli
98113
az batch pool create \
99114
--id mypool --vm-size Standard_A1_v2 \
100115
--target-dedicated-nodes 2 \
101116
--image "/subscriptions/{sub id}/resourceGroups/{resource group name}/providers/Microsoft.Compute/galleries/{gallery name}/images/{image definition name}/versions/{version id}" \
102-
--node-agent-sku-id "batch.node.ubuntu 16.04"
117+
--{node-agent-sku-id}
103118
```
104119

105120
## Create a pool from a Shared Image using C#
@@ -111,7 +126,7 @@ private static VirtualMachineConfiguration CreateVirtualMachineConfiguration(Ima
111126
{
112127
return new VirtualMachineConfiguration(
113128
imageReference: imageReference,
114-
nodeAgentSkuId: "batch.node.windows amd64");
129+
nodeAgentSkuId: {});
115130
}
116131

117132
private static ImageReference CreateImageReference()
@@ -185,7 +200,7 @@ ir = batchmodels.ImageReference(
185200
# be installed on the node.
186201
vmc = batchmodels.VirtualMachineConfiguration(
187202
image_reference=ir,
188-
node_agent_sku_id="batch.node.ubuntu 18.04"
203+
{node_agent_sku_id}
189204
)
190205

191206
# Create the unbound pool
@@ -201,7 +216,7 @@ new_pool = batchmodels.PoolAddParameter(
201216
client.pool.add(new_pool)
202217
```
203218

204-
## Create a pool from a Shared Image using the Azure portal
219+
## Create a pool from a Shared Image or Custom Image using the Azure portal
205220

206221
Use the following steps to create a pool from a Shared Image in the Azure portal.
207222

@@ -211,8 +226,10 @@ Use the following steps to create a pool from a Shared Image in the Azure portal
211226
1. In the **Image Type** section, select **Azure Compute Gallery**.
212227
1. Complete the remaining sections with information about your managed image.
213228
1. Select **OK**.
229+
1. Once the node is allocated, use **Connect** to generate user and the RDP file for Windows OR use SSH to for Linux to login to the allocated node and verify.
214230

215231
![Create a pool with from a Shared image with the portal.](media/batch-sig-images/create-custom-pool.png)
232+
216233

217234
## Considerations for large pools
218235

@@ -225,4 +242,4 @@ If you plan to create a pool with hundreds or thousands of VMs or more using a S
225242
## Next steps
226243

227244
- For an in-depth overview of Batch, see [Batch service workflow and resources](batch-service-workflow-features.md).
228-
- Learn about the [Azure Compute Gallery](../virtual-machines/shared-image-galleries.md).
245+
- Learn about the [Azure Compute Gallery](../virtual-machines/shared-image-galleries.md).

0 commit comments

Comments
 (0)