ECS EBS Volumes

0

I'm trying to downsize the EBS volumes on our ec2 instances used in our ecs cluster. Previously, we would just have one ebs volume /dev/xvda which was encrypted.

I now notice there are two volumes for each ec2 machine /dev/xvda -> encrypted /dev/xvdcz -> not encrypted

Looking at the docs

Amazon ECS-optimized Amazon Linux 2 AMI, your instance has a single 30 GiB volume configured, which is shared between the operating system and Docker.

We are using AMI name: amzn2-ami-ecs-kernel-5.10-hvm-2.0.20240821-x86_64-ebs from https://github.com/aws/amazon-ecs-ami/releases

Is this not a AMI that should only have one ebs volume on it? If not, how do I get xvdcz encrypted?

1 Answer
0

Hello,

  1. Whether the Amazon ECS-optimized Amazon Linux 2 AMI should have only one EBS volume or if the presence of two volumes is expected?

The Amazon ECS-optimized Amazon Linux 2 AMI should have only one EBS volume attached by default. The presence of the second unencrypted volume /dev/xvdcz is unexpected. You can use AWS CloudTrail logs to investigate who created and attached this volume, but only if the volume was created and attached within the last 90 days, or if you have CloudTrail logs stored in an S3 bucket for a longer retention period. If CloudTrail logs are not available or do not cover the relevant time period, there may be no way to confirm who or what created and attached the /dev/xvdcz volume.

API CALLS: CreateVolume, AttachVolume

  1. If two volumes are expected, how to encrypt the /dev/xvdcz volume, as it is currently unencrypted?

If you want to encrypt that volume [/dev/xvdcz], follow the steps provided in the AWS rePost article, where you can find steps to encrypt unencrypted Volume.

  1. How to reduce the size of the EBS volumes, e.g., from 100GB to 80GB?

In AWS there is no way to reduce the size of an existing EBS volume. You can only increase the size of an EBS volume.

profile picture
answered 13 days ago
profile picture
EXPERT
reviewed 13 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions