예제 #1
0
def opStatusProcess(GN_Node, MP_Nodes, pKey, slice_crypt, user_crypt, queue):

    # Check if GD has access to these nodes
    # this will also add access automatically if it does not and let us know
    msg = "Check if GeniDesktop Tool has access to your slivers (and add if needed) at " + GN_Node[
        'gemini_urn_to_monitor']
    gemini_util.write_to_log(msg, gemini_util.printtoscreen)
    (msg, result) = gemini_util.addGDAccesstoSlivers(
        slice_crypt, user_crypt, GN_Node['gemini_urn_to_monitor'], GN_Node,
        MP_Nodes, pKey)
    if (not result):
        queue.put(msg)
        sys.exit(1)

    # extensive check performed once on all nodes
    # split process by filtering nodes based on CM URN
    # grouping GN[cmurn] = MP[cmurn]
    (isdetailcheckRequired, ret_code,
     err_ssh) = gemini_util.isdetailedProbeRequired(GN_Node, pKey)
    if (ret_code == -1):
        msg = "SSH_ERROR - " + err_ssh
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        queue.put(msg)
        sys.exit(1)

    if (isdetailcheckRequired):
        gemini_util.precheckNodes(GN_Node, MP_Nodes, pKey)
    pass

    (init_status, ret_code, err_msg) = gemini_util.getLockStatus(GN_Node, pKey)
    if (ret_code == -1):
        msg = "SSH_ERROR - " + err_msg
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        queue.put(msg)
        sys.exit(1)

    if (init_status == ""):
        init_status = "CREATED"
    elif (not init_status.startswith('IN')):
        gemini_util.write_to_log(init_status, gemini_util.printtoscreen)
        queue.put(init_status)
        sys.exit(1)

    queue.put([GN_Node['nodeid'], init_status])
    return
예제 #2
0
def opStatusProcess(GN_Node,MP_Nodes,pKey,slice_crypt,user_crypt,queue):

	# Check if GD has access to these nodes
	# this will also add access automatically if it does not and let us know 
	msg = "Check if GeniDesktop Tool has access to your slivers (and add if needed) at "+GN_Node['gemini_urn_to_monitor']
	gemini_util.write_to_log(msg,gemini_util.printtoscreen)
	(msg,result) = gemini_util.addGDAccesstoSlivers(slice_crypt,user_crypt,GN_Node['gemini_urn_to_monitor'])
	if(not result):
		queue.put(msg)
		sys.exit(1)

	# extensive check performed once on all nodes 
	# split process by filtering nodes based on CM URN
	# grouping GN[cmurn] = MP[cmurn]
	(isdetailcheckRequired,ret_code,err_ssh) = gemini_util.isdetailedProbeRequired(GN_Node,pKey)
	if(ret_code == -1):
		msg = "SSH_ERROR - "+err_ssh
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		queue.put(msg)
		sys.exit(1)


	if(isdetailcheckRequired):
		gemini_util.precheckNodes(GN_Node,MP_Nodes,pKey)
	pass	


	(init_status,ret_code,err_msg) = gemini_util.getLockStatus(GN_Node,pKey)
	if(ret_code == -1 ):
		msg = "SSH_ERROR - "+err_msg
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		queue.put(msg)
		sys.exit(1)

	if(init_status == ""):
		init_status = "CREATED"
	elif(not init_status.startswith('IN')):
		gemini_util.write_to_log(init_status,gemini_util.printtoscreen)
		queue.put(init_status)
		sys.exit(1)
		

	queue.put([GN_Node['nodeid'],init_status])
	return  
예제 #3
0
def InitProcess(my_manager,pruned_GN_Nodes,pruned_MP_Nodes,USERURN,email_id,user_password_for_drupal,SLICEURN,dpadmin_username,dpadmin_passwd,slice_crypt,pKey):

	# STEP 1: Check nodes for OS Compatibilty
	msg = "Checking if Nodes at AM --> "+my_manager+" for \n"+"1. Check if Global Node Present\n2. Find Nodes to be monitored by GEMINI\n3. OS Compatibility of selected Nodes"
	gemini_util.write_to_log(msg,gemini_util.printtoscreen)
	(result,msg) = gemini_util.precheckNodes(pruned_GN_Nodes[0],pruned_MP_Nodes,pKey)
	if(result):
		msg = "All nodes at AM --> "+my_manager+" are GEMINI capable.\nWill proceed with the GENI Desktop Init Process"
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)

	else:
		msg = "ERROR @ {"+my_manager+"} :: "+msg
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		sys.exit(1)

	(status,msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0],"init_lock",pKey)
	msg = "["+my_manager+"] "+msg
	if(not status):
		msg = msg + "\nConfiguring next AM if available"
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		return
	else:
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)


	#Place on the GN Node - DRUPAL_ADMIN_PASSWORD , userurn , sliceurn , slicename, cmurn, cmhrn , vnc_passwd, topinfo, portal_public_key
	(result,msg) = gemini_util.dump_Expinfo_on_GN(pruned_GN_Nodes[0],USERURN,email_id,user_password_for_drupal,SLICEURN,my_manager,dpadmin_username,dpadmin_passwd,slice_crypt,pKey)
	if(result):
		msg = "GN that monitors MP Nodes at  "+my_manager+" has all the Exp info it needs. Will now proceed with the Initialization process."
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)

	else:
		msg = "GN ERROR @ {"+my_manager+"} :: while placing Exp info "+str(msg)
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		sys.exit(1)

	# STEP 2 : Download Passive measurement scripts and start ssh-key generator on the GN
	# STEP 2b : Save MC public key onto a file pn GN, fetch it from the GN and place it on all MP Nodes
	# STEP 3 : Install Shell in a box on all nodes and generate the Shellinabox config
	(result,msg) = gemini_util.install_keys_plus_shell_in_a_box(pruned_GN_Nodes[0],pruned_MP_Nodes,pKey)
	if(result):
		msg = "All nodes at AM --> "+my_manager+" have been Initialized."
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)

	else:
		msg = "ERROR @ {"+my_manager+"} :: during Initialization "+str(msg)
		gemini_util.write_to_log(msg,gemini_util.printtoscreen)
		sys.exit(1)

	return
예제 #4
0
		my_manager["node_location_array"] = AM_Resources_location
	except xmlrpclib.Fault, e:
		Fatal("Could not get a list of resources: %s" % (str(e)))



	msg = "\n***************************************\n* Original Manifest for this Topology *\n***************************************\n"+str(my_manager["manifest"])+"\n***************************************\n"
	gemini_util.write_to_log(LOGFILE,msg,gemini_util.dontprinttoscreen,debug)
	
# SSH into each node and check if all node OSes are supported
# 
for my_manager in my_managers:

	msg = "Checking if Nodes at AM --> "+my_manager["am_uri"]+" for \n"+"1. Check if Global Node Present\n2. Find Nodes to be monitored by GEMINI\n3. OS Compatibility of selected Nodes\n"
	gemini_util.write_to_log(LOGFILE,msg,gemini_util.printtoscreen,debug)
	(result,my_manager["GN_sliver_urn"],my_manager["GN_isVirtual"],nodes_sliver_urns,msg) = gemini_util.precheckNodes(my_manager["manifest_dom"],my_manager["manifest_version"],my_manager["urn"],username,keyfile,LOGFILE,debug)
	if(result):
		if(my_manager["GN_sliver_urn"] != ""):
			
			msg = "All nodes at AM --> "+my_manager["am_uri"]+" are GEMINI capable.\nWill proceed with the Instumentize Process\n"
			gemini_util.write_to_log(LOGFILE,msg,gemini_util.printtoscreen,debug)
			my_manager["nodes_sliver_urn"] = nodes_sliver_urns
			managers_to_monitor.append(my_manager)
		else:
			msg = "Nothing to monitor at AM --> "+my_manager["am_uri"]+"\n\n"
			gemini_util.write_to_log(LOGFILE,msg,gemini_util.printtoscreen,debug)
			continue

	else:
		msg = "ERROR @ {"+my_manager["am_uri"]+"} :: "+msg+"\nWill terminate now.\n,"
		gemini_util.write_to_log(LOGFILE,msg,gemini_util.printtoscreen,debug)
