linux add swap,How to: Add SWAP to Linux VM's on Azure

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

04/10/2017

2 分钟可看完

本文内容

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:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值