Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ( 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

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

on GitHub -


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 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


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.