Beispiel #1
0
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"
lD.wait_until_up(remote, 20)
remote = lD.remote_cp_authkeys(remote, 'root')
if "Tags" in security_config:
    resources = lA.find_all_child_resources(iid)
    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":
    remoteuser = '******'
else:
    remoteuser = ''.join([i for i in osval if not i.isdigit()]).lower()

if os.path.exists(os.path.realpath(os.path.expanduser(keyloc))):
Beispiel #3
0
    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

remoteuser = lA.default_usernamedict[osval]

if os.path.exists(os.path.realpath(os.path.expanduser(keyloc))):
    print "waiting until contactable, ctrl-C to quit"
    try:
        remote = lD.remoteHost(remoteuser, ip, keyloc)
Beispiel #4
0
print "===================================="
print "name the instances"
print "===================================="
sys.stdout.flush()
instance_to_name = {}

for instancegroup in cluster_config["InstanceGroups"]:
    count = instancegroup["Count"]
    autoname = True
    if count < 0:
        autoname = False
    if not autoname:
        instance_to_name[instancegroups[instancegroup["Name"]]
                         [0]] = instancegroup["Name"].lower()
        lA.name_resource(instancegroups[instancegroup["Name"]][0],
                         cluster_name + '-' + instancegroup["Name"])
        continue
    for num, instance in enumerate(instancegroups[instancegroup["Name"]]):
        instance_to_name[instance] = (instancegroup["Name"] +
                                      ("-%03d" % (num + 1))).lower()
        lA.name_resource(
            instance,
            cluster_name + '-' + instancegroup["Name"] + ("-%03d" % (num + 1)))

# Also name the attached volumes
for instance, iname in instance_to_name.iteritems():
    idesc = lA.desc_instance(instance)
    vols = idesc["Reservations"][0]["Instances"][0]["BlockDeviceMappings"]
    for v in vols:
        if "Ebs" in v and "DeviceName" in v:
            lA.name_resource(
Beispiel #5
0
##################################################

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"
lD.wait_until_up(remote, 20)
remote = lD.remote_cp_authkeys(remote, 'root')
if "Tags" in security_config:
    resources = lA.find_all_child_resources(iid)
Beispiel #6
0
lD.confsshpermissions(allremotes)

print "===================================="
print "name the instances"
print "===================================="
sys.stdout.flush()
instance_to_name = {}

for instancegroup in cluster_config["InstanceGroups"]:
    count = instancegroup["Count"]
    autoname = True
    if count < 0:
        autoname = False
    if not autoname:
        instance_to_name[instancegroups[instancegroup["Name"]][0]] = instancegroup["Name"].lower()
        lA.name_resource(instancegroups[instancegroup["Name"]][0], cluster_name + '-' + instancegroup["Name"])
        continue
    for num, instance in enumerate(instancegroups[instancegroup["Name"]]):
        instance_to_name[instance] = (instancegroup["Name"] + ("-%03d" % (num + 1))).lower()
        lA.name_resource(instance, cluster_name + '-' + instancegroup["Name"] + ("-%03d" % (num + 1)))

# Also name the attached volumes
for instance, iname in instance_to_name.iteritems():
    idesc = lA.desc_instance(instance)
    vols = idesc["Reservations"][0]["Instances"][0]["BlockDeviceMappings"]
    for v in vols:
        if "Ebs" in v and "DeviceName" in v:
            lA.name_resource(v["Ebs"]["VolumeId"], cluster_name + '-' + iname + v["DeviceName"].replace("/", "_"))

# TODO: use a proper dns configuration here instead of writing into the host file
print "=============================================="
Beispiel #7
0
if iid is None:
    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, "new-dev-image")
    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"
    lD.wait_until_up(remote, 20)
    remote = lD.remote_cp_authkeys(remote, 'root')
    if "Tags" in security_config:
        resources = lA.find_all_child_resources(iid)