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/virtual-machines/linux/create-upload-generic.md
+17-56Lines changed: 17 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,37 +228,37 @@ The [Azure Linux Agent](../extensions/agent-linux.md) `waagent` provisions a Lin
228
228
sudo systemctl enable cloud-init.service
229
229
```
230
230
231
+
1. Swap: Do not create swap space on the OS disk.
231
232
232
-
1.7. Swap: Do not create swap space on the OS disk.
233
+
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.
233
234
234
-
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.
235
+
Azure Linux Agent
236
+
Modify the following parameters in /etc/waagent.conf
235
237
236
-
Azure Linux Agent
237
-
Modify the following parameters in /etc/waagent.conf
238
-
```
239
-
ResourceDisk.Format=y
240
-
ResourceDisk.Filesystem=ext4
241
-
ResourceDisk.MountPoint=/mnt/resource
242
-
ResourceDisk.EnableSwap=y
243
-
ResourceDisk.SwapSizeMB=2048 ## NOTE: Set this to your desired size.
244
-
```
238
+
```
239
+
ResourceDisk.Format=y
240
+
ResourceDisk.Filesystem=ext4
241
+
ResourceDisk.MountPoint=/mnt/resource
242
+
ResourceDisk.EnableSwap=y
243
+
ResourceDisk.SwapSizeMB=2048 ## NOTE: Set this to your desired size.
244
+
```
245
245
246
-
Cloud-init
247
-
Configure cloud-init to handle the provisioning:
246
+
Cloud-init
247
+
Configure cloud-init to handle the provisioning:
248
248
249
249
```bash
250
250
sed -i 's/Provisioning.Agent=auto/Provisioning.Agent=cloud-auto/g' /etc/waagent.conf
251
251
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
252
252
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
253
253
```
254
254
255
-
Configure Cloud-init to create swap.
255
+
Configure Cloud-init to create swap.
256
256
257
-
To format and create swap you have 2 options either:
257
+
To format and create swap you have 2 options either:
258
258
259
-
1. Pass this in as a cloud-init config every time you create a VM through `customdata`. This is the recommended method.
259
+
1. Pass this in as a cloud-init config every time you create a VM through `customdata`. This is the recommended method.
260
260
261
-
2. Use a cloud-init directive baked into the image that will do this every time the VM is created.
261
+
2. Use a cloud-init directive baked into the image that will do this every time the VM is created.
262
262
263
263
Create cfg file to configure swap using Cloud-init:
264
264
@@ -283,14 +283,6 @@ To format and create swap you have 2 options either:
283
283
EOF
284
284
```
285
285
286
-
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.
287
-
```
288
-
ResourceDisk.Format=y
289
-
ResourceDisk.Filesystem=ext4
290
-
ResourceDisk.MountPoint=/mnt/resource
291
-
ResourceDisk.EnableSwap=y
292
-
ResourceDisk.SwapSizeMB=2048 ## NOTE: Set this to your desired size.
293
-
```
294
286
295
287
9. Configure cloud-init to handle the provisioning:
296
288
1. Configure waagent for cloud-init:
@@ -337,37 +329,6 @@ To format and create swap you have 2 options either:
337
329
EOF
338
330
```
339
331
340
-
10. Swap configuration. Do not create swap space on the operating system disk.
341
-
Previously, the Azure Linux Agent automatically configured swap space by using the local resource disk that is attached to the virtual machine after the virtual machine is provisioned on Azure. However, this is now handled by cloud-init, you must not use the Linux Agent to format the resource disk create the swap file, modify the following parameters in /etc/waagent.conf appropriately:
342
-
```
343
-
ResourceDisk.Format=n
344
-
ResourceDisk.EnableSwap=n
345
-
```
346
-
If you want to mount, format and create swap you can either:
347
-
1. Pass this in as a cloud-init config every time you create a VM through `customdata`. This is the recommended method.
348
-
2. Use a cloud-init directive baked into the image that will do this every time the VM is created.
0 commit comments