Skip to content

Commit 4b42deb

Browse files
Merge pull request #10197 from mabicca/patch-10
AB#8322: Update swap file creation notes for large VMs
2 parents 2418ea1 + 942fff3 commit 4b42deb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

support/azure/virtual-machines/linux/create-swap-file-linux-vm.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.reviewer: mabicca
1414

1515
**Applies to:** :heavy_check_mark: Linux VMs
1616

17-
To create a SWAP partition on Azure Linux VMs, you need to set up cloud-init to automatically create it on the ephemeral (resource) disk of the VM. The resource disk is mounted under `/mnt` by default. It's located on the physical server where the Linux VM is hosted and has lower latency. It isn't recommended to create SWAP partitions on OS disks or data disks that might impact the performance of the operating system and apps. It's important to remember that the resource disk should never be used to store regular data since it's only temporary storage. When a VM is moved to another host or stopped/deallocated, any data written to this disk will be wiped. It's recommended to use the resource disk only for data that can be removed such as SWAP and caching files. For more information, see [Temporary disk](/azure/virtual-machines/managed-disks-overview#temporary-disk).
17+
To create a SWAP partition on Azure Linux virtual machines (VMs), you need to set up cloud-init to automatically create it on the ephemeral (resource) disk of the VM. The resource disk is mounted under `/mnt` by default. It's located on the physical server where the Linux VM is hosted and has lower latency. It isn't recommended to create SWAP partitions on OS disks or data disks that might impact the performance of the operating system and apps. It's important to remember that the resource disk should never be used to store regular data since it's only temporary storage. When a VM is moved to another host or stopped/deallocated, any data written to this disk will be wiped. It's recommended to use the resource disk only for data that can be removed such as SWAP and caching files. For more information, see [Temporary disk](/azure/virtual-machines/managed-disks-overview#temporary-disk).
1818

1919
## Disable SWAP creation in waagent configuration
2020

@@ -43,11 +43,14 @@ If the SWAP creation is configured in */etc/waagent.conf*, you must disable it.
4343
You can create a SWAP partition by using one of the following options.
4444
4545
> [!NOTE]
46-
> When a SWAP partition is created, a swap file is also created on it.
46+
> On VM SKUs that have large temporary disks, we strongly recommend changing the following variables to create smaller files and SWAP partitions. For example, some VMs have 2 TB or greater temporary disks.
4747
4848
<details>
4949
<summary>Option 1: Create a SWAP partition under the resource or custom disk path by using scripts</summary>
5050
51+
> [!NOTE]
52+
> When a SWAP partition is created, a SWAP file is also created on it.
53+
5154
1. Create a SWAP creation script named *swap.sh* under */var/lib/cloud/scripts/per-boot* with the following script:
5255
5356
```bash

0 commit comments

Comments
 (0)