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:
- Initial setup follows this configuration: http://www.slac.stanford.edu/grp/cd/soft/unix/EnableSerialConsoleAccessViaSSH.htm
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
- 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.)
- racadm racreset – this releases the serial port used previously
- connect <servername> -F
- (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.
- Reboot the target
- <Enter><~><.> or ^\ to exit out of the session
- getpbinfo (for power status and power information)
- serveraction ( for executing a server reset/powerdown/graceful powerdown/powerdown/powerup/powercycle)
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