Created
April 15, 2013 18:48
-
-
Save drewblas/5390358 to your computer and use it in GitHub Desktop.
Launch an instance with a specific root disk size instead of the default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch an instance with a specific root disk size instead of the default | |
UBUNTU_EBS_IMAGE=ami-d0f89fb9 | |
# New volume size in GB | |
VOLUME_SIZE=30 | |
SNAPSHOT_ID=`ec2-describe-images $UBUNTU_EBS_IMAGE | egrep "^BLOCKDEVICEMAPPING" | cut -f4` | |
ec2-run-instances $UBUNTU_EBS_IMAGE \ # Don't forget all your other normal parameters | |
--block-device-mapping "/dev/sda1=$SNAPSHOT_ID:$VOLUME_SIZE:true:standard" | |
# Ubuntu images on boot will auto-resize their root disk to match the available EBS size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment