Esempio n. 1
0
 try:   
     tester.authorize_group(group_name=group.name )
     tester.authorize_group(group_name=group.name, port=-1, protocol="icmp" )
 except Exception,e :
     print str(e)
     group.delete()
     continue
 ### Create keypair
 try:
     keypair = tester.add_keypair(options.prefix + "-" + str(time.time()))
 except Exception,e :
     print str(e)
     continue
               
 ### RUN INSTANCE AND WAIT FOR IT TO GO TO RUNNING
 tester.tee( "Sending request for " + str(available) + " " + options.type + " VMs")
 
 try:
     reservation = tester.run_instance(image,keypair=keypair.name, group=group.name ,min=available, max=available,type=options.type )
     current_reservation = reservation
 except Exception, e:
     tester.fail("Failed launching instance")
                   
 keypath = pwd + "/" + keypair.name + ".pem" 
 
 ### Some hypervisors will require a few seconds after "running" state for instance to boot
 tester.sleep(15)
 
 ### Log into each instance
 volumes = []
 for instance in reservation.instances: