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.

In past few weeks I found out, that my Linux sysadmin skills are pretty low, so I bought bigger HDD (1.5TB) and started playing with virtual machines. I'm experimenting pretty hard way, so I end up reinstalling a lot. My problem is, I don't really know, what is the best way to do initial setup.

My first idea was to create simple bash script, that would install all necessary packages, compile sources, set up accounts etc. But my problem was, that it usualy got stuck in the middle somewhere, because of some change or problem, so I had to manualy hack it anyway. Also such a script will outdate very fast.

Another idea, which I'm trying now, is to write a checklist with things I need to do, and then manually install everything and check things on the paper. This has advantage of having more generic steps (like install MySQL), however I have to do everything manualy, which isn't very convenient.

Last options is install a whole system manualy, configure it, and then create a image of partition, and restore it eventualy instead of clean instalation. While this seems to me like good solution for installing on say 20 servers at once, it will also be outdated soon, so I'd have to create new, up to date, clean installation and create it's image again.

I know that different situation applies different measures, so there probably isn't one fit all solution.

So my question is.

Do you have any kind of checklist, installation script, or any kind of that thing, when you are installing a new system?

share|improve this question
    
Without going into detail, so just a comment: learn how to use kickstart. –  Max Alginin Nov 10 '09 at 5:49
add comment

5 Answers

up vote 5 down vote accepted

There are really two different areas you want to look at:

  • Bare metal provisioning - going from an OS-less server to one with a basic OS installed on it. The tools to provision vary by operating system and distribution: Windows has WDS, Solaris has JumpStart, and Linux has a variety depending on the distribution, with kickstart and FAI being among the most popular. You'll also find that cloud services like EC2 have their own methods of handling bare-metal provisioning centered around building a pre-loaded VM you can boot up.
  • Once you have a base OS image, configuring it to be a useful server. For this, look at tools like Chef, Puppet, bcfg2, or cfengine. The biggest advantage of using a tool like these over following a script is that they'll also handle changes to your server over time, in addition to provisioning new servers.
share|improve this answer
    
Thanks for mentioning these utilities. I still use BASH scripting for automation, but I guess it's about time to start experimenting with one of those tools. –  Born To Ride Nov 10 '09 at 13:54
add comment

Since we are talking about virtual machines, why not use images? For most VM systems, you can have some sort of template that the initial machine uses. So, you could always create a basic system, configure it to your liking as a generic base system, and then just create all your other derivative machines from this base template. How you would accomplish it would depend on the virtualisation technology that you used.

For something like OpenVZ/VServer, templates are used anyway - so just make a custom one. For something like KVM, just copy the harddisk image or you can even use a combination of read-only harddisk images with snapshots. Others have similar capabilities too.

share|improve this answer
    
Images are nice, but not as good as other solutions, e.g. cobbler and puppet. –  Cristian Ciupitu Nov 11 '09 at 9:46
    
I guess that it all depends on how much customisation is needed and at which stage. Images won't work as well in post-install customisation. –  sybreon Nov 11 '09 at 15:05
add comment

I always go wirh Debian netinstall. This is an absolut minimal system. Then going step by step building up the system with apt-get. You may put the apt-get commands into a file and use this file later to re-build the system, even to a certain point.

share|improve this answer
add comment

I'm very happy to use a cobbler server that centrally handles every machine (bare metal, dom0 and VM) I have.

For this purpose I have created a vmware VM on top of which I installed my cobbler server, than I can use it everywhere I need, simply attaching my laptop on the LAN or to the machine to be installed through a cross cable.

This is very scalable, easy to handle and makes standardization the center of your installations.

share|improve this answer
add comment

You haven't mentioned what flavor of Linux. I'd second the recommendation of cobbler. In addition to doing provisioning, it can do really basic configuration management, though I'd really recommend puppet for configuration management. To boot it will manage and keep synced, a copy of the update repos locally. Cobbler is pretty easy to get installed and running, puppet (and all of the other config management tools) have a bit steeper curve.

share|improve this answer
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.