Skip to content

Commit 6616517

Browse files
authored
Merge pull request #233579 from ericd-mst-github/erd-aib-prefetch
Erd aib prefetch
2 parents c17fe61 + c7791a7 commit 6616517

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: VM Boot Optimization for Azure Compute Gallery Images with Azure VM Image Builder
3+
description: Optimize VM Boot and Provisioning time with Azure VM Image Builder
4+
ms.author: surbhijain
5+
ms.reviewer: kofiforson
6+
ms.date: 06/07/2023
7+
ms.topic: how-to
8+
ms.service: virtual-machines
9+
ms.subservice: image-builder
10+
---
11+
12+
13+
14+
# VM optimization for gallery images with Azure VM Image Builder
15+
16+
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Windows VMs :heavy_check_mark: Virtual Machine Scale Sets
17+
18+
In this article, you learn how to use Azure VM Image Builder to optimize your ACG (Azure Compute Gallery) Images or Managed Images or VHDs to improve the create time for your VMs.
19+
20+
## Azure VM Optimization
21+
Azure VM optimization improves virtual machine creation time by updating the gallery image to optimize the image for a faster boot time.
22+
23+
## Image types supported
24+
25+
Optimization for the following images is supported:
26+
27+
| Features | Details |
28+
|---|---|
29+
|OS Type| Linux, Windows |
30+
| Partition | MBR/GPT |
31+
| Hyper-V | Gen1/Gen2 |
32+
| OS State | Generalized |
33+
34+
The following types of images aren't supported:
35+
36+
* Images with size greater than 2 TB
37+
* ARM64 images
38+
* Specialized images
39+
40+
41+
## Optimization in Azure VM Image Builder
42+
43+
Optimization can be enabled while creating a VM image using the CLI.
44+
45+
Customers can create an Azure VM Image Builder template using CLI. It contains details regarding source, type of customization, and distribution.
46+
47+
In your template, you will need to enable the additional fields for VM optimization. For more information on how to enable the VM optimization fields for your image builder template, see the [Optimize property](../virtual-machines/linux/image-builder-json.md#properties-optimize).
48+
49+
> [!NOTE]
50+
> To enable VM optimization benefits, you must be using Azure Image Builder API Version `2022-07-01` or later.
51+
52+
53+
54+
## FAQs
55+
56+
57+
58+
### Can VM optimization be used without Azure VM Image Builder customization?
59+
60+
61+
62+
Yes, customers can opt for only VM optimization without using Azure VM Image Builder customization feature. Customers can simply enable the optimization flag and keep customization field as empty.
63+
64+
65+
66+
### Can an existing ACG image version be optimized?
67+
68+
No, this optimization feature won't update an existing SIG image version. However, optimization can be enabled during new version creation for an existing image
69+
70+
71+
72+
## How much time does it take for generating an optimized image?
73+
74+
75+
76+
The below latencies have been observed at various percentiles:
77+
78+
| OS | Size | P50 | P95 | Average |
79+
| --- | --- | --- | --- | --- |
80+
| Linux | 30 GB VHD | 20 mins | 21 mins | 20 mins |
81+
| Windows | 127 GB VHD | 34 mins | 35 mins | 33 mins |
82+
83+
84+
85+
This is the end to end duration observed. Note, image generation duration varies based on different factors such as, OS Type, VHD size, OS State, etc.
86+
87+
88+
89+
### Is OS image copied out of customer subscription for optimization?
90+
91+
Yes, the OS VHD is copied from customer subscription to Azure subscription for optimization in the same geographic location. Once optimization is finished or timed out, Azure internally deletes all copied OS VHDs.
92+
93+
### What are the performance improvements observed for VM boot optimization?
94+
95+
Enabling VM boot optimization feature may not always result in noticeable performance improvement as it depends on several factors like source image already optimized, OS type, customization etc. However, to ensure the best VM boot performance, it's recommended to enable this feature.
96+
97+
98+
99+
## Next steps
100+
Learn more about [Azure Compute Gallery](../virtual-machines/azure-compute-gallery.md).

articles/virtual-machines/linux/image-builder-json.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The basic format is:
3535
"buildTimeoutInMinutes": <minutes>,
3636
"customize": [],
3737
"distribute": [],
38+
"optimize": [],
3839
"source": {},
3940
"stagingResourceGroup": "/subscriptions/<subscriptionID>/resourceGroups/<stagingResourceGroupName>",
4041
"validate": {},
@@ -1145,6 +1146,36 @@ VHD distribute properties:
11451146

11461147
**uri** - Optional Azure Storage URI for the distributed VHD blob. Omit to use the default (empty string) in which case VHD would be published to the storage account in the staging resource group.
11471148

1149+
## Properties: optimize
1150+
1151+
The `optimize` property can be enabled while creating a VM image and allows VM optimization to improve image creation time.
1152+
1153+
# [JSON](#tab/json)
1154+
1155+
```json
1156+
"optimize": {
1157+
1158+
"vmboot": {
1159+
1160+
"state": "Enabled"
1161+
1162+
}
1163+
1164+
}
1165+
```
1166+
1167+
# [Bicep](#tab/bicep)
1168+
1169+
```bicep
1170+
optimize: {
1171+
vmboot: {
1172+
state: 'Enabled'
1173+
}
1174+
}
1175+
```
1176+
---
1177+
1178+
11481179
## Properties: source
11491180

11501181
The `source` section contains information about the source image that will be used by Image Builder. Azure Image Builder only supports generalized images as source images, specialized images aren't supported at this time.

0 commit comments

Comments
 (0)