Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We normally provision servers using kickstart scripts (served by Cobbler) when installing the operating system.

But we are to be given a new server from an ISP that already has the operating system installed, and possibly with no remote console access.

Is there a way to reboot a linux server (same OS that we normally use) and force it to re-install using a kickstart script?

share|improve this question
add comment

4 Answers

You can try using a snake server.

Once configured, both the server and the client machine, it will provide a curses interface to select a kickstart file amongst other options.

share|improve this answer
1  
... so this is like a Linux version of the Depenguinator? :-) –  voretaq7 May 31 '13 at 16:16
add comment

If you have a separate physical partition to copy your installation media to, you could do that and modify Grub to Kickstart on boot.

install harddrive --partition=sdb2 --dir=/path/to/installation-media

Add to /etc/grub.conf:

title Reinstall CentOS 6
    root(hd0,0)
    kernel /vmlinuz-kickstart ks=kickstart.cfg
    initrd /initrd-kickstart.img

You'll need to modify the values above (where appropriate) for your environment. The Kernel and intial ramdisk can be copied from the installation media (usually in the ./isolinux directory.) Note: I appended -kickstart to the filenames so that they stand out in a directory listing.

Last, set the default Grub entry to this one and reboot. (Count the instances of title, starting from 0.)

I can't stress enough that you should test this locally in a VirtualBox VM or the like before trying it on a colocated system.

For more information:
Kickstart Options
Starting a Kickstart Installation

share|improve this answer
    
I should also say that if you have another server, you could use one of the other installation methods. (NFS, HTTP, FTP, etc.) –  Aaron Copley May 30 '13 at 17:19
    
Alas, I've not gotten this to work. I suspect it's due to the limited access that the ISP gives to the console. I've ended up manually setting things up to bootstrap Puppet. :( –  Rob Jun 3 '13 at 10:45
    
Sorry, to hear. I do this at least twice a day without any console access. The only time I ever need console is when I have a brand new system with nothing on it. If Grub works, this should. Might just take some more work to break it down for your use, but glad you got another solution. –  Aaron Copley Jun 3 '13 at 18:34
add comment

You can do the installation yourself if the provider gives you remote access to the server's out-of-band management hardware (e.g. IPMI, iLO, DRAC). If you don't get such access, or if the server doesn't even have such hardware, you should probably not do business with them and find another provider.

share|improve this answer
add comment

There's no way I know of to do a kickstart on an already-installed server (though I'm not a CentOS/Redhat guy so it's entirely possible I know not what I speak about).

Michael Hampton's solution works if you have remote KVM (with remote media, and decent bandwidth), but in your situation I'd suggest looking into deployment / configuration management via Puppet, Chef, or one of the many other tools out there.
Configuration/Deployment Management tools will let you ensure that all your servers match a standard configuration independent of their starting state (so if your ISP hands you a system that's basically unusable you can get it up and running quickly), and you get the benefit of ongoing management for installing updates and the like.

It's a bit more of a long-terms solution and there's definitely a learning curve involved, but it's probably worth it if you're going to be managing a bunch of machines going forward.

share|improve this answer
    
We use Puppet, but I was hoping to get the server properly configured with the right version of Puppet etc. by Cobbler beforehand. Otherwise there is still a lot of manual work to do. –  Rob May 31 '13 at 15:48
    
@Rob If you fully leverage puppet you should be able to provision from a generic box (like what your ISP gives you) in two steps -- install puppet ; pull strings -- the work required to get to that "fully leveraged" position is pretty substantial though. Dawud's answer using snake might be a better option if time is a factor. –  voretaq7 May 31 '13 at 16:15
    
Setting up Puppet requires manual work of installing correct repos with correct settings, setting up SSH keys, copying Puppet manifests, etc. –  Rob Jun 2 '13 at 18:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.