Ah, forgot to mention, after changing the config file.
run
systemctl restart walinuxagent
to make it take effect, you don't need to restart your VM.
feng <fengnz@gmail.com> 于2019年5月7日周二 下午2:23写道:
Login to your VMRun the following command to edit the config file[bash]sudo vi /etc/waagent.conf[/bash]ResourceDisk.Format=yResourceDisk.EnableSwap=yResourceDisk.SwapSizeMB=4000I set the swap file to 4000M as my vm only 4000M availableuse df -h to check avaialbe disk space on the temp drive /dev/sdb1[bash]df -hFilesystem Size Used Avail Use% Mounted onudev 952M 0 952M 0% /devtmpfs 193M 1.2M 192M 1% /run/dev/sda1 29G 3.1G 26G 11% /tmpfs 964M 992K 963M 1% /dev/shmtmpfs 5.0M 0 5.0M 0% /run/locktmpfs 964M 0 964M 0% /sys/fs/cgroup/dev/sda15 105M 3.6M 101M 4% /boot/efi/dev/sdb1 3.9G 3.9G 0 100% /mnttmpfs 193M 0 193M 0% /run/user/1000/dev/loop0 90M 90M 0 100% /snap/core/6818/dev/loop1 98M 98M 0 100% /snap/docker/372[/bash]Then run free -m to check your new swap file[bash]free -mtotal used free shared buff/cache availableMem: 1927 930 211 1 786 759Swap: 3934 16 3917[/bash]use cat /var/log/waagent.logto check the logif you see the following log, means you need to reduce your swap file size as there is no enough space on the temp drive.
[bash]2019/05/07 02:10:37.103906 INFO Daemon fallocate unsuccessful, falling back to dd2019/05/07 02:11:57.305341 INFO Daemon Azure Linux Agent Version:2.2.32.22019/05/07 02:11:57.344161 INFO Daemon OS: ubuntu 18.042019/05/07 02:11:57.363692 INFO Daemon Python: 3.6.72019/05/07 02:11:57.397202 INFO Daemon Add daemon process pid 31642 to walinuxagent systemd cgroup2019/05/07 02:11:57.425906 INFO Daemon CGroups: ok2019/05/07 02:11:57.496881 INFO Daemon Run daemon2019/05/07 02:11:57.507329 INFO Daemon Activate resource disk2019/05/07 02:11:57.614996 INFO Daemon Resource disk [/dev/sdb1] is already mounted [/mnt]2019/05/07 02:11:57.642478 WARNING Daemon Failed to write data loss warning:[Errno 1] Operation not permitted: '/mnt/DATALOSS_WARNING_README.txt'2019/05/07 02:11:57.670093 INFO Daemon Enable swap2019/05/07 02:11:57.707961 INFO Daemon Remove old swap file2019/05/07 02:11:58.531786 INFO Daemon Create swap file2019/05/07 02:11:58.595572 ERROR Daemon Command: [umask 0077 && fallocate -l 4294967296 '/mnt/swapfile'], return code: [1], result: [fallocate: fallocate failed: No space left on device[/bash]
Feng
没有评论:
发表评论