What is the purpose of 'Reservations' in Amazon EC2 -
i'm starting explore amazon ec2. , want hear explanations or may brief examples of how , why need 'reservations' in amazon ec2. i'm using python framework boto manage amazon service. , far don't see reasons why have step in order instances, example:
reservations = ec2.get_all_instances() instances = [instance res in reservations instance in res.instances] that's how instances, times this:
reservation = ec2.run_instances(image_id, min_count, max_count, key_name .....) instance = reservation.instances[0] and use instances attach volumes, add tags, add security groups , on.... purpose of boto.ec2.instance.reservation (i'm not asking boto framework, of course preferred, in whole meaning of in amazon ec2)
>>> reservation = reservations[0] >>> reservation reservation:r-74d11509 >>> dir(reservation) ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'connection', 'endelement', 'groups', 'id', 'instances', 'item', 'owner_id', 'region', 'startelement', 'stop_all'] >>> reservation.__class__ <class 'boto.ec2.instance.reservation'> i couldn't find useful methods. please explain me why need this? what's reason there? in cases use it?
from understanding, reservation act of launching instances. basically, reservation do, while instance get. if launch multiple instances 1 image via run_instances() make 1 reservation, multiple instances.
run_instances reservation.stop_all() allows run bunch of instances, wait them complete task , stop them @ once.
Comments
Post a Comment