You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/batch-custom-images.md
+68-28Lines changed: 68 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
1
---
2
2
title: Provision a custom pool from a managed image
3
3
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/22/2020
6
6
---
7
7
8
8
# Use a managed image to create a pool of virtual machines
9
9
10
-
To create a custom image for your Batch pool's virtual machines (VMs), you can use either the [Shared Image Gallery](batch-sig-images.md), or a *managed image* resource.
10
+
To create a custom image for your Batch pool's virtual machines (VMs), you can use a managed image to create a [Shared Image Gallery](batch-sig-images.md). Using just a managed image is also supported, but only for API versions up to and including 2019-08-01.
11
11
12
-
> [!TIP]
12
+
> [!IMPORTANT]
13
13
> In most cases, you should create custom images using the Shared Image Gallery. By using the Shared Image Gallery, you can provision pools faster, scale larger quantities of VMs, and have improved reliability when provisioning VMs. To learn more, see [Use the Shared Image Gallery to create a custom pool](batch-sig-images.md).
14
14
15
15
## Prerequisites
16
16
17
-
-**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.
17
+
-**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.
18
18
- 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`.
20
20
- 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.
21
21
22
-
-**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).
22
+
-**Azure Active Directory (Azure AD) authentication**. The Batch client API must use Azure AD authentication. Azure Batch support for Azure AD is documented in [Authenticate Batch service solutions with Active Directory](batch-aad-auth.md).
23
23
24
24
## Prepare a custom image
25
25
@@ -29,16 +29,14 @@ In Azure, you can prepare a managed image from:
29
29
- A generalized Azure VM with managed disks
30
30
- A generalized on-premises VHD uploaded to the cloud
31
31
32
-
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.
32
+
To scale Batch pools reliably with a managed image, we recommend creating the managed image using *only* the first method: using snapshots of the VM's disks. The following steps show how to prepare a VM, take a snapshot, and create a managed image from the snapshot.
33
33
34
34
### Prepare a VM
35
35
36
36
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.
37
37
38
38
> [!NOTE]
39
-
> 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#deploy-an-image-with-marketplace-terms
40
-
) or [Windows](../virtual-machines/windows/cli-ps-findimage.md#deploy-an-image-with-marketplace-terms
41
-
) VMs.
39
+
> 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#deploy-an-image-with-marketplace-terms) or [Windows](../virtual-machines/windows/cli-ps-findimage.md#deploy-an-image-with-marketplace-terms) VMs.
42
40
43
41
- Ensure the VM is created with a managed disk. This is the default storage setting when you create a VM.
44
42
- Do not install Azure extensions, such as the Custom Script extension, on the VM. If the image contains a pre-installed extension, Azure may encounter problems when deploying the Batch pool.
@@ -54,29 +52,70 @@ A snapshot is a full, read-only copy of a VHD. To create a snapshot of a VM's OS
54
52
55
53
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.
56
54
57
-
## Create a pool from a custom image in the portal
55
+
## Create a pool from a custom image
58
56
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.
57
+
Once you have found the resource ID of your managed image, create a custom image pool from that image. The following steps show you how to create a custom image pool using either Batch Service or Batch Management.
60
58
61
59
> [!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).
60
+
> 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).
63
61
>
64
62
> 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.
65
63
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
-

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.
0 commit comments