如何启用和使用HP Microserver Gen9的串行terminal?

我有一台HP ProLiant Microserver Gen9。 它具有HP ILO版本4,但是基于Java的远程控制台不能可靠地工作,并且在免费版本的ILO的POST屏幕(要求我购买ILO高级许可证)后无法使用它。 所以我想用串口控制台来获取服务器上的login信息。

在Ubuntu系统上,通过服务器的ILOnetworking端口,在串行控制台中启动过程的所有阶段(POST,BIOSconfiguration,GRUB输出,最终login提示)需要做什么? 我如何连接到它?

HP服务器上的ILO端口默认通过DHCP询问IP。 所以你只需要把它插入一个运行着DHCP服务器的networking。 它将使用一个主机名ILOCZ12345678来宣布自己的名字,如果你在像Ubuntu这样的系统上运行一个DHCP服务器(例如isc-dhcp-server ),它将更容易find你的路由器的DHCP租用表,或者在journalctl / syslog

findIP后(例如1.2.3.4 ),可以通过https://1.2.3.4连接到ILO的GUI界面。 但是这不是我们想要的,我们需要串口控制台。 相反,使用ILO的SSH接口: ssh [email protected] 。 默认密码位于Microserver附带的小纸标签上。

注意这也适用于服务器closures,只要它有一个电源线插入(这是国际劳工组织的观点)。

在那里,input? 看到所有选项。 摘抄:

 POWER : Control server power. UID : Control Unit-ID light. ONETIMEBOOT: Access One-Time Boot setting. NMI : Generate an NMI. VM : Virtual media commands. LANGUAGE : Command to set or get default language VSP : Invoke virtual serial port. TEXTCONS : Invoke Remote Text Console. TESTTRAP : Sends a test SNMP trap to the configured alert destinations. 

我们selectVSP来获得串口; TEXTCONS可能也会很好,但你必须购买高级ILO许可才能使用它。

现在,一旦我们这样做,一个运行系统,它只是挂在

 </>hpiLO-> VSP Virtual Serial Port Active: COM2 Starting virtual serial port. Press 'ESC (' to return to the CLI Session. 

这是因为默认情况下,Ubuntu(我在这里使用16.04)没有通过串口提供login提示。 我们稍后会改变。 首先我们重新启动以查看BIOSconfiguration已经工作。

看到它通过串口启动

在另一个ILO ssh会话中,使用以下命令重启:

 </>hpiLO-> power reset status=0 status_tag=COMMAND COMPLETED Sun Feb 5 20:05:59 2017 Server resetting ....... 

经过一段等待时间,您会注意到VSP正在运行的会话已经清除了其屏幕。

然后出现:

  4096 MB Installed ProLiant System BIOS - J06 (11/02/2015) Copyright 1982, 2015 Hewlett-Packard Development Company, LP 1 Processor(s) detected, 2 total cores enabled, Hyperthreading is not supported Proc 1: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz HP Power Profile Mode: Custom Power Regulator Mode: Dynamic Power Savings Redundant ROM Detected - This system contains a valid backup System ROM. Inlet Ambient Temperature: 18C/64F HP SmartMemory authenticated in all populated DIMM slots. HP AHCI SATA Controller (v0.90) Copyright (c) 2011, Hewlett-Packard Development Company, LP HP AHCI SATA Controller (v0.84) WD30EFRX-68EUZN0 Port3: SMART Capable Hard Disk - WDC WD30EFRX-68EUZN0 Copyright (c) 2011, Hewlett-Packard Development Company, LP <F9 = Setup> iLO 4 Standard iLO 4 v2.50 Sep 23 2016 192.168.178.106 Broadcom NetXtreme Ethernet Boot Agent Copyright (C) 2000-2015 Broadcom Corporation All rights reserved. Press Ctrl-S to enter Configuration Menu 

