I'm using the CentOS 6 netinstall ISO with some kickstart files on an http server. When the ISO boots I hit TAB and enter the boot options asknetwork ks=http://<ip-address>/path/to/kickstart.ks
.
My kickstart files do not have a network
parameter, so it should be prompting. When I leave out asknetwork
it tries to use DHCP. With asknetwork
it only prompts for IP information.
Unfortunately anaconda is hell bent on automatically discovering the hostname, which ends up being a reverse DNS lookup of the IP, or localhost.localdomain
if nothing was found.
Is there a way to make anaconda prompt for the hostname, or some way to pre-enter it through a custom boot option?
There used to be network --bootproto=query
for CentOS 5, but this no longer works in 6.
I set the hostname in the kickstart file directly.
If you're trying to reuse the same template, you could get creative and use a bit of PHP to pass something to the installer. Kickstart files are http, so you could do something like:
...where kitty is a variable in the kickstart file that populates the
--hostname=
parameterOr the better route is to use a more robust provisioning framework like Cobbler.
I prefer this method using bash:
I was trying to do this with virt-install and found a blog article with an excellent solution to this. The solution uses the /proc/cmdlines passed to the kernel at boot time to extract a hostname using a pre kickstart section and write a temporary file that is then included in the main kickstart section.
http://monzell.com/post/15547967527/automatically-set-the-hostname-during-kickstart
The blog was for kickstarting VMs in KVM. But I don't see any reason this wouldn't work in any other kickstart scenario where you can pass the kernel boot arguments easily.