Monday, December 19, 2016


Serial Console Access over SSH
iDrac already provides console access via SSH as per the diagram below for certain DELL servers. An API service facilitating console access needs to only secure it by allowing the console access on a customer by customer basis and to only his or her servers: 
Image 
Which specifies console redirection over SSH from iDRAC with the following setting: 
# racadm get iDRAC.SSH.Enable 
[Key=iDRAC.Embedded.1#SSH.1] 
Enable=Enabled 
  1. For each console session initiation and termination, we start the console redirection with the following serial console commands: (All serial console commands are identical and at the same level as RACADM CLI subcommands. This means you can specify serial commands as well as racadm commands from the serial/telnet console. 
  1. racadm racreset – this releases the serial port used previously 
  1. connect <servername> -F 
  1. (Instead of <servername> we can specify switch-x where x represents a module slot number on the chassis). When the system BIOS console redirection setting is set to BMC, the –F option forces the serial console redirection session to switch from BMC to DRAC/MgmtConsole. When the system is rebooted, the BIOS console redirection setting returns to the default setting.  
  1. Reboot the target 
  1. <Enter><~><.>  or ^\ to exit out of the session 
  1. getpbinfo (for power status and power information) 
  1. serveraction ( for executing a server reset/powerdown/graceful powerdown/powerdown/powerup/powercycle)
#codingexercise
Cars 1 to 9 are parked randomly in the slots marked 1 to 9. Using the tenth slot, arrange the cars.

void arrange(ref List<int>cars)
{
for (int i = 0; i <cars.count; i ++)
{
if (cars[i] == i) continue;
for (int j =i+1; j < cars.count; j++){
   if (cars[j] == i){
          Swap(cars,i,j);
   }
}
}
}
the above method can be made linear if we maintain a lookup of where the cars can be found.

No comments:

Post a Comment