Restart Anaconda installation mid-run

When developing or adjusting kickstart flows, a very frustrating experience is to fail on something small, and then – to reboot the machine and start the cycle again. This is even more frustrating when handling physical servers with longer POST sequences and slower reboot times.

In this post I will describe a few techniques to reduce this cycle, and maybe – save yourself some time and effort.

Enable network and SSH access to the machine

Copy/paste doesn’t work well on ILO/iDrac/VMware Console. A better solution is a direct SSH to the installed machine. However, if you did not specify the flag ‘inst.ssh’ as part of the boot parameters – the system remains without active SSH session.

To solve this issue, we need to enable networking (if not already enabled, by performing a network installation, and manually enabling SSH.

Switch to console

If using GUI installation, press on Ctrl+Alt+F3. If using CLI installation, press on Alt+F3 or Alt + Right arrow, until you reach a text console you can type in.

Set IP address, if not already set

Using ‘nmcli’ command, you can enable a card, or even change its settings. Example:

nmcli connection up eno1

You can use ‘ip’ commands directly, if you are familiar with them.

Enable SSH

A root password-less ready SSH config file is ready for us, just to use:

cp /etc/ssh/sshd_config.anaconda /etc/ssh/sshd_config
systemctl start sshd

After performing any of the required actions mentioned above, you can login as root, without password, to the machine’s IP. Now you can use regular SSH client copy/paste.

Overwrite read-only files

This is a tricky part. Your kickstart is on the ISO – a read-only device. It is mounted in /run/install/repo, and you are unable to change it. Your kickstart failed, and it was only a typo.

To modify the kickstart or any other read-only-file, copy it to a writable location, e.g /tmp, and edit it there. In my example, we will assume the file is /run/install/repo/ks.cfg file, from a read-only ISO mounted to the host.

You can mount the modified file as ‘bind’ over the original file. It will provide layer of read/write access to the underlined file. This is how it’s done:

cp /run/install/repo/ks.cfg /tmp
<edit /tmp/ks.cfg>
mount -o bind /tmp/ks.cfg /run/install/repo/ks.cfg

This procedure allows you to update the file mid-failure, and fix small changes which are required to continue.

Restarting the Anaconda installer

The previous steps are useful in many cases, but their main value comes when you can restart the Anaconda installer, and by doing so – force it to re-read the kickstart file. Restart the ‘anaconda’ service like this to do so:

systemctl restart anaconda.service

It will restart the entire installation interface (VT1, or GUI), forcing the system to re-read the kickstart and restart the process.

It can (and probably will) save a lot of time, if you use this technique, and I hope it serves you well.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.