7. Manual Network install of CentOS
7.1. Local Graphical Installation with attached screen
Our first test in network booting the CentOS installer will be done by attaching a keyboard and screen to the compute node. Below is the configuration used to boot locally. It adds two labels to the PXELINUX configuration, one for the installer and one rescue mode.
We have to at least append the inst.repo
kernel option, which sets
the location of our installation source. In our case this will be which
is http://192.168.16.1/CentOS-7-2207-02-x86_64
or
http://master.hpc/CentOS-7-2207-02-x86_64
.
DEFAULT menu
PROMPT 0
MENU TITLE MHPC 2024
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
LABEL installer
kernel centos7/vmlinuz
initrd centos7/initrd.img
append inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64
MENU LABEL CentOS 7 Installer
LABEL rescue
kernel centos7/vmlinuz
initrd centos7/initrd.img
append inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.rescue
MENU LABEL CentOS 7 Rescue
7.2. Remote Text Mode Installation via IPMI Serial Console
Depending on the number of compute nodes you have, it will quickly become tedious to install each of them with a real screen attached. The serial console over IPMI allows you to remote control this process in text mode.
Add the console=tty0 console=ttyS1,115200n8
as kernel parameters to
new installer-sol
and rescue-sol
labels. The first console
will direct normal output to the screen. While the second one will also
redirect it to a serial port.
Warning
Depending on your vendor the serial port exposed to
IPMI will not always be the same. If you do not see any output after selecting a menu
entry in PXELINUX, try a different serial port like ttyS0
, ttyS1
, or
ttyS2
.
The inst.text
kernel parameter will instruct the CentOS installer to
use the text mode installer.
DEFAULT menu
PROMPT 0
MENU TITLE MHPC 2024
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
...
LABEL installer-sol
kernel centos7/vmlinuz
initrd centos7/initrd.img
append console=tty0 console=ttyS1,115200n8 inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.text
MENU LABEL CentOS 7 Installer (Serial-over-LAN)
LABEL rescue-sol
kernel centos7/vmlinuz
initrd centos7/initrd.img
append console=tty0 console=ttyS1,115200n8 inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.rescue
MENU LABEL CentOS 7 Rescue (Serial-over-LAN)
Power on or power cycle the compute node and then attach to the serial console (you might need multiple attempts to attach):
[root@master ~]# ipmiwrap c01 power on
[root@master ~]# ipmiwrap c01 sol activate
If for some reason ipmitool
reports that some session is already active, you can try do deactivate and activate it again via:
[root@master ~]# ipmiwrap c01 sol deactivate
[root@master ~]# ipmiwrap c01 sol activate
Verify that you can use both menu entries you’ve created.
7.3. Remote Text Mode Installation via SSH
Instead of the serial console you can also SSH as root
into the
installer operating system if you pass the inst.sshd
kernel option.
This will give you all the benefits of a full shell, compared to the
limited capabilities of the serial console.
LABEL installer-ssh
kernel centos7/vmlinuz
initrd centos7/initrd.img
append console=tty0 console=ttyS1,115200n8 inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.sshd inst.text
MENU LABEL CentOS 7 Installation (SSH enabled)
LABEL rescue-ssh
kernel centos7/vmlinuz
initrd centos7/initrd.img
append console=tty0 console=ttyS1,115200n8 inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.sshd inst.rescue
MENU LABEL CentOS 7 Rescue (SSH enabled)
Warning
By default, this uses an empty root password for SSH. You can set one using the sshpw
kickstart command (see later).
While the console
options aren’t required, it is recommended to keep
using them in order to be able to check the boot process before
attempting to connect via SSH.
Once the installer has booted, connect via SSH from the master node:
[root@master ~]# ssh root@c01
Note that this will add the installer OS host key to the master node in
~/.ssh/known_hosts
. However, this changes after each boot. So you
will get an error message if you try to connect to a new installation
afterwards. You can either delete the affected line in the
known_hosts
file or use a more complicated SSH command to avoid the
host check completely.
[root@master ~]# ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@c01
Once connected, you have access to a full shell. You can inspect the system, create/modify/delete partitions, mount them, etc.
The text-mode installer itself is running inside of a tmux
session.
Attach to it by running the following command:
[root@c01 ~]# tmux a
See tmux Quick Start for more details on how to use it.
7.4. Remote Graphical Installation via VNC
Install a VNC client on your system E.g. TigerVNC viewer
Create
installer-vnc
label in PXELINUX configurationIn addition to
inst.repo
, append theinst.sshd
andinst.vnc
kernel options. Addconsole
kernel parameters to ensure Serial Console is available too for debugging.LABEL installer-vnc kernel centos7/vmlinuz initrd centos7/initrd.img append console=tty0 console=ttyS1,115200n8 inst.repo=http://192.168.16.1/CentOS-7-2207-02-x86_64 inst.sshd inst.vnc MENU LABEL CentOS 7 Installation (VNC enabled)
You can set a VNC password using the
inst.vncpassword
kernel option. It is empty by default.Create a SSH tunnel to the compute node
ssh -L 5901:localhost:5901 -J student@trainingX.hpc.temple.edu:666,root@masterX root@c01.hpc
Connect with your VNC client to
localhost:5901
CentOS 7 installer
CentOS 7 installer 2
7.5. Install at least two compute nodes using any of the above methods
Use the entire disk for your installations
Use standard automatic partitioning
Only do a minimal install
Do not create any extra user, but set a root password, e.g.
mhpc2024