예제 #5
0
def InitProcess(my_manager, pruned_GN_Nodes, pruned_MP_Nodes, USERURN,
                email_id, user_password_for_drupal, SLICEURN, dpadmin_username,
                dpadmin_passwd, slice_crypt, pKey):

    # STEP 1: Check nodes for OS Compatibilty
    msg = "Checking if Nodes at AM --> " + my_manager + " for \n" + "1. Check if Global Node Present\n2. Find Nodes to be monitored by GEMINI\n3. OS Compatibility of selected Nodes"
    gemini_util.write_to_log(msg, gemini_util.printtoscreen)
    (result, msg) = gemini_util.precheckNodes(pruned_GN_Nodes[0],
                                              pruned_MP_Nodes, pKey)
    if (result):
        msg = "All nodes at AM --> " + my_manager + " are GEMINI capable.\nWill proceed with the GENI Desktop Init Process"
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)

    else:
        msg = "ERROR @ {" + my_manager + "} :: " + msg
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        sys.exit(1)

    (status, msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0], "init_lock",
                                               pKey)
    msg = "[" + my_manager + "] " + msg
    if (not status):
        msg = msg + "\nConfiguring next AM if available"
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        return
    else:
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)

    #Place on the GN Node - DRUPAL_ADMIN_PASSWORD , userurn , sliceurn , slicename, cmurn, cmhrn , vnc_passwd, topinfo, portal_public_key
    (result,
     msg) = gemini_util.dump_Expinfo_on_GN(pruned_GN_Nodes[0], USERURN,
                                           email_id, user_password_for_drupal,
                                           SLICEURN, my_manager,
                                           dpadmin_username, dpadmin_passwd,
                                           slice_crypt, pKey)
    if (result):
        msg = "GN that monitors MP Nodes at  " + my_manager + " has all the Exp info it needs. Will now proceed with the Initialization process."
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)

    else:
        msg = "GN ERROR @ {" + my_manager + "} :: while placing Exp info " + str(
            msg)
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        sys.exit(1)

    # STEP 2 : Download Passive measurement scripts and start ssh-key generator on the GN
    # STEP 2b : Save MC public key onto a file pn GN, fetch it from the GN and place it on all MP Nodes
    # STEP 3 : Install Shell in a box on all nodes and generate the Shellinabox config
    (result, msg) = gemini_util.install_keys_plus_shell_in_a_box(
        pruned_GN_Nodes[0], pruned_MP_Nodes, pKey)
    if (result):
        msg = "All nodes at AM --> " + my_manager + " have been Initialized."
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)

    else:
        msg = "ERROR @ {" + my_manager + "} :: during Initialization " + str(
            msg)
        gemini_util.write_to_log(msg, gemini_util.printtoscreen)
        sys.exit(1)

    return
예제 #6
0
    msg = "\n***************************************\n* Original Manifest for this Topology *\n***************************************\n" + str(
        my_manager["manifest"]) + "\n***************************************\n"
    gemini_util.write_to_log(LOGFILE, msg, gemini_util.dontprinttoscreen,
                             debug)

# SSH into each node and check if all node OSes are supported
#
for my_manager in my_managers:

    msg = "Checking if Nodes at AM --> " + my_manager[
        "am_uri"] + " for \n" + "1. Check if Global Node Present\n2. Find Nodes to be monitored by GEMINI\n3. OS Compatibility of selected Nodes\n"
    gemini_util.write_to_log(LOGFILE, msg, gemini_util.printtoscreen, debug)
    (result, my_manager["GN_sliver_urn"], my_manager["GN_isVirtual"],
     nodes_sliver_urns, msg) = gemini_util.precheckNodes(
         my_manager["manifest_dom"], my_manager["manifest_version"],
         my_manager["urn"], username, keyfile, LOGFILE, debug)
    if (result):
        if (my_manager["GN_sliver_urn"] != ""):

            msg = "All nodes at AM --> " + my_manager[
                "am_uri"] + " are GEMINI capable.\nWill proceed with the Instumentize Process\n"
            gemini_util.write_to_log(LOGFILE, msg, gemini_util.printtoscreen,
                                     debug)
            my_manager["nodes_sliver_urn"] = nodes_sliver_urns
            managers_to_monitor.append(my_manager)
        else:
            msg = "Nothing to monitor at AM --> " + my_manager[
                "am_uri"] + "\n\n"
            gemini_util.write_to_log(LOGFILE, msg, gemini_util.printtoscreen,
                                     debug)