简体   繁体   中英

EC2 instance - attach ephemeral drives on launch

I am trying to attach the ephemeral partitions on my ec2 instances using boto.

I have tried that with AWS tools and worked:

./ec2-run-instances ami-018c9568 --instance-type m2.4xlarge --availability-zone us-east-1a -n 1 -k my_keypair -g sg-11111111 -b "/dev/xvdb=ephemeral0" -b "/dev/xvdc=ephemeral1" -b "/dev/xvdd=ephemeral2" -b "/dev/xvde=ephemeral3"

When I try it with boto it doesn't work:

mapping = BlockDeviceMapping() eph0 = BlockDeviceType() eph1 = BlockDeviceType() eph2 = BlockDeviceType() eph3 = BlockDeviceType() eph0.ephemeral_name = 'ephemeral0' eph1.ephemeral_name = 'ephemeral1' eph2.ephemeral_name = 'ephemeral2' eph3.ephemeral_name = 'ephemeral3' mapping['/dev/xvdb'] = eph0 mapping['/dev/xvdc'] = eph1 mapping['/dev/xvdd'] = eph2 mapping['/dev/xvde'] = eph3

It is correct. I was experimenting with instance type with a single ephemeral (I thought it had two). Hope it helps other people.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM