Clone a VDS; request for feature

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Grainger
A semi-regular
A semi-regular
Posts: 18
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Mar 15, 2010 7:54 pm

Clone a VDS; request for feature

Post by Grainger »

Hi,

I have a linux VDS server that has been set up with a fairly complicated (to me) server system and I have been unable to just copy the files and restart the services on another computer. I would like to request that a feature be added to NFO services so that a clone of the server could be created (i.e. a second duplicate NFO server). This way I can investigate the server in more detail without breaking the working version.

I understand through the help panel that this is not currently available.

My hope is that it would not be too difficult to add this feature as it would seem to me to be very much like a server move process without the deletion of the current server.

Thanks--if this feature is feasible, please let me know.

From an NFO user since 2009.
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Clone a VDS; request for feature

Post by Vanderburg »

What method are you attempting now?

rsync is a powerful tool you can use to copy files from one VDS to another, using our network, instead of downloading files to your PC and then uploading them to another VDS.
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Clone a VDS; request for feature

Post by Edge100x »

rsync is the best way to do this and is relatively easy.

Experiment by spinning up the new VDS with the same base image (for instance, if you ran Ubuntu, use that same Ubuntu version, and if you ran CentOS, use that same CentOS version), logging into the new machine, and running a command like this:

Code: Select all

rsync -avH oldvdsip:/ / --delete --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/var/tmp --exclude=/tmp --exclude=/etc/hostname --exclude=/etc/conf.d/hostname --exclude=/etc/ssh --exclude=/etc/sysconfig/network-scripts --exclude=/etc/sysconfig/network --exclude=/etc/network --exclude=/etc/conf.d/net.eth0
Then, reboot, and you should have a cloned system.
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

Thanks, I will give that a try. I am reasonably competent with PCs, but not with unix/linux.
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

Did it...now the new server is in an endless reboot cycle :?

I get some ubuntu selection menu on the VNC panel and can't connect via SSH with putty. I will try a power cycle.
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

Power cycle did not help,
An IO error Occurred: IO error #2031

I'm going to wipe it and start clean. If you have any suggestions, please let me know.

I did get this error after the rsync:
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1655) [generator=3.1.1]
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Clone a VDS; request for feature

Post by Vanderburg »

Are you able to copy to us what those previous errors are, please?
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

Sorry, I am not sure where to find them. Everything scrolled by very fast. Can I send the screen output to a file?

command with >> outputfile.txt should work?

I will try it on the clean install.
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

OK, there are a lot of them and this is only part of it (and sorry, I could not get spoiler tags to work), i will try to attach a file.
Attachments
errors.txt
(139.92 KiB) Downloaded 270 times
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Clone a VDS; request for feature

Post by Edge100x »

It looks like it's storing some more runtime system things in var/lib/lxcfs/. It should be OK to skip those by adding that to the line:

--exclude=/var/lib/lxcfs

I should also ask: Are you running this as root? You'd need to do it as root.
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

OK, I added that new part to the command and don't get a list of errors. However, it is still in an endless reboot at the grub menu (I can only see it at the VNC panel).
(and I am logged in as root when I issued the command)

Any additional advice/help ?
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

so instead of immediately rebooting, i tried apt-get update and apt-get upgrade then rebooted and I get the attached screens shot from the VNC window


something interesting here, it won't accept my root password from the new server (which I am on), but it does take the root password from the old server at the end of that screen.
Attachments
2017-07-31 18_27_12-Mozilla Firefox.png
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Clone a VDS; request for feature

Post by Edge100x »

It should be using the password from the old service, yes. Since you cloned it, it has the same accounts.

You should update the server before cloning it.

Do earlier messages tell you why you are being kicked to a maintenance prompt?

Are you certain that these two started as the same Ubuntu version (16.04, for instance)?
Grainger
A semi-regular
A semi-regular
Posts: 18
Joined: Mon Mar 15, 2010 7:54 pm

Re: Clone a VDS; request for feature

Post by Grainger »

On the new system I did:
reboot at first log-in then
apt-get update
apt-get upgrade
then the rsync
(then rebooted)

I didn't see any messages indicating any issues before rebooting after cloning.

The original system with lsb_release -a command says:

Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial


and that is what the new system is (16.04.1) LTS. On the new system, it had a package error on the update but I fixed that and then did the update.


----------

I also updated and upgraded then did the rsync, then updated and upgraded again then rebooted, but same issues.
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Clone a VDS; request for feature

Post by Edge100x »

It's possible that Ubuntu is getting confused about the UUID or something else changing. If so, we may need to exclude /boot, and possibly /etc/fstab or another file.

It's strange that it would, though, because our own imaging system does not need to compensate for this when it creates the initial customer OS install.

I will try to find some time to do some personal testing.
Post Reply