Dismiss Notice

Register now to be one of the first members of this SharePoint Community! Click here it just takes seconds!

Dismiss Notice
Welcome Guest from Country Flag

How to: Add SWAP to Linux VM’s on Azure

Discussion in 'Official Microsoft News' started by Marco A Bicca, Apr 11, 2017.

Thread Status:
Not open for further replies.
  1. Marco A Bicca

    Marco A Bicca Guest

    Blog Posts:
    0
    Every virtual machine (VM) on Azure has what we call a temporary (ephemeral) disk which is recommended to be used ONLY as temporary storage and that includes SWAP files or data that does not need to be available upon a reboot or saved , the data stored in this drive will be lost.

    To create a swap file in the directory that’s defined by the ResourceDisk.MountPoint parameter, you can update the /etc/waagent.conf file by setting the following three parameters:

    ResourceDisk.Format=y
    ResourceDisk.EnableSwap=y
    ResourceDisk.SwapSizeMB=xx


    Where the size is in MB, so for instance, to create a SWAP file of 4GB you could use these lines:

    ResourceDisk.Format=y
    ResourceDisk.EnableSwap=y
    ResourceDisk.SwapSizeMB=4096

    Before creating a SWAP file using the WAAgent, we also recommend looking at how much space you have available for the temporary disk by checking this link where on each category of VM we display the local SSD or local HDD storage available.

    References:

    How to add a swap file in Linux Azure virtual machines

    Optimizing your Linux VM on Azure

    Continue reading...
     
Thread Status:
Not open for further replies.

Share This Page

LiveZilla Live Chat Software