(Using cobbler 2.6.5 to install RHEL 6.x)
The general issue. In the "%pre" section of the cobbler kickstart file we have a snippet whose purpose is to check a detail of the client machine and, if things are OK, set some variables and proceed as usual. This is the normal case.
But sometimes, particularly with new hardware types, we expect that check to fail; we then want things to stop and print a decent error message.
The detail. [[ Don't worry about this detail; you may skip this paragraph]] Our client systems have an internal (RAID mirrored) system disk and various external fibre-channel disks. It is vital that cobbler picks the system disk. So our "%pre" snippet has a list of "known good" "/dev/disk/by-path" entries. If one of those is found on the client system, things proceed properly. But if none is found, this suggests new, untested hardware; so kickstart ends up with invalid "part ...--ondisk=$SD" and halts. This is OK but dirty. (We can then look at "/tmp/ks-pre.log" via the "Alt-F2" screen, to find the disk we want on this and future installs, so we can add it to the "known-good" list in perpetuity.)
What would be much better is if that snippet itself could (a) produce error messages on the main screen and (b) cleanly halt.
Any thoughts? What have I missed?
-- David Lee, DHS, ECMWF
David Lee david.lee@ecmwf.int writes:
The detail. [[ Don't worry about this detail; you may skip this paragraph]] Our client systems have an internal (RAID mirrored) system disk and various external fibre-channel disks.
Is it the same RAID controller in each case? My group addresses this problem by blacklisting the RAID controller ('qla2xxx') at the system profile level, so that only internal disks are recognized. This has worked out pretty well for us.
- Tim Skirvin (tskirvin@fnal.gov)
Re:
David Lee david.lee@ecmwf.int writes:
The detail. [[ Don't worry about this detail; you may skip this paragraph]] Our client systems have an internal (RAID mirrored) system disk and various external fibre-channel disks.
Is it the same RAID controller in each case? My group addresses
this problem by blacklisting the RAID controller ('qla2xxx') at the system profile level, so that only internal disks are recognized. This has worked out pretty well for us.
- Tim Skirvin (tskirvin@fnal.gov)
Thanks, Tim.
1. We have a variety of hardware types.
2. We do blacklisting activity on the finally installed system so that it can only boot of the internal disk. But we've never tried doing anything like it during the "%pre" phase of Cobbler. Is it even possible in the very restricted environment or "%pre"? Working example?
-- David Lee
David Lee david.lee@ecmwf.int writes:
- We do blacklisting activity on the finally installed system so
that it can only boot of the internal disk. But we've never tried doing anything like it during the "%pre" phase of Cobbler. Is it even possible in the very restricted environment or "%pre"? Working example?
The 'blacklist' parameter is set under 'kernel_options' in the profile data, e.g. (from the raw data):
"kernel_options": {"blacklist": "qla2xxx", "console": "ttyS0,115200"},
You can probably add multiple items to the blacklist list if you have multiple RAID controller types, and/or use different profiles for the different hosts.
- Tim Skirvin (tskirvin@fnal.gov)
On 04/15/2015 10:04 AM, David Lee wrote:
The general issue. In the "%pre" section of the cobbler kickstart file we have a snippet whose purpose is to check a detail of the client machine and, if things are OK, set some variables and proceed as usual. This is the normal case.
But sometimes, particularly with new hardware types, we expect that check to fail; we then want things to stop and print a decent error message.
What would be much better is if that snippet itself could (a) produce error messages on the main screen and (b) cleanly halt.
Any thoughts? What have I missed?
This is not a Cobbler question, as snippet is simply included in the automatic installation file (eg kickstart), but that's ok.
Use --erroronfail (http://serverfault.com/questions/446428/how-to-make-kickstart-exit) and echo/return 1 in the snippet if your check fails.
Re:
On 04/15/2015 10:04 AM, David Lee wrote:
The general issue. In the "%pre" section of the cobbler kickstart file we have a snippet whose purpose is to check a detail of the client machine and, if things are OK, set some variables and proceed as usual. This is the normal case.
But sometimes, particularly with new hardware types, we expect that check to fail; we then want things to stop and print a decent error message.
What would be much better is if that snippet itself could (a) produce error messages on the main screen and (b) cleanly halt.
Any thoughts? What have I missed?
This is not a Cobbler question, as snippet is simply included in the automatic installation file (eg kickstart), but that's ok.
Use --erroronfail (http://serverfault.com/questions/446428/how-to-make-kickstart-exit) and echo/return 1 in the snippet if your check fails.
Thanks, Alan.
My google searches (prior to sending my email) kept on coming up with that page; it looked tantalisingly promising, but frustratingly incomplete. Although it's the best thing I found in those searches, it still lacks a worked example. I was also very surprised not to find any authoritative source (RHEL, CentOS, etc.) in my searches.
Before my email, I had already tried something like it inside my bash "%pre" (now "%pre --erroronfail"). The snippet includes: if [ <something went wrong> ] then echo 'my error details' exit 1 fi
But:
(a) the "echo" text doesn't appear on the main screen; (b) it heads straight to a reboot, not to a "halted installation" as the webpage had claimed.
If I now replace "exit 1" with "return 1", the "return 1" is invalid because "return" is not valid in a simple bash script.
Does anyone actually possess a real example of this working? If they have, then I will also willingly add any success to that webpage!
-- David Lee
cobbler@lists.fedorahosted.org