Score:0

How to automatically install different operating systems based on server specifics?

in flag

I have a lab of servers that need to be rebuilt frequently. I currently have a PXE server on a special vlan that can automatically install a single OS without human interaction.

How would I expand this to allow specific servers to get a specific OS installed automatically. Ie server A, B, C would get CentOS 7, server D, E gets RHEL 8, and server F gets CentOS Stream.

I can add OS versions to a boot menu in TFTP but then a human has to select the OS version. I tried to use expect to make the selection over serial, but it was cumbersome and prone to failure.

Is there someway to whitelist OS version to MAC address using PXE or another technology that can achieve the same goal?

francois P avatar
in flag
Maybe by defining hardware of each to identify them from serial number or something to link it to an OS list you have to manage. If servers have hardware remote management tools then look at that, many of them can be scripted from remote to trigger installations of OS's. DELL, HP, IBM do that (with theirs own tools each)
francois P avatar
in flag
Please add example of your exact hardwares & needs to your question & what are the automation management tools you're using (puppet/ansible/bash scripts & so on...) so we can help you better
me flag
If you use Clobber, you can create a hardware profile that contains a MAC address. this hardware profile can be mapped to a specific distro, and once it is booted using PXE, Cobbler will provide it with the correct image to boot and start the installation. See: https://cobbler.readthedocs.io/en/latest/cobbler.html . The Foreman project also use Cobbler as back end. Might be easier to use. https://www.theforeman.org/
dranobob avatar
in flag
@francois_P I’m using HP servers with ILO but we aren’t willing to pay for the premium license for the number of servers we have. The need is to whitelist os version by MAC address so that when a server is switched to the PXE vlan, it will automatically install the correct OS. We are using ansible to do the ILO control of the server and switch management, but we can use any software or process needed.
dranobob avatar
in flag
@sharuzzaman I’ll give it look. Thanks.
in flag
With the [iPXE](https://ipxe.org) loader you can run scripting on client side, and also call http server which can make decisions for you. I'm sure already mentioned solutions would work fine, there is also the fog project. To try and give a solution to the specific question, if you get iPXE running you can have a script with labels, and gotos for specific mac addresses, but you can also do it on serialnumber and other values
Score:0
es flag

A technique that can be used is to customize the bootloader configuration based on the booting system's MAC address. The bootloader configuration can provide different default options to allow different behavior without any interaction.

Three common PXE bootloaders, PXELinux, Grub, and iPXE can all provide configuration based on MAC address. They each have different capabilities.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.