这是POST屏幕。 稍等一下,看看:

  Press "F9" key for ROM-Based Setup Utility Press "F10" key for Intelligent Provisioning Press "F11" key for Default Boot Override Options Press "F12" key for Network Boot For access via BIOS Serial Console Press "ESC+9" for ROM-Based Setup Utility Press "ESC+0" for Intelligent Provisioning Press "ESC+!" for Default Boot Override Options Press "ESC+@" for Network Boot 

如果你想configurationBIOS,现在是你的时间:这个屏幕只出现1秒左右。 F *键通常不起作用,它们需要被转义:你必须按ESC键,然后按上面所述的数字/符号。 例如ESC ,然后5F5

现在,没有进一步的设置,我们在串行端口得到了静音,因为如上所述,在16.04中,GRUB2和Ubuntuloginterminal都不会默认输出到串行端口。

所以我们configuration服务器(现在通过SSH)来使用串口。

使GRUB2使用串行端口

我按照说明在https://www.hiroom2.com/2016/06/06/ubuntu-16-04-grub2-and-linux-with-serial-console/中更&#x6539;/etc/default/grub-表示用#注释掉行, +表示添加行):

 DEFAULT=0 -GRUB_HIDDEN_TIMEOUT=0 -GRUB_HIDDEN_TIMEOUT_QUIET=true -GRUB_TIMEOUT=10 +GRUB_TIMEOUT=1 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" -GRUB_CMDLINE_LINUX="" +GRUB_CMDLINE_LINUX_DEFAULT="" +GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200" -#GRUB_TERMINAL=console +GRUB_TERMINAL="console serial" +GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" 

10秒的超时设置是因为串行连接非常缓慢地重新绘制屏幕,​​并且我们希望有足够的时间通过按下GRUB中的例如键来取消超时。

按照描述更改文件后,运行sudo update-grub ,然后重启。

在POST屏幕之后,您现在应该在VSP会话中看到以下内容:

 error: serial port `com2' isn't found error: terminal `serial' isn't found error: terminal `serial' isn't found error: no video mode activated 

我们忽略这个(如果你知道如何摆脱这个,请评论)。 经过一段短暂的时间后,

  GNU GRUB version 2.02~beta2-36ubuntu3.6 +----------------------------------------------------------------------------+ |*Ubuntu | | Advanced options for Ubuntu | | Memory test (memtest86+) | | Memory test (memtest86+, serial console 115200) | | | | | +----------------------------------------------------------------------------+ Use the and keys to select which entry is highlighted. Press enter to boot the selected OS, `e' to edit the commands before booting or `c' for a command-line. 

这是一个正常的GRUB屏幕,您可以使用向上和向下键来移动*指针。

使Ubuntulogin使用串行端口

以下几点受到http://0pointer.de/blog/projects/serial-console.html的启&#x53D1;

 sudo cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected] 

现在编辑/etc/systemd/system/[email protected]

改变线

 ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM 

 ExecStart=-/sbin/agetty %I 115200 vt100-nav 

我们特别关心设置模式vt100-nav – 我发现没有这个改变login不会出现。

我不确定为什么我们要在这里使用ttyS1 ,而在GRUB中我们configuration了ttyS0 – 但是在这里我不能使用S0 。 如果有人知道为什么,请评论。

通过以下方式启动tty:

 sudo systemctl start [email protected] 

您现在应该在VSP会话中看到一个login提示。 使用以下命令自动启动:

 sudo systemctl enable [email protected] 

并重新启动。 您现在应该看到VSP所有输出,从POST到GRUB2到login提示。

从ILO ssh接口使用textcons 。 这可能需要国际劳工组织高级许可证,但与此同时,获得国际劳工组织高级许可证的壁垒非常低。

大多数组织对使虚拟串行端口工作不感兴趣,因为这很耗时。

Google获得ILO许可
从HP获得演示许可证
或者只需从亚马逊支付25美元的国际劳工组织密钥

在RHEL7中“错误:未findterminal”串行“是由于Anaconda没有在RAM映像中放置”串行“设备驱动程序。 有可能用丢失的驱动程序重buildRAM磁盘,但Grub似乎没有它的function。