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
description: Learn how to create a template to use with Azure Image Builder.
4
4
author: danis
5
5
ms.author: danis
6
-
ms.date: 01/23/2020
6
+
ms.date: 02/20/2020
7
7
ms.topic: article
8
8
ms.service: virtual-machines-linux
9
9
ms.subservice: imaging
@@ -30,7 +30,12 @@ This is the basic template format:
30
30
"buildTimeoutInMinutes": <minutes>,
31
31
"vmProfile":
32
32
{
33
-
"vmSize": "<vmSize>"
33
+
"vmSize": "<vmSize>",
34
+
"osDiskSizeGB": <sizeInGB>,
35
+
"vnetConfig": {
36
+
"name": "<vnetName>",
37
+
"subnetName": "<subnetName>",
38
+
"resourceGroupName": "<vnetRgName>"
34
39
},
35
40
"build": {},
36
41
"customize": {},
@@ -59,6 +64,8 @@ The location is the region where the custom image will be created. For the Image
59
64
- West Central US
60
65
- West US
61
66
- West US 2
67
+
- North Europe
68
+
- West Europe
62
69
63
70
64
71
```json
@@ -75,14 +82,24 @@ By default Image Builder will use a "Standard_D1_v2" build VM, you can override
75
82
76
83
## osDiskSizeGB
77
84
78
-
By default, Image Builder will not change the size of the image, it will use the size from the source image. You can adjust the size of the OS Disk (Win and Linux), note, do not go too small than the minimum required space required for the OS. This is optional, and a value of 0 means leave the same size as the source image. This is optional.
85
+
By default, Image Builder will not change the size of the image, it will use the size from the source image. You can increase the size of the OS Disk (Win and Linux), this is optional, and a value of 0 means leave the same size as the source image.
79
86
80
87
```json
81
88
{
82
89
"osDiskSizeGB": 100
83
90
},
84
91
```
85
92
93
+
## vnetConfig
94
+
If you do not specify any VNET properties, then Image Builder will create its own VNET, Public IP, and NSG. The Public IP is used for the service to communicate with the build VM, however if you do not want a Public IP or want Image Builder to have access to your existing VNET resources, such as configuration servers (DSC, Chef, Puppet, Ansible), file shares etc., then you can specify a VNET. For more information, review the [networking documentation](https://github.com/danielsollondon/azvmimagebuilder/blob/master/aibNetworking.md#networking-with-azure-vm-image-builder), this is optional.
95
+
96
+
```json
97
+
"vnetConfig": {
98
+
"name": "<vnetName>",
99
+
"subnetName": "<subnetName>",
100
+
"resourceGroupName": "<vnetRgName>"
101
+
}
102
+
```
86
103
## Tags
87
104
88
105
These are key/value pairs you can specify for the image that's generated.
@@ -127,33 +144,15 @@ For more information on deploying this feature, see [Configure managed identitie
127
144
The `source` section contains information about the source image that will be used by Image Builder.
128
145
129
146
The API requires a 'SourceType' that defines the source for the image build, currently there are three types:
130
-
- ISO - use this when the source is a RHEL ISO.
131
147
- PlatformImage - indicated the source image is a Marketplace image.
132
148
- ManagedImage - use this when starting from a regular managed image.
133
149
- SharedImageVersion - this is used when you are using an image version in a Shared Image Gallery as the source.
134
150
135
151
### ISO source
152
+
We are deprecating this functionality from image builder, as there are now [RHEL Bring Your Own Subscription images](https://docs.microsoft.com/azure/virtual-machines/workloads/redhat/byos), please review the timelines below:
153
+
* 31 March 2020 - Image Templates with RHEL ISO sources will now longer be accepted by the resource provider.
154
+
* 30 April 2020- Image Templates that contain RHEL ISO sources will not be processed anymore.
136
155
137
-
Azure Image Builder only supports using published Red Hat Enterprise Linux 7.x Binary DVD ISOs, for preview. Image Builder supports:
138
-
- RHEL 7.3
139
-
- RHEL 7.4
140
-
- RHEL 7.5
141
-
142
-
```json
143
-
"source": {
144
-
"type": "ISO",
145
-
"sourceURI": "<sourceURI from the download center>",
146
-
"sha256Checksum": "<checksum associated with ISO>"
147
-
}
148
-
```
149
-
150
-
To get the `sourceURI` and `sha256Checksum` values, go to `https://access.redhat.com/downloads` then select the product **Red Hat Enterprise Linux**, and a supported version.
151
-
152
-
In the list of **Installers and Images for Red Hat Enterprise Linux Server**, you need to copy the link for Red Hat Enterprise Linux 7.x Binary DVD, and the checksum.
153
-
154
-
> [!NOTE]
155
-
> The access tokens of the links are refreshed at frequent intervals, so every time you want to submit a template, you must check if the RH link address has changed.
156
-
157
156
### PlatformImage source
158
157
Azure Image Builder supports Windows Server and client, and Linux Azure Marketplace images, see [here](https://docs.microsoft.com/azure/virtual-machines/windows/image-builder-overview#os-support) for the full list.
159
158
@@ -163,7 +162,7 @@ Azure Image Builder supports Windows Server and client, and Linux Azure Marketp
163
162
"publisher": "Canonical",
164
163
"offer": "UbuntuServer",
165
164
"sku": "18.04-LTS",
166
-
"version": "18.04.201903060"
165
+
"version": "latest"
167
166
},
168
167
```
169
168
@@ -174,8 +173,7 @@ The properties here are the same that are used to create VM's, using AZ CLI, run
174
173
az vm image list -l westus -f UbuntuServer -p Canonical --output table –-all
175
174
```
176
175
177
-
> [!NOTE]
178
-
> Version cannot be ‘latest’, you must use the command above to get a version number.
176
+
You can use 'latest' in the version, the version is evaluated when the image build takes place, not when the template is submitted. If you use this functionality with the Shared Image Gallery destination, you can avoid resubmitting the template, and rerun the image build at intervals, so your images are recreated from the most recent images.
179
177
180
178
### ManagedImage source
181
179
@@ -212,7 +210,7 @@ By default, the Image Builder will run for 240 minutes. After that, it will time
212
210
[ERROR] complete: 'context deadline exceeded'
213
211
```
214
212
215
-
If you do not specify a buildTimeoutInMinutes value, or set it to 0, is will use the default value. You can increase or decrease the value, up to the maximum of 960mins (16hrs). For Windows, we do not recommend setting this below 60 minutes. If you find you are hitting the timeout, review the [logs](https://github.com/danielsollondon/azvmimagebuilder/blob/master/troubleshootingaib.md#collecting-and-reviewing-aib-image-build-logs), to see if the customization step is waiting on something like user input.
213
+
If you do not specify a buildTimeoutInMinutes value, or set it to 0, this will use the default value. You can increase or decrease the value, up to the maximum of 960mins (16hrs). For Windows, we do not recommend setting this below 60 minutes. If you find you are hitting the timeout, review the [logs](https://github.com/danielsollondon/azvmimagebuilder/blob/master/troubleshootingaib.md#collecting-and-reviewing-aib-image-build-logs), to see if the customization step is waiting on something like user input.
216
214
217
215
If you find you need more time for customizations to complete, set this to what you think you need, with a little overhead. But, do not set it too high because you might have to wait for it to timeout before seeing an error.
218
216
@@ -388,12 +386,36 @@ If there is an error trying to download the file, or put it in a specified direc
388
386
389
387
Files in the File customizer can be downloaded from Azure Storage using [MSI](https://github.com/danielsollondon/azvmimagebuilder/tree/master/quickquickstarts/7_Creating_Custom_Image_using_MSI_to_Access_Storage).
390
388
389
+
### Windows Update Customizer
390
+
This customizer is built on the [community Windows Update Provisioner](https://packer.io/docs/provisioners/community-supported.html) for Packer, which is an open source project maintained by the Packer community. Microsoft tests and validate the provisioner with the Image Builder service, and will support investigating issues with it, and work to resolve issues, however the open source project is not officially supported by Microsoft. For detailed documentation on and help with the Windows Update Provisioner please see the project repository.
391
+
392
+
"customize": [
393
+
{
394
+
"type": "WindowsUpdate",
395
+
"searchCriteria": "IsInstalled=0",
396
+
"filters": [
397
+
"exclude:$_.Title -like '*Preview*'",
398
+
"include:$true"
399
+
],
400
+
"updateLimit": 20
401
+
}
402
+
],
403
+
OS support: Windows
404
+
405
+
Customize properties:
406
+
- **type** – WindowsUpdate.
407
+
- **searchCriteria** - Optional, defines which type of updates are installed (Recommended, Important etc.), BrowseOnly=0 and IsInstalled=0 (Recommended) is the default.
408
+
- **filters** – Optional, allows you to specify a filter to include or exclude updates.
409
+
- **updateLimit** – Optional, defines how many updates can be installed, default 1000.
410
+
411
+
412
+
391
413
### Generalize
392
414
By default, Azure Image Builder will also run ‘deprovision’ code at the end of each image customization phase, to ‘generalize’ the image. Generalizing is a process where the image is set up so it can be reused to create multiple VMs. For Windows VMs, Azure Image Builder uses Sysprep. For Linux, Azure Image Builder runs ‘waagent -deprovision’.
393
415
394
416
The commands Image Builder users to generalize may not be suitable for every situation, so Azure Image Builder will allow you to customize this command, if needed.
395
417
396
-
If you are migrating existing customization, and you are using different Sysprep/waagent commands, you can using the Image Builder generic commands, and if the VM creation fails, use your own Sysprep or waagent commands.
418
+
If you are migrating existing customization, and you are using different Sysprep/waagent commands, you can use the Image Builder generic commands, and if the VM creation fails, use your own Sysprep or waagent commands.
397
419
398
420
If Azure Image Builder creates a Windows custom image successfully, and you create a VM from it, then find that the VM creation fails or does not complete successfully, you will need to review the Windows Server Sysprep documentation or raise a support request with the Windows Server Sysprep Customer Services Support team, who can troubleshoot and advise on the correct Sysprep usage.
0 commit comments