How to edit boto for ec2, if we want to use big size of root

56 views
Skip to first unread message

wholanda Edwart

unread,
Sep 30, 2014, 3:26:35 AM9/30/14
to ansible...@googlegroups.com
Guys,
I can use boto to create instance, but my problem, i dont know how to add tag when use it & get ip address.
If i use ansible, i can give tag name & get ip address of new instance, but the problem the default of root size is 8GB.
How can i add my python file to create instance in ansible/ edit ec2 in ansible?
Thx.

PS: this my python file to create instance:

#!/usr/bin/python
import boto.ec2
conn = boto.ec2.connect_to_region("ap-southeast-1",
aws_access_key_id='youraccesskey',
aws_secret_access_key='yoursecretaccesskey')
dev_sda1 = boto.ec2.blockdevicemapping.EBSBlockDeviceType()
dev_sda1.size = 150 # change root volume to 100GB instead of default 8gb
bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping()
bdm['/dev/sda1'] = dev_sda1
reservation = conn.run_instances(
        'ami-085b155a',
        key_name='yourkeyname',
        instance_type='m3.large',
        security_groups=['yoursecgroupname'],
        block_device_map = bdm)

Michael DeHaan

unread,
Oct 1, 2014, 8:17:14 AM10/1/14
to ansible...@googlegroups.com
Start here for basic info and let us know if you have specific questions:



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0c5a68c7-8e26-43dd-b224-ec887f58e098%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages