nh2*_*nh2 8 serial ilo hp-proliant ubuntu-16.04
我有一台 HP ProLiant Microserver Gen9。它具有 HP ILO 版本 4,但基于 Java 的远程控制台不能可靠地工作,而且我无法在 ILO 免费版本的 POST 屏幕后使用它(要求我购买 ILO 高级许可证)。所以我想改用串行控制台来登录服务器。
我必须在 Ubuntu 系统上做什么才能通过服务器的 ILO 网络端口在串行控制台中获取引导过程的所有阶段(POST、BIOS 配置、GRUB 输出、最终登录提示)?我如何连接到它?
nh2*_*nh2 14
默认情况下,HP 服务器上的 ILO 端口通过 DHCP 请求 IP。因此,您只需将其插入运行有 DHCP 服务器的网络即可。它会用一个主机名来宣布自己,这样ILOCZ12345678应该更容易在路由器的 DHCP 租用表中找到,或者在例如journalctl/syslog如果您isc-dhcp-server在像 Ubuntu 这样的系统上运行 DHCP 服务器(例如)。
找到 IP 后(比如1.2.3.4),您可以通过 连接到 ILO 的 GUI 界面https://1.2.3.4。但这不是我们要找的,我们想要串行控制台。因此,请改用 ILO 的 SSH 接口:ssh Administrator@1.2.3.4. 默认密码在 Microserver 附带的小纸标签上。
请注意,这在服务器关闭时也有效,只要它有一根电源线插入其中(这是 ILO 的重点)。
在那里,键入?以查看所有选项。摘抄:
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.
Run Code Online (Sandbox Code Playgroud)
我们选择VSP获取串口;TEXTCONS可能也不错,但是您必须购买 Advanced ILO 许可证才能使用它。
现在,一旦我们这样做了,对于一个正在运行的系统,它就会挂在
</>hpiLO-> VSP
Virtual Serial Port Active: COM2
Starting virtual serial port.
Press 'ESC (' to return to the CLI Session.
Run Code Online (Sandbox Code Playgroud)
那是因为默认情况下,Ubuntu(我在这里使用 16.04)不会通过串行端口提供登录提示。我们稍后会更改。首先,我们重新启动以查看 BIOS 配置已经有效。
在另一个 ILO ssh 会话中,使用以下命令重新启动:
</>hpiLO-> power reset
status=0
status_tag=COMMAND COMPLETED
Sun Feb 5 20:05:59 2017
Server resetting .......
Run Code Online (Sandbox Code Playgroud)
等待一段时间后,您会注意到VSP正在运行的会话已清除其屏幕。
然后出现:
4096 MB Installed
ProLiant System BIOS - J06 (11/02/2015)
Copyright 1982, 2015 Hewlett-Packard Development Company, L.P.
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, L.P.
HP AHCI SATA Controller (v0.84) WD30EFRX-68EUZN0
Port3: S.M.A.R.T Capable Hard Disk - WDC WD30EFRX-68EUZN0
Copyright (c) 2011, Hewlett-Packard Development Company, L.P.
<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
Run Code Online (Sandbox Code Playgroud)
那是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
Run Code Online (Sandbox Code Playgroud)
如果您想配置 BIOS,现在是时候了:此屏幕仅出现 1 秒钟左右。F* 键通常不起作用,它们需要被转义:您实际上必须按下该ESC键,然后按下上面所说的数字/符号。例如ESC,然后5是为F5。
现在,无需进一步设置,我们在串口处获得静音,因为如上所述,GRUB2 和 Ubuntu 登录终端都默认输出到 16.04 中的串口。
因此,我们将服务器(现在通过 SSH)配置为使用串行端口。
我按照https://www.hiroom2.com/2016/06/06/ubuntu-16-04-grub2-and-linux-with-serial-console/ 上的说明进行了更改/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"
Run Code Online (Sandbox Code Playgroud)
设置 10 秒的超时是因为串行连接重绘屏幕非常缓慢,我们希望有足够的时间能够通过在 GRUB 中按下例如键来取消超时。
按照说明更改文件后,运行sudo update-grub并重新启动。
您现在应该VSP在 POST 屏幕后的会话中看到以下内容:
error: serial port `com2' isn't found
error: terminal `serial' isn't found
error: terminal `serial' isn't found
error: no video mode activated
Run Code Online (Sandbox Code Playgroud)
我们忽略这一点(如果您知道如何摆脱这一点,请发表评论)。很短的时间后,这会出现:
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.
Run Code Online (Sandbox Code Playgroud)
那是一个普通的 GRUB 屏幕,您可以*使用上下键移动指针。
以下位的灵感来自http://0pointer.de/blog/projects/serial-console.html
sudo cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/serial-getty@ttyS1.service
Run Code Online (Sandbox Code Playgroud)
现在编辑/etc/systemd/system/serial-getty@ttyS1.service:
换线
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
Run Code Online (Sandbox Code Playgroud)
到
ExecStart=-/sbin/agetty %I 115200 vt100-nav
Run Code Online (Sandbox Code Playgroud)
我们特别注意设置模式vt100-nav——我发现没有这个更改就不会出现登录名。
我不确定为什么我们必须ttyS1在配置的 GRUB 中使用这里ttyS0- 但S0在这里使用对我来说不起作用。如果有人知道为什么,请发表评论。
通过以下方式启动 tty:
sudo systemctl start serial-getty@ttyS1.service
Run Code Online (Sandbox Code Playgroud)
您现在应该在VSP会话中看到登录提示。使用以下命令在启动时自动执行此操作:
sudo systemctl enable serial-getty@ttyS1.service
Run Code Online (Sandbox Code Playgroud)
并重新启动。您现在应该看到 中的所有输出VSP,从 POST 到 GRUB2 到登录提示。
| 归档时间: |
|
| 查看次数: |
22266 次 |
| 最近记录: |