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
3. The maximum size allowed for the VHD is 1,023 GB.
30
+
3. The vfat kernel module must be enabled in the kernel
31
31
32
-
4.When installing the Linux system we recommend that you use standard partitions, rather than Logical Volume Manager (LVM) which is the default for many installations. Using standard partitions will avoid LVM name conflicts with cloned VMs, particularly if an OS disk is ever attached to another identical VM for troubleshooting. [LVM](/previous-versions/azure/virtual-machines/linux/configure-lvm) or [RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) may be used on data disks.
32
+
4.The maximum size allowed for the VHD is 1,023 GB.
33
33
34
-
5.Kernel support for mounting UDF file systems is necessary. At first boot on Azure the provisioning configuration is passed to the Linux VM by using UDF-formatted media that is attached to the guest. The Azure Linux agent must mount the UDF file system to read its configuration and provision the VM.
34
+
5.When installing the Linux system we recommend that you use standard partitions, rather than Logical Volume Manager (LVM) which is the default for many installations. Using standard partitions will avoid LVM name conflicts with cloned VMs, particularly if an OS disk is ever attached to another identical VM for troubleshooting. [LVM](/previous-versions/azure/virtual-machines/linux/configure-lvm) or [RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) may be used on data disks.
35
35
36
-
6. Linux kernel versions earlier than 2.6.37 don't support NUMA on Hyper-V with larger VM sizes. This issue primarily impacts older distributions using the upstream Red Hat 2.6.32 kernel, and was fixed in Red Hat Enterprise Linux (RHEL) 6.6 (kernel-2.6.32-504). Systems running custom kernels older than 2.6.37, or RHEL-based kernels older than 2.6.32-504 must set the boot parameter `numa=off` on the kernel command line in grub.conf. For more information, see [Red Hat KB 436883](https://access.redhat.com/solutions/436883).
37
-
7. Don't configure a swap partition on the OS disk. The Linux agent can be configured to create a swap file on the temporary resource disk, as described in the following steps.
36
+
6. Kernel support for mounting UDF file systems is necessary. At first boot on Azure the provisioning configuration is passed to the Linux VM by using UDF-formatted media that is attached to the guest. The Azure Linux agent must mount the UDF file system to read its configuration and provision the VM.
38
37
39
-
8. All VHDs on Azure must have a virtual size aligned to 1 MB (1024 × 1024 bytes). When converting from a raw disk to VHD you must ensure that the raw disk size is a multiple of 1 MB before conversion, as described in the following steps.
40
-
9. Use the most up-to-date distribution version, packages, and software.
41
-
8. Remove users and system accounts, public keys, sensitive data, unnecessary software and application.
38
+
7. Linux kernel versions earlier than 2.6.37 don't support NUMA on Hyper-V with larger VM sizes. This issue primarily impacts older distributions using the upstream Red Hat 2.6.32 kernel, and was fixed in Red Hat Enterprise Linux (RHEL) 6.6 (kernel-2.6.32-504). Systems running custom kernels older than 2.6.37, or RHEL-based kernels older than 2.6.32-504 must set the boot parameter `numa=off` on the kernel command line in grub.conf. For more information, see [Red Hat KB 436883](https://access.redhat.com/solutions/436883).
39
+
40
+
8. Don't configure a swap partition on the OS disk. The Linux agent can be configured to create a swap file on the temporary resource disk, as described in the following steps.
41
+
42
+
10. All VHDs on Azure must have a virtual size aligned to 1 MB (1024 × 1024 bytes). When converting from a raw disk to VHD you must ensure that the raw disk size is a multiple of 1 MB before conversion, as described in the following steps.
43
+
44
+
11. Use the most up-to-date distribution version, packages, and software.
45
+
46
+
12. Remove users and system accounts, public keys, sensitive data, unnecessary software and application.
47
+
48
+
49
+
> [!NOTE]
50
+
> **(_Cloud-init >= 21.2 removes the udf requirement._)** however without the udf module enabled the cdrom will not mount during provisioning preventing custom data from being applied. A workaround for this would be to apply custom data using user data however, unlike custom data user data is not encrypted. https://cloudinit.readthedocs.io/en/latest/topics/format.html
42
51
43
52
44
53
@@ -191,6 +200,10 @@ The [Azure Linux Agent](../extensions/agent-linux.md) `waagent` provisions a Lin
191
200
1. Install the Azure Linux Agent.
192
201
The Azure Linux Agent is required for provisioning a Linux image on Azure. Many distributions provide the agent as an RPM or .deb package (the package is typically called WALinuxAgent or walinuxagent). The agent can also be installed manually by following the steps in the [Linux Agent Guide](../extensions/agent-linux.md).
193
202
203
+
> [!NOTE]
204
+
> Make sure **'udf'** and **'vfat'** modules are enable. Blacklisting or removing the udf module will cause a provisioning failure. Blacklisting or removing vfat module will cause both provisioning and boot failures. **(_Cloud-init >= 21.2 removes the udf requirement. Please read top of document for more detail)**
205
+
206
+
194
207
Install the Azure Linux Agent, cloud-init and other necessary utilities by running the following command:
195
208
196
209
**Redhat/Centos**
@@ -212,7 +225,59 @@ The [Azure Linux Agent](../extensions/agent-linux.md) `waagent` provisions a Lin
212
225
```
213
226
214
227
215
-
1. Don't create swap space on the OS disk. The Azure Linux Agent can automatically configure swap space using the local resource disk that is attached to the VM after provisioning on Azure. The local resource disk is a temporary disk, and might be emptied when the VM is deprovisioned. After installing the Azure Linux Agent, modify the following parameters in /etc/waagent.conf as needed.
228
+
1.7. Swap: Do not create swap space on the OS disk.
229
+
230
+
The Azure Linux Agent or Cloud-init can be used to configure swap space using the local resource disk. This resource disk is attached to the VM after provisioning on Azure. The local resource disk is a temporary disk, and might be emptied when the VM is deprovisioned. The following blocks show how to configure this swap.
231
+
232
+
Azure Linux Agent
233
+
Modify the following parameters in /etc/waagent.conf
234
+
```
235
+
ResourceDisk.Format=y
236
+
ResourceDisk.Filesystem=ext4
237
+
ResourceDisk.MountPoint=/mnt/resource
238
+
ResourceDisk.EnableSwap=y
239
+
ResourceDisk.SwapSizeMB=2048 ## NOTE: Set this to your desired size.
240
+
```
241
+
242
+
Cloud-init
243
+
Configure cloud-init to handle the provisioning:
244
+
245
+
```bash
246
+
sed -i 's/Provisioning.Agent=auto/Provisioning.Agent=cloud-auto/g' /etc/waagent.conf
247
+
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
248
+
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
249
+
```
250
+
Configure Cloud-init to create swap
251
+
To format and create swap you have 2 options either:
252
+
253
+
1. Pass this in as a cloud-init config every time you create a VM through `customdata`. This is the recommended method.
254
+
255
+
2. Use a cloud-init directive baked into the image that will do this every time the VM is created.
256
+
257
+
Create cfg file to configure swap using Cloud-init:
2. Don't create swap space on the OS disk. The Azure Linux Agent can automatically configure swap space using the local resource disk that is attached to the VM after provisioning on Azure. The local resource disk is a temporary disk, and might be emptied when the VM is deprovisioned. After installing the Azure Linux Agent, modify the following parameters in /etc/waagent.conf as needed.
0 commit comments