Reputation: 1687
I am writing a python script that starts a specific instance that is currently stopped, and I am kind of stumped on how I'd do that. As far as I can understand from the Boto EC2 introduction on launching instances this creates a completely new instance?
conn.run_instances(
'<ami-image-id>',
key_name='myKey',
instance_type='c1.xlarge',
security_groups=['your-security-group-here'])
Code examples would be very welcome!
Upvotes: 8
Views: 9223
Reputation: 8975
You can now start multiple instances in one start_instances
call, e.g.:
conn.start_instances(instance_ids=['instance_id_1', 'instance_id_2',])
Upvotes: 4
Reputation: 1687
I had completely missed this command in the API
For future reference, this is how to start a stopped instance:
instance = conn.get_all_instances(instance_ids=['instance_id'])
print instance[0].instances[0].start()
Upvotes: 11