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:
- Change hostname
- 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?
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.
Check out Blueprint from DevStructure
http://devstructure.com/
on GitHub - https://github.com/devstructure/blueprint
Blueprint
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
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).