Aller au contenu

EC2#

Retrieve instance store volume information using the AWS CLI#

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-volumes.html

Bash
1
2
3
4
aws ec2 describe-instance-types \
    --filters "Name=instance-type,Values=g5*" "Name=instance-storage-supported,Values=true" \
    --query "InstanceTypes[].[InstanceType, InstanceStorageInfo.TotalSizeInGB]" \
    --output table
Bash
1
2
3
aws ec2 describe-instance-types \
    --filters "Name=instance-type,Values=r5d.4xlarge" \
    --query "InstanceTypes[].InstanceStorageInfo"

Set Up Swap file#

https://repost.aws/knowledge-center/ec2-memory-swap-file

Bash
1
2
3
4
5
dd if=/dev/zero of=/swapfile bs=128M count=32 # the swap file is 4 GB (128 MB x 32)
chmod 600 /swapfile
mkswap /swapfile

echo "/swapfile swap swap defaults 0 0" >> /etc/fstab