/usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: checkyesno: ec2_ephemeralswap_enable is set to YES. /usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: checkyesno: ec2_ephemeralswap_enable is set to YES. /usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: run_rc_command: doit: : /usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: checkyesno: ec2_ephemeralswap_enable is set to YES. /usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: run_rc_command: doit: ec2_ephemeralswap_run expr: syntax error [: -lt: unexpected operator /usr/local/etc/rc.d/ec2_ephemeralswap: DEBUG: EC2 ephemeral disks are No ephemeral disks are available, so no swap space is being created. This is caused around line 54 since after FreeBSD 11, SWZONESTRUCTS is always empty. `vmstat -z` no longer returns SWAPMETA. > SWZONESTRUCTS=`vmstat -z | tr -d , | awk '/^SWAPMETA/ { print $3 }'` Probably the script should refer `swblk` instead. See also what's changed in sys/vm/swap_pager.c between FreeBSD 10 and 11.
Oops, I meant to fix this a long time ago. There will be other changes needed too. For now I'm just going to disable this script.
A commit references this bug: Author: cperciva Date: Wed Jan 9 03:55:26 UTC 2019 New revision: 342875 URL: https://svnweb.freebsd.org/changeset/base/342875 Log: Turn off ec2_ephemeralswap for now This script broke around FreeBSD 11.0 as a result of SWAPMETA no longer being reported by vmstat -z; but it also needs to be reworked due to the arrival in EC2 of nvme ephemeral disks. I'll turn this option back on after I've found time to rewrite the script in question. PR: 234686 Reported by: meta@ MFC after: 1 week Changes: head/release/tools/ec2.conf
Do you have any plans to publish the repository of the scripts? For example, on GitHub or something like that. Then I can help you to develop it.
Good point. I've uploaded the code here: https://github.com/cperciva/ec2-scripts
(In reply to Colin Percival from comment #4) Thanks!
As Colin mentioned there is also the issue of the new nvme ephemeral disks, which increase the challenge of identification since they use the same device names as EBS. $ fetch -qo - http://169.254.169.254/latest/meta-data/block-device-mapping ami ebs2 $ dmesg | egrep nvme nvme0: <Generic NVMe Device> mem 0xfebf0000-0xfebf3fff irq 11 at device 4.0 on pci0 nvme1: <Generic NVMe Device> mem 0xfebf8000-0xfebfbfff irq 10 at device 30.0 on pci0 nvme2: <Generic NVMe Device> mem 0xfebfc000-0xfebfffff,0xfe900000-0xfe901fff at device 31.0 on pci0 The only difference I found is in the device description: $ dmesg | grep nvd nvd0: <Amazon Elastic Block Store> NVMe namespace nvd0: 10240MB (20971520 512 byte sectors) nvd1: <Amazon Elastic Block Store> NVMe namespace nvd1: 51200MB (104857600 512 byte sectors) nvd2: <Amazon EC2 NVMe Instance Storage> NVMe namespace nvd2: 95367MB (195312500 512 byte sectors) Best, Chuck
A commit references this bug: Author: cperciva Date: Wed Jan 16 01:32:42 UTC 2019 New revision: 343070 URL: https://svnweb.freebsd.org/changeset/base/343070 Log: MFC r342875: Turn off ec2_ephemeralswap for now PR: 234686 Changes: _U stable/12/ stable/12/release/tools/ec2.conf
nvmecontrol provides a means to identify instance storage devices. # nvmecontrol devlist | grep 'Instance Storage' nvme2: Amazon EC2 NVMe Instance Storage