subnet = security_config["Subnet"] lA.testaws() if lD.detect_proxy() and lD.proxy_blocks_22: raise SystemError( "This proxy blocks port 22, that means you can't ssh to your machines to do the initial configuration. To " "skip this check set kavedeploy.proxy_blocks_22 to false and kavedeploy.proxy_port=22") lD.testproxy() instancetype = lA.chooseinstancetype(instancetype) upped = lA.up_os(osval, instancetype, security_group, keypair, subnet=subnet) print "submitted" iid = lA.iid_from_up_json(upped)[0] import time time.sleep(5) lA.name_resource(iid, machinename) ip = lA.pub_ip(iid) acount = 0 while (ip is None and acount < 20): print "waiting for IP" lD.mysleep(1) ip = lA.pub_ip(iid) acount = acount + 1 if osval == "Centos6":
for instancegroup in cluster_config["InstanceGroups"]: count = instancegroup["Count"] autoname = True if count < 0: count = 1 autoname = False if count == 0: continue up = lA.up_default(type=lA.chooseinstancetype( instancegroup["InstanceType"]), security_group=security_group, keys=amazon_keypair_name, count=count, subnet=subnet) instancegroups[instancegroup["Name"]] = lA.iid_from_up_json(up) instance_to_remote = {} print "Created IIDs:", instancegroups print "====================================" print "wait for them all to be up" print "====================================" sys.stdout.flush() import time time.sleep(5) for k, ig in instancegroups.iteritems(): for iid in ig: ip = None
################################################## # Create machine ################################################## print "upping new", instancetype if lD.detect_proxy() and lD.proxy_blocks_22: raise SystemError( "This proxy blocks port 22, that means you can't ssh to your machines to do the initial configuration. To " "skip this check set kavedeploy.proxy_blocks_22 to false and kavedeploy.proxy_port=22" ) lD.testproxy() upped = lA.up_default(instancetype, security_group, keypair, subnet=subnet) print "submitted" iid = lA.iid_from_up_json(upped)[0] import time time.sleep(5) lA.name_resource(iid, username + "_dev_box") ip = lA.pub_ip(iid) acount = 0 while (ip is None and acount < 20): print "waiting for IP" lD.mysleep(1) ip = lA.pub_ip(iid) acount = acount + 1 remoteuser = lA.default_usernamedict[lA.default_os] remote = lD.remoteHost(remoteuser, ip, keyloc) print "waiting until contactable"
print "up the instance groups" print "====================================" sys.stdout.flush() for instancegroup in cluster_config["InstanceGroups"]: count = instancegroup["Count"] autoname = True if count < 0: count = 1 autoname = False if count == 0: continue up = lA.up_default(type=lA.chooseinstancetype(instancegroup["InstanceType"]), security_group=security_group, keys=amazon_keypair_name, count=count, subnet=subnet) instancegroups[instancegroup["Name"]] = lA.iid_from_up_json(up) instance_to_remote = {} print "Created IIDs:", instancegroups print "====================================" print "wait for them all to be up" print "====================================" sys.stdout.flush() import time time.sleep(5) for k, ig in instancegroups.iteritems(): for iid in ig: ip = None