How to make rhevh to run a postscript after installatoin
I am using the pxe to install the rhev-h, it succeeded. But I need an approach to run the postscript after the installation of rhev-h (run on the rhev-h) to configure the rhev-h.
Is there a good approach to do this?
Responses
What exactly do you need to configure? All the options you can provide in the initial setup are also available as PXEboot options
We deploy lots of RHEV-H hosts daily and never had such a loop. Once the normal installation PXE boot runs through, the host has RHEV-H installed on the local disks, and so will not try to boot from PXE (if the options in BIOS are set right).
What do you use as the PXE server?
There are a couple different ways you can accomplish this.
1. Setup the boot options correctly in BIOS so that the local disk is earlier than PXE. Then boot the machine and tell it to boot from PXE/Network on just this one boot. That will run the installation and next time the machine boots, it will try the local disk first.
2. There is also the local_boot_trigger pxe option. The value can be set to any url and during the final steps of installation, RHEV-H will wget the URL you specify. If your pxe server provides a way to disable pxe for a server with just a wget of a specifc URL, this can be used to disable it.
For example, I use cobbler in my environment, and I can add this to the kernel command line:
local_boot_trigger=http://<cobbler_server>/cblr/svc/op/nopxe/system/@HOSTNAME@
@HOSTNAME@ is automatically replaced with the hostname of the machine (set either with dns lookup or the hostname option)
Hope this helps
Mike
What do you do in the RHEL post to disable pxe for a particular host? If it is a simple wget, then it will work.
What exists today in RHEVH is a script that will wget a url. If you can disable pxe for a host using wget, then it will work with RHEV-H.
The script does:
wget <url> -O /dev/null
The url is found from local_boot_trigger=<url> on the kernel commandline.
Ok, that is pretty ugly. Sorry about that. I tried to past the script and it didn't show up right...
trigger_url=
for i in $(cat /proc/cmdline); do
case $i in
local_boot_trigger=*)
trigger_url=${i#local_boot_trigger=}
;;
esac
done
if [ -n "$trigger_url" ]; then
trigger_url=$(echo $trigger_url | sed -e "s/@HOSTNAME@/$(hostname)/")
wget "$trigger_url" -O /dev/null
fi
Yes, with RHEV-H, you need to have a mechanism to disable pxe via wget. There is no callback or anything else. The code shown in my post does wget >/dev/null.
The wget is triggered by rhev-h, but only if you specify local_boot_trigger. It does nothing but a wget. It doesn't do anything with what it gets. The assumption is that just touching that url path will disable the pxe boot for that server.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
