Last active
August 29, 2015 14:04
-
-
Save y13i/b75d304362141c2ebbea to your computer and use it in GitHub Desktop.
大量のEBSをつけたインスタンスを起動する
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
block_device_mappings = ("b".."n").map do |name| | |
{ | |
device_name: "/dev/sd#{name}", | |
ebs: { | |
volume_size: 10, | |
delete_on_termination: true, | |
} | |
} | |
end | |
ec2.instances.create( | |
image_id: "ami-87206d86", | |
instance_type: "t2.micro", | |
block_device_mappings: block_device_mappings, | |
key_pair: ec2.key_pairs["aws-yamaguchi_ap-northeast-1"] | |
) | |
# [ec2-user@ip-172-31-23-105 ~]$ lsblk | |
# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | |
# xvda 202:0 0 10G 0 disk | |
# └─xvda1 202:1 0 6G 0 part / | |
# xvdb 202:16 0 10G 0 disk | |
# xvdc 202:32 0 10G 0 disk | |
# xvdd 202:48 0 10G 0 disk | |
# xvde 202:64 0 10G 0 disk | |
# xvdf 202:80 0 10G 0 disk | |
# xvdg 202:96 0 10G 0 disk | |
# xvdh 202:112 0 10G 0 disk | |
# xvdi 202:128 0 10G 0 disk | |
# xvdj 202:144 0 10G 0 disk | |
# xvdk 202:160 0 10G 0 disk | |
# xvdl 202:176 0 10G 0 disk | |
# xvdm 202:192 0 10G 0 disk | |
# xvdn 202:208 0 10G 0 disk | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment