Type of disk attached to an instance

0

Hello. Is there an easy way to find out if the disk attached to an instance is gp2, gp3 or io1? I'd like to know how to do this both from the console and once I'm connected to the instance. The console simply shows:

Root device type			ebs
Root device				/dev/sda1
Block devices				/dev/sda1
					/dev/sdb
Elastic Graphics ID			-
Elastic Inference accelerator ID	-
Capacity Reservation			-
Capacity Reservation Settings		Open
Outpost Arn				-```
3개 답변
3
수락된 답변

Here is a command you can run to show this information. Replace $INSTANCE_ID below with your instance ID.

aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$INSTANCE_ID --query '[Volumes[*].VolumeId,Volumes[*].Attachments[0].InstanceId,Volumes[*].Attachments[0].Device,Volumes[*].VolumeType]' --output text

Each volume attached to the instance will be in a separate column. The row values are the volume ID, instance ID, device attachment, and volume type. For example:

vol-xxxxxxxxxxx   vol-zzzzzzzzz
i-yyyyyyyyy     i-yyyyyyyyy
/dev/xvda       /dev/sdf
gp2     gp3
AWS
전문가
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
  • It worked. Thanks.

1

Hi, good question. You can do this on the new AWS Management console by viewing volumes, where this will list information such as size, volume type, whether the volume is encrypted, which KMS key was used to encrypt the volume, and the specific instance to which it is attached.

Via CLI: describe-volumes

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-describing-volumes.html

jsonc
답변함 2년 전
  • I switched to the new console but, somehow, when I click on the volume, the page goes blank (not sure why). I'll try with a different instance later. (I'm trying not to use the CLI for reasons that would take me a while to explain)

1

To look it up by volume device name (/dev/nvme1n1 in my example), use the following command:

lsblk -P -o SERIAL /dev/nvme1n1 |cut -d "\"" -f 2 | sed "s/vol/vol-/" | xargs aws ec2 describe-volumes --volume-ids --query "Volumes[*].VolumeType" --output text

The command will return the volume type:

gp3
AWS
kdavyd
답변함 2년 전
  • It worked. Thanks.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