Identifying EC2 Instance Store Volumes

0

A customer wants to find an automated way to identify EC2 Instance Store Volumes for a fleet of their Linux instances. Is there a way to do so that doesn't require logon to each Linux instance?

AWS
질문됨 5년 전271회 조회
1개 답변
0
수락된 답변

Hi,

One way is to use the instance metadata service, but that would rely on connecting to each instance in turn. However, we know that the block device mapping can tell us if a volume is EBS-based or instance store-based. If a volume is instance store based, then the mapping will name it ephemeral[0-23], for example ephemeral4. Outside of logging on to an instance, we can use the EC2 API to get the block device mappings, a little like so:

ec2 describe-instances

will return you a list of Instance IDs, which you can then pass in (using a loop, likely best) to:

ec2 describe instance-attribute --attribute block-device-mapping --instance-id $id

It shouldn't be too hard to polish that in to a nice bit of Bash etc. you can run on a loop.

AWS
전문가
답변함 5년 전

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

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

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

관련 콘텐츠