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
+35-8Lines changed: 35 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,19 @@ ms.date: 05/18/2020
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 the [Shared Image Gallery](batch-sig-images.md). We also provide a way to create a custom image with a *managed image* resource.
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
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
@@ -36,9 +36,7 @@ To scale Batch pools reliably with a custom image, we recommend creating a manag
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,7 +52,7 @@ 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 Shared Image using C#
55
+
## Create a pool from a custom image
58
56
59
57
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.
60
58
@@ -63,6 +61,8 @@ Once you have saved your custom image and you know its resource ID or name, crea
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.
Copy file name to clipboardExpand all lines: articles/batch/batch-sig-images.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,22 +19,22 @@ Using a Shared Image saves time in preparing your pool's compute nodes to run yo
19
19
20
20
Using a Shared Image configured for your scenario can provide several advantages:
21
21
22
-
***Use the same images across the regions.** You can create Shared Image replicas across different regions so all your pools utilize the same image.
23
-
***Configure the operating system (OS).** You can customize the configuration of the image's operating system disk.
24
-
***Pre-install applications.** Pre-installing applications on the OS disk is more efficient and less error-prone than installing applications after provisioning the compute nodes with a start task.
25
-
***Copy large amounts of data once.** Make static data part of the managed Shared Image by copying it to a managed image's data disks. This only needs to be done once and makes data available to each node of the pool.
26
-
***Grow pools to larger sizes.** With the Shared Image Gallery, you can create larger pools with your customized images along with more Shared Image replicas.
27
-
***Better performance than custom image.** Using Shared Images, the time it takes for the pool to reach the steady state is up to 25% faster, and the VM idle latency is up to 30% shorter.
28
-
***Image versioning and grouping for easier management.** The image grouping definition contains information about why the image was created, what OS it is for, and information about using the image. Grouping images allows for easier image management. For more information, see [Image definitions](../virtual-machines/windows/shared-image-galleries.md#image-definitions).
22
+
-**Use the same images across the regions.** You can create Shared Image replicas across different regions so all your pools utilize the same image.
23
+
-**Configure the operating system (OS).** You can customize the configuration of the image's operating system disk.
24
+
-**Pre-install applications.** Pre-installing applications on the OS disk is more efficient and less error-prone than installing applications after provisioning the compute nodes with a start task.
25
+
-**Copy large amounts of data once.** Make static data part of the managed Shared Image by copying it to a managed image's data disks. This only needs to be done once and makes data available to each node of the pool.
26
+
-**Grow pools to larger sizes.** With the Shared Image Gallery, you can create larger pools with your customized images along with more Shared Image replicas.
27
+
-**Better performance than custom image.** Using Shared Images, the time it takes for the pool to reach the steady state is up to 25% faster, and the VM idle latency is up to 30% shorter.
28
+
-**Image versioning and grouping for easier management.** The image grouping definition contains information about why the image was created, what OS it is for, and information about using the image. Grouping images allows for easier image management. For more information, see [Image definitions](../virtual-machines/windows/shared-image-galleries.md#image-definitions).
29
29
30
30
## Prerequisites
31
31
32
32
> [!NOTE]
33
33
> You need to authenticate using Azure AD. If you use shared-key-auth, you will get an authentication error.
34
34
35
-
***An Azure Batch account.** To create a Batch account, see the Batch quickstarts using the [Azure portal](quick-create-portal.md) or [Azure CLI](quick-create-cli.md).
35
+
-**An Azure Batch account.** To create a Batch account, see the Batch quickstarts using the [Azure portal](quick-create-portal.md) or [Azure CLI](quick-create-cli.md).
36
36
37
-
***A Shared Image Gallery image**. To create a Shared Image, you need to have or create a managed image resource. The image should be created from snapshots of the VM's OS disk and optionally its attached data disks. For more information, see [Prepare a managed image](#prepare-a-managed-image).
37
+
-**A Shared Image Gallery image**. To create a Shared Image, you need to have or create a managed image resource. The image should be created from snapshots of the VM's OS disk and optionally its attached data disks. For more information, see [Prepare a managed image](#prepare-a-managed-image).
38
38
39
39
> [!NOTE]
40
40
> Your Shared Image must be in the same subscription as the Batch account. Your Shared Image can be in different regions as long as it has replicas in the same region as your Batch account.
@@ -43,9 +43,9 @@ Using a Shared Image configured for your scenario can provide several advantages
43
43
44
44
In Azure, you can prepare a managed image from:
45
45
46
-
* Snapshots of an Azure VM's OS and data disks
47
-
* A generalized Azure VM with managed disks
48
-
* A generalized on-premises VHD uploaded to the cloud
46
+
- Snapshots of an Azure VM's OS and data disks
47
+
- A generalized Azure VM with managed disks
48
+
- A generalized on-premises VHD uploaded to the cloud
49
49
50
50
> [!NOTE]
51
51
> Currently, Batch only supports generalized custom images. You can't create a custom image from a specialized image at this time.
@@ -57,15 +57,13 @@ To scale Batch pools reliably with a custom image, we recommend creating a manag
57
57
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.
58
58
59
59
> [!NOTE]
60
-
> 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
61
-
) or [Windows](../virtual-machines/windows/cli-ps-findimage.md#deploy-an-image-with-marketplace-terms
62
-
) VMs.
60
+
> 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.
63
61
64
-
* Ensure the VM is created with a managed disk. This is the default storage setting when you create a VM.
65
-
* 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.
66
-
* When using attached data disks, you need to mount and format the disks from within a VM to use them.
67
-
* Ensure that the base OS image you provide uses the default temp drive. The Batch node agent currently expects the default temp drive.
68
-
* Once the VM is running, connect to it via RDP (for Windows) or SSH (for Linux). Install any necessary software or copy desired data.
62
+
- Ensure the VM is created with a managed disk. This is the default storage setting when you create a VM.
63
+
- 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.
64
+
- When using attached data disks, you need to mount and format the disks from within a VM to use them.
65
+
- Ensure that the base OS image you provide uses the default temp drive. The Batch node agent currently expects the default temp drive.
66
+
- Once the VM is running, connect to it via RDP (for Windows) or SSH (for Linux). Install any necessary software or copy desired data.
69
67
70
68
### Create a VM snapshot
71
69
@@ -210,10 +208,11 @@ Use the following steps to create a pool from a Shared Image in the Azure portal
210
208
211
209
If you plan to create a pool with hundreds or thousands of VMs or more using a Shared Image, use the following guidance.
212
210
213
-
***Shared Image Gallery replica numbers.** For every pool with up to 600 instances, we recommend you keep at least one replica. For example, if you are creating a pool with 3000 VMs, you should keep at least 5 replicas of your image. We always suggest keeping more replicas than minimum requirements for better performance.
211
+
-**Shared Image Gallery replica numbers.** For every pool with up to 600 instances, we recommend you keep at least one replica. For example, if you are creating a pool with 3000 VMs, you should keep at least 5 replicas of your image. We always suggest keeping more replicas than minimum requirements for better performance.
214
212
215
-
***Resize timeout.** If your pool contains a fixed number of nodes (if it doesn't autoscale), increase the `resizeTimeout` property of the pool depending on the pool size. For every 1000 VMs, the recommended resize timeout is at least 15 minutes. For example, the recommended resize timeout for a pool with 2000 VMs is at least 30 minutes.
213
+
-**Resize timeout.** If your pool contains a fixed number of nodes (if it doesn't autoscale), increase the `resizeTimeout` property of the pool depending on the pool size. For every 1000 VMs, the recommended resize timeout is at least 15 minutes. For example, the recommended resize timeout for a pool with 2000 VMs is at least 30 minutes.
216
214
217
215
## Next steps
218
216
219
-
* For an in-depth overview of Batch, see [Batch service workflow and resources](batch-service-workflow-features.md).
217
+
- For an in-depth overview of Batch, see [Batch service workflow and resources](batch-service-workflow-features.md).
218
+
- Learn about the [Shared Image Gallery](../virtual-machines/windows/shared-image-galleries.md).
0 commit comments