registerFunction("setHostMapping"); $xajax->registerFunction("errorBack"); session_start(); $user = $_SESSION['user']; $in_xAjax = false; $xAjax_objResponse; include('IOB_inc.htm'); include('common_admin_inc.htm'); // Note: This must be here to beable to use the error_handler // Debug function for testing the xajax error handling. // I am leaving this in for now for future testing. function errorBack( $aError ) { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // $save_error_handler = set_error_handler("xAjax__errorHandler"); $ret = error_back( $aError ); // $save_error_handler = set_error_handler("errorHandler"); // restore_error_handler(); error_log("We have returned from the call to error_back with a '". $ret ."'"); $in_xAjax = false; return $xAjax_objResponse; } // The php function that is called from JavaScript tough xAjax when the user selects a Host and presses apply. function setHostMapping($aEnabled) { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; error_log("Calling set_host_mapping_enabled( $user, $aEnabled );"); set_host_mapping_enabled( $user, ($aEnabled == 'false' ? false:true) ); $in_xAjax = false; return $xAjax_objResponse; } $xajax->processRequest(); /*******************************************************************************************/ // Handle the progress screen if opened and get the NEW data if ($_SERVER[REQUEST_METHOD] == "POST") { $operationInProgress = true; $status = new ReturnStatus(); $theOp = $_POST['operation']; $theBlade = $_POST['bladeId']; $thePort = $_POST['bladePort']; $thePortId = $_POST['portId']; error_log("\n\nDoing operation ". $theOp ." on blade '". $theBlade ."' port '". $thePort ."' and portId '".$thePortId."'\n\n" ); switch( $theOp ) { case 'op_identify': identify_blade( $user, $theBlade ); break; case 'op_powercycle': power_cycle_blade( $user, $theBlade ); break; case 'op_poweron': set_blade_power( $user, $theBlade, true ); break; case 'op_poweroff': set_blade_power( $user, $theBlade, false ); break; case 'op_resetport': // Becasue of a BUG in the 7404 were the Blkade can report itself as ready but the call to get the ports hangs // The portID being passed in is no longer used - by will probaly go back to the original way when the bug is // fixed in the 7404. So I left the original code in also. When the Bug is fixed all you need to do to go back // to the original way is: // 1) Delete this port code and use the one from $_POST['portId'] above. // 2) Comment back out the line $_bLoadPorts = false; below. // Get the portID $myPorts = get_blade_ports($user, $theBlade ); //error_log("get_blade_ports = ". print_r($myPorts, true) ); //error_log("myPorts[$thePort -1] = ". print_r($myPorts[$thePort -1], true) ); $thePortId = $myPorts[$thePort -1]->id; error_log("The Port Id = $thePortId"); reset_blade_port( $user, $thePortId ); break; case 'op_remove': remove_blade( $user, $theBlade ); break; case 'op_hostMapping': // Tis was already Done with Ajax. But becasue of the issue about not being able to get ports // form a blade that is not ready. We need this to bring up the Progress window spo the page // will reload. Hindsight being 20/20 I would have not implemtned this with Ajax had I known // We would have needed to bring up the progress window. break; } print $status->out(); return; } $bEnableHostMapping = get_host_mapping_enabled($user); ?> printJavascript(); ?> Blade Host Mapping
Setup - Blade Control
Set the Blade Control Settings.


No blades were found in the library.
>  Enable Host Mapping
 
Please select an operation on an I/O Blade or Port.
id; $port=1; $checked = "checked"; $bladeNum = 1; foreach ($iobs as $blade) { ?>
I/O Blade Status Identify Blade Blade Power Remove Reset Ports
location ?> status] ?> status != 6 ? 'disabled' : ''); ?> > Reset Port    >