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
def InstrumentizeProcess(my_manager, pruned_GN_Nodes, pruned_MP_Nodes, pKey, gn_ms_proxycert_file, gn_ms_proxykey_file, mp_blipp_proxycert_file, mp_blipp_proxykey_file, USERURN, email_id, SLICEURN, slice_uuid, unis_topo, q): # This lock will also install sftware needed for Passive measurements on GN which cannot be done in parallel # with any other operations (status, msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0], "install_lock", pKey) if (not status): msg = msg + "\nConfiguring next AM if available" gemini_util.write_to_log(msg, gemini_util.printtoscreen) q.put("done_flag") return else: gemini_util.write_to_log(msg, gemini_util.printtoscreen) # This lock will just set a flag on the GN to indicate the beginning of the configuration process (status, msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0], "instrument_lock", pKey) if (not status): msg = msg + "\nConfiguring next AM if available" gemini_util.write_to_log(msg, gemini_util.printtoscreen) q.put("done_flag") else: gemini_util.write_to_log(msg, gemini_util.printtoscreen) (status, msg) = gemini_util.update_Drupaladmin_acctinfo(pruned_GN_Nodes[0], pKey) if (not status): msg = msg + "\nERROR @ {" + my_manager + "} :: Problem updating Drupal Admin AccInfo\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg, gemini_util.printtoscreen) sys.exit(1) msg = "Installing and configuring MP Nodes for Passive Measurements at " + my_manager gemini_util.write_to_log(msg, gemini_util.printtoscreen) gemini_util.InstallMP_Passive(pruned_MP_Nodes, pruned_GN_Nodes[0], pKey) msg = "Starting Passive Measurements Data Collection for MP Nodes at " + my_manager gemini_util.write_to_log(msg, gemini_util.printtoscreen) (status, msg) = gemini_util.startStatscollection(pruned_GN_Nodes[0], pKey) if (not status): msg = msg + "\nERROR @ {" + my_manager + "} :: Problem starting Passive measurement data collection\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg, gemini_util.printtoscreen) sys.exit(1) gemini_util.do_netflow_stuff(pruned_GN_Nodes[0], 'init', pKey) # gemini_util.do_netflow_stuff(pruned_GN_Nodes[0],'start',keyfile) gemini_util.vnc_passwd_create(pruned_MP_Nodes, pruned_GN_Nodes[0], pKey) gemini_util.drupal_account_create(pruned_GN_Nodes[0], pKey) if (not gemini_util.DISABLE_ACTIVE): msg = "Installing Proxy Certificates for nodes at " + my_manager gemini_util.write_to_log(msg, gemini_util.printtoscreen) gemini_util.install_GN_Certs(pruned_GN_Nodes, pKey, gn_ms_proxycert_file, gn_ms_proxykey_file) gemini_util.install_MP_Certs(pruned_MP_Nodes, pKey, mp_blipp_proxycert_file, mp_blipp_proxykey_file) if (not gemini_util.DISABLE_ACTIVE): msg = "Creating BLiPP service configurations, sending to UNIS for nodes at " + my_manager gemini_util.write_to_log(msg, gemini_util.printtoscreen) gemini_util.createBlippServiceEntries(pruned_MP_Nodes, pruned_GN_Nodes[0], unis_topo[my_manager], slice_uuid) msg = "Installing and configuring MP Nodes for Active Measurements at " + my_manager gemini_util.write_to_log(msg, gemini_util.printtoscreen) #gemini_util.install_Active_measurements(pruned_MP_Nodes,pruned_GN_Nodes[0],USERURN,SLICEURN,slice_uuid,unis_topo[my_manager],LAMPCERT,pKey) gemini_util.install_Active_measurements(pruned_MP_Nodes, pruned_GN_Nodes[0], USERURN, SLICEURN, slice_uuid, unis_topo[my_manager], pKey) gemini_util.initialize_Drupal_menu(pruned_GN_Nodes[0], pKey) # This is just to make sure we have the right user info who instrumented the slice # A scenario here is in case of a shared slice where one user initializes the slice and another instruments it. (result, msg) = gemini_util.dump_Expinfo_on_GN(pruned_GN_Nodes[0], USERURN, email_id, '', '', '', '', '', '', pKey) # Unlock the GN (status, msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0], "instrument_unlock", pKey) if (not status): msg = msg + "\nERROR @ {" + my_manager + "} :: Problem unlocking\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg, gemini_util.printtoscreen) sys.exit(1) return
def InstrumentizeProcess(my_manager,pruned_GN_Nodes,pruned_MP_Nodes,pKey,gn_ms_proxycert_file,gn_ms_proxykey_file,mp_blipp_proxycert_file,mp_blipp_proxykey_file,USERURN,email_id,SLICEURN,slice_uuid,unis_topo,q): # This lock will also install sftware needed for Passive measurements on GN which cannot be done in parallel # with any other operations (status,msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0],"install_lock",pKey) if(not status): msg = msg + "\nConfiguring next AM if available" gemini_util.write_to_log(msg,gemini_util.printtoscreen) q.put("done_flag") return else: gemini_util.write_to_log(msg,gemini_util.printtoscreen) # This lock will just set a flag on the GN to indicate the beginning of the configuration process (status,msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0],"instrument_lock",pKey) if(not status): msg = msg + "\nConfiguring next AM if available" gemini_util.write_to_log(msg,gemini_util.printtoscreen) q.put("done_flag") else: gemini_util.write_to_log(msg,gemini_util.printtoscreen) (status,msg) = gemini_util.update_Drupaladmin_acctinfo(pruned_GN_Nodes[0],pKey) if(not status): msg = msg + "\nERROR @ {"+my_manager+"} :: Problem updating Drupal Admin AccInfo\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg,gemini_util.printtoscreen) sys.exit(1) msg = "Installing and configuring MP Nodes for Passive Measurements at "+my_manager gemini_util.write_to_log(msg,gemini_util.printtoscreen) gemini_util.InstallMP_Passive (pruned_MP_Nodes,pruned_GN_Nodes[0],pKey) msg = "Starting Passive Measurements Data Collection for MP Nodes at "+my_manager gemini_util.write_to_log(msg,gemini_util.printtoscreen) (status,msg) = gemini_util.startStatscollection(pruned_GN_Nodes[0],pKey) if(not status): msg = msg + "\nERROR @ {"+my_manager+"} :: Problem starting Passive measurement data collection\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg,gemini_util.printtoscreen) sys.exit(1) gemini_util.do_netflow_stuff(pruned_GN_Nodes[0],'init',pKey) # gemini_util.do_netflow_stuff(pruned_GN_Nodes[0],'start',keyfile) gemini_util.vnc_passwd_create(pruned_MP_Nodes,pruned_GN_Nodes[0],pKey) gemini_util.drupal_account_create(pruned_GN_Nodes[0],pKey) if(not gemini_util.DISABLE_ACTIVE): msg = "Installing Proxy Certificates for nodes at "+my_manager gemini_util.write_to_log(msg,gemini_util.printtoscreen) gemini_util.install_GN_Certs(pruned_GN_Nodes,pKey,gn_ms_proxycert_file,gn_ms_proxykey_file) gemini_util.install_MP_Certs(pruned_MP_Nodes,pKey,mp_blipp_proxycert_file,mp_blipp_proxykey_file) if(not gemini_util.DISABLE_ACTIVE): msg = "Creating BLiPP service configurations, sending to UNIS for nodes at "+my_manager gemini_util.write_to_log(msg,gemini_util.printtoscreen) gemini_util.createBlippServiceEntries(pruned_MP_Nodes,pruned_GN_Nodes[0],unis_topo[my_manager],slice_uuid) msg = "Installing and configuring MP Nodes for Active Measurements at "+my_manager gemini_util.write_to_log(msg,gemini_util.printtoscreen) #gemini_util.install_Active_measurements(pruned_MP_Nodes,pruned_GN_Nodes[0],USERURN,SLICEURN,slice_uuid,unis_topo[my_manager],LAMPCERT,pKey) gemini_util.install_Active_measurements(pruned_MP_Nodes,pruned_GN_Nodes[0],USERURN,SLICEURN,slice_uuid,unis_topo[my_manager],pKey) gemini_util.initialize_Drupal_menu(pruned_GN_Nodes[0],pKey) # This is just to make sure we have the right user info who instrumented the slice # A scenario here is in case of a shared slice where one user initializes the slice and another instruments it. (result,msg) = gemini_util.dump_Expinfo_on_GN(pruned_GN_Nodes[0],USERURN,email_id,'','','','','','',pKey) # Unlock the GN (status,msg) = gemini_util.lock_unlock_MC(pruned_GN_Nodes[0],"instrument_unlock",pKey) if(not status): msg = msg + "\nERROR @ {"+my_manager+"} :: Problem unlocking\nYour Gemini configuration will not work\nPlease abort and contact GEMINI Dev Team for help\n" gemini_util.write_to_log(msg,gemini_util.printtoscreen) sys.exit(1) return
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