Cloning is a useful tool for horizontal scaling to easily add more web servers behind your load balancer. It is also useful if you just need to set up a server similar to what you already have, and wish to skip the hassle of configuring a new server from scratch.

Cloning a server performs the following three main operations:

  1. Create a new server with the same configurations as the base server.
  2. Create new storage disk that is a 1:1 copy of the base server’s storage.
  3. Attach the clone storage to the new server.

If the base server has several storage disks, all devices get copied and attached to create an exact copy of the original.

Before cloning

Before cloning a server, you should check through your server to make sure everything is working as expected. For servers running CentOS 6.7 or older and Ubuntu 12.04 or older, you should rename the current MAC address reference file to avoid extra reboots.

sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old

The file will be generated again on the next reboot.

Other servers with an OSs different to those mentioned above, such as any newer Linux distribution or Windows Servers, do not need any special preparations for cloning.

Cloning a server

Note that the server being cloned must be shut down during the procedure.

To star a server cloning, log in to your UpCloud Control Panel. Open the server details by clicking the description of the server you wish to clone and simply click Clone server link under the Server Management in the General Settings tab.

This will open a new server deployment page with the details copied over from the original server. Check through the settings to make sure everything is in order.

Take care when selecting the Availability Zone for cloning. It is possible to clone the server to a new zone by changing the Availability Zone at the deployment settings. However, note that cloning between zones will be much slower than within a zone and might not be viable for servers that cannot be left shut down for an extended period of time.

Optionally you may change the Server Name or the Short Server Description as well as the server Configuration if needed before deployment. The only restriction is that the new server must have a storage disk at least the same size as the original server.

When you are done with the selections, click the Deploy server button to begin cloning.

After cloning

As cloning your cloud server means that the data is copied from one disk to another as is, all of the OS-level configurations are exactly the same. Therefore you might need to make some changes to the new server’s configuration like updating the hostname.

On Ubuntu and other Debian based distributions, open the hostname file for edit.

sudo nano /etc/hostname

With CentOS and other Red Hat variants, you’ll need to edit the HOSTNAME="example.upcloud.com" line.

sudo vi /etc/sysconfig/network

Replace the old hostname with a new one, save the file and exit.

If you cloned one of the older CentOS or Ubuntu distributions mentioned above and run into networking problems, try removing references to any old MAC addresses in the file /etc/udev/rules.d/70-persistent-net.rules and reboot to apply the changes.

Windows servers should work as is straight out of cloning. If you get issues with network connectivity, check that your network interfaces are turned on and working.