I HAVE A DREAM Imaging a VPS to Local Hardware?

tycho

Guru (not...)
Joined
Aug 9, 2011
Messages
652
Reaction score
272
I'm looking for a way to image a Cloud-at-Cost VPS to my local machine. In this particular case (not that I suppose it matters) the system is Incredible PBX 12.7.1 for Ubuntu 14.04.1 with Asterisk 12 and FreePBX 12. I'm running other small applications and daemons on the VPS as well.

Unlike Dig. Ocean, CaC doesn't provide a backup/snapshot/image capability (at least not one that I have been able to uncover). But my thinking is that any mechanism that would allow for the imaging of a remote server with the image saved to local hardware should work, whether CaC, or VPS, or not.

I have been able to do a =file-by-file= backup of the CaC VPS to my local hardware using rsync. It would be easy to do this from a local Linux box, but I decided to complicate matters by insisting on running things from a Win7 box -- my primary desktop. Rsync can be coaxed into working just fine via Cygwin on the Windows side.

Before I run the backup, I stop the following services using the following commands:

amportal stop
/etc/init.d/sendmail stop
apachectl stop
/etc/init.d/mysql stop
/etc/init.d/webmin stop

I leave IPtables and Fail2Ban running so as not to expose the VPS during this process. (Unlike MySQL, for example, I am not aware of problems associated with copying files and tables from those two services while running. Maybe I am wrong in this regard?)

The rsync backup goes off swimmingly if I exclude a couple of problematic directories. And the speed isn't horrific for my tiny Developer 1 instance: I transferred 1.70G (compressed) at 851.79K bytes/sec to my local server, and that uncompressed to 4.35G at my end. Fast enough to start and walk away, or to do in the background (as I did).

But: me still wanna image backup, not a file-by-file backup.

Anybody have suggestions as how to pull off an image backup of a remote machine to local hardware? I'm looking for something rather like "Clonezilla" that will work with a remote VPS and save the image to a local drive. Hmmm; maybe Clonezilla =can= do that now that I understand how to and have set up the "conduit," and have created SSH keys, etc. I'll explore that while I await what surely will be the perfect answer from one of you...

**EDIT TO ADD**
I explored Clonezilla and quickly found this:
  • Online imaging/cloning is not implemented yet. The partition to be imaged or cloned has to be unmounted.
 

dziny

Guru
Joined
Sep 4, 2014
Messages
45
Reaction score
19
  • Online imaging/cloning is not implemented yet. The partition to be imaged or cloned has to be unmounted.

^ This. You'll never be able to image /root that is mounted within the same instance. What I do is I shutdown the instance, launch a new linux instance to which I add the disk I want to image. Then u can mount/unmount the disk you want to image from the new instance. I usually backup the whole partition/disk using fsarchiver but you are free to use any tool you wish.
 

tycho

Guru (not...)
Joined
Aug 9, 2011
Messages
652
Reaction score
272
^ This. You'll never be able to image /root that is mounted within the same instance. What I do is I shutdown the instance, launch a new linux instance to which I add the disk I want to image. Then u can mount/unmount the disk you want to image from the new instance. I usually backup the whole partition/disk using fsarchiver but you are free to use any tool you wish.

Thanks! Now I have to see if it is possible to shutdown that instance on CaC and mount it on my other, running, CaC instance. Unlikely, methinks, but I'll poke around.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
I'd suggest rsync the CaC vm to a local running VirtualBox Ubuntu vm (running the same version of ubuntu as the CaC vm).
 

tycho

Guru (not...)
Joined
Aug 9, 2011
Messages
652
Reaction score
272
I'd suggest rsync the CaC vm to a local running VirtualBox Ubuntu vm (running the same version of ubuntu as the CaC vm).

Is there an advantage to doing that vs. doing an rsync to any particular holding directory on any other kind of machine? For example, I did do an rsync to a holding directory on a WinBox via Cygwin, and it seemed to work well.

Or, are you saying to essentially do a filesystem to filesystem copy, from the CaC server to "/" of the VM?
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Is there an advantage to doing that vs. doing an rsync to any particular holding directory on any other kind of machine? For example, I did do an rsync to a holding directory on a WinBox via Cygwin, and it seemed to work well.

Or, are you saying to essentially do a filesystem to filesystem copy, from the CaC server to "/" of the VM?

I imagine your reason for doing the imaging of the cloud VPS to local hardware (also a VPS?) would be so that
1) you could try running the VPS locally and see if it performs better...
2) you could make a fully runnable image backup of the vps so that you could save your data, system, application binaries, and machine config,
3) you could have a local "hot spare copy" that you could switch your phone service to, when your cloud vps provider goes off line for a half day, full day or two days - this happens once or twice a year with parts of amazon's and google's network.
 

tycho

Guru (not...)
Joined
Aug 9, 2011
Messages
652
Reaction score
272
Thanks. A 4th reason for wanting to do this is to have an image that can be restored to the cloud VPS, if that were even possible.

What drove the initial question was this scenario: I have 2 Developer 1 instances on CaC. I would like to upgrade those resources to CloudPro so that they can be combined. One instance is currently running several apps and daemons that took me -- a Linux noob -- a good while to sort out. Upgrading the running instance to CloudPro will likely require it to be destroyed I was not aware of a solution to backing up the instance and restoring it after conversion to CloudPro.
 

Members online

No members online now.

Forum statistics

Threads
25,838
Messages
167,923
Members
19,259
Latest member
dancosge
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top