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.

I'm running ESXi 5.0 and have created a Debian Squeeze (6.0.5) "template" system which is just an installation of Debian slightly customized (ie. VMware Tools installed).

If I clone the system (ie. deploy it to a new virtual machine) then I need to perform several actions:

  1. Change hostname
  2. Regenerate SSH keys

Is there an easy method to perform the above actions? Changing the hostname is particularly a problem because according to (http://wiki.debian.org/HowTo/ChangeHostname) you must change it in several files such as the exim configuration, ssmtp, etc).

Is there an "approved" or easier method of doing this?

share|improve this question

3 Answers 3

Don't clone. Instead, learn configuration managament and unattended installs.

Install your debian systems with pxe and a preseed file for debian-installer. That should set up a base system. Then use puppet or chef to manage all configurations.

No need for cloning, and you can manage your servers better.

share|improve this answer

Check out Blueprint from DevStructure

http://devstructure.com/

on GitHub - https://github.com/devstructure/blueprint

Blueprint

Blueprint reverse-engineers servers.

Easy configuration management.
Detect relevant packages, files, and source installs.
Generate reusable server configs.
Convert blueprints to Puppet or Chef.
No DSLs, no extra servers, no workflow changes.

Blueprint looks inside popular package managers, finds changes you made to configuration files, and archives software you built from source. It runs on Debian- and RPM-based Linux distros with Python >= 2.6 and Git >= 1.7. See http://devstructure.github.com/blueprint/ for comprehensive documentation and examples

share|improve this answer

No, not really.

There are multiple ways of doing it, you essentially choose whatever you deem the best fit for your environment, and on how frequent you clone an installation. You can either

  1. Adjust the clone's settings with your own scripts
  2. Do the above, but with your configuration management software
  3. Automate the installation instead of cloning

You are correct in that you require to change the hostname and SSH keys - but you'll need to adjust the udev rules as well (debian will remember the UUID of the template's network adapter as eth0, and would assign the network adapter in the new, cloned system as eth1. This is a well-known issue).

share|improve this answer

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.