March 23rd, 2015

Script for getting AWS drive information

Script for getting AWS drive information
[~]# cat /usr/local/devops/bin/get_aws_drive_info
#!/bin/bash
 
for i in `wget -q -O - http://169.254.169.254/latest/meta-data/block-device-mapping/`; do 
 if [ "$i" == "ami" ] ; then
  continue
 fi
 wget -q -O - http://169.254.169.254/latest/meta-data/block-device-mapping/$i; 
 echo : $i; 
done



Results Example:
[~]# /usr/local/bin/get_aws_drive_info
sdf: ebs1
sdg: ebs2
sdh: ebs3
sdw: ebs4
sdx: ebs5
sdy: ebs6
sdz: ebs7
sdb: ephemeral0
sdc: ephemeral1
/dev/xvda: root