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

Is it ok to simply clone a vmware image of an Ubuntu server if I want an exact copy to run as a load balancing node? I realize I, at the very least, have to change the new machine's ip address and name, but are there any other things I should be aware of?

Clarification: The server is a standard installation running nginx and haproxy as a http loadbalancer and ssl proxy for some websites.

share|improve this question
    
Care to elaborate on what you are actually serving? –  Zoredache Aug 10 '11 at 18:55
    
Hopefully it will not run on the same host. :) –  mailq Aug 10 '11 at 19:15
    
Heh, sure they will... It's that box in the cellar... You know, the one with all the wires hanging out of it, and we use as a support for our fish tank. :D Nah, they'll be separated using VMWare DRS, to run on different hosts. ;) –  JohannesH Aug 10 '11 at 19:29

3 Answers 3

up vote 3 down vote accepted

Assuming there is nothing service-specific tied to the network address or host name, all you should need to do is change both. I usually change them in the config files before I clone, without applying them, so the new box is ready to go, and then change them back to what they were on the original node after cloning.

Another slightly safer option is to add a one-time init script to make the changes before you clone, clone the system, then disable that one-time script. This script should check something like the MAC address to make sure it is really on a "cloned" node before doing anything disriptive to the hostname or IP.

Regenerating SSH keys, random seed files, or anything else that is "per machine" and security related is also probably something you should do on the new node once it is up.

share|improve this answer
    
Thanks for the advice. –  JohannesH Aug 10 '11 at 19:04

The biggest thing I've found is that udev doesn't like cloned NIC cards and tends to create new instances. This can be a real headache depending on exactly how you have things set up. You should take a look at the udev rules (at /etc/udev/70-networking or similar) and pull out all the contents listed there on your cloned system. On reboot it should act much more as expected.

Disclaimer: I've used Ubuntu server a bit but most of my time is spent with CentOS.

share|improve this answer
    
Thanks for the advice. :) –  JohannesH Aug 10 '11 at 19:00

It completely depends on the installed services.

A server which is hosting lots of static files through Apache could be easily cloned. A mail server, database server or something else might not be cloned as easily.

share|improve this answer
    
This is a server running nginx and haproxy so I guess I fall in the apache category. I'll try it when I'm done configuring the "template" server. –  JohannesH Aug 10 '11 at 19:00

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.