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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