Ejemplo n.º 1
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
Ejemplo n.º 2
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