(qty)
return launched_instances
Launches QTY instances and returns the instance objects.
Launches QTY instances and returns the instance objects.
Launches QTY instances and returns the instance objects .
def launch_instances(qty):
    """Launches QTY instances and returns the instance objects."""
    best_az = pricing_util.get_best_az()
    launched_instances = []
    print "Best availability zone:", best_az.name

    for idx in range(qty):
        print '>> Launching instance #%s' % idx
        si = AWSSpotInstance(best_az.region, best_az.name, uconf.INSTANCE_TYPES[0], uconf.AMI_ID, uconf.BID)
        si.request_instance()
        try:
            si.get_ip()
        except SpotConstraintException, e:
            print(">> ", e.message)
            si.cancel_spot_request()
            continue
        launched_instances.append(si)

    return launched_instances
def launch_instances ( qty ) : best_az = pricing_util . get_best_az ( ) launched_instances = [ ] print "Best availability zone:" , best_az . name for idx in range ( qty ) : print '>> Launching instance #%s' % idx si = AWSSpotInstance ( best_az . region , best_az . name , uconf . INSTANCE_TYPES [ 0 ] , uconf . AMI_ID , uconf . BID ) si . request_instance ( ) try : si . get_ip ( ) except SpotConstraintException , e : print ( ">> " , e . message ) si . cancel_spot_request ( ) continue launched_instances . append ( si ) return launched_instances