Skip to content

Instantly share code, notes, and snippets.

@wilrnh
Last active December 17, 2015 02:19
Show Gist options
  • Save wilrnh/5534380 to your computer and use it in GitHub Desktop.
Save wilrnh/5534380 to your computer and use it in GitHub Desktop.
Script to create a ton of EBS volumes (eg for a RAID setup); requires awscli available from pip
for i in {1..8}; do aws ec2 create-volume --availability-zone us-east-1d --size 128 --output text >> _disks; done
(i=0; for d in `awk '{print $4}' _disks`; do i=$((i + 1)); aws ec2 create-tags --resources ${d} --tags '{"key":"Name", "value": "_disks"}'; aws ec2 attach-volume --instance-id i-xxxxxxxx --volume-id ${d} --device /dev/sdg${i}; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment