P2V: Linux RAID1 -> Virtual disk or similar... how would you go about it?

Hi all, A friend has an aging linux server on which he runs a web app that he custom built. The web app's written in Perl and has grown organically with libraries and other dependencies added over the years. The server's getting a bit long in the tooth and my concern is a proper backup is needed. My first instinct is that given he doesn't have an exact handle on dependencies etc. he needs to ensure that he has a backed up copy of the entire system "as is"... and that for backup purposes as well as having something to properly dev on, a virtual machine is the way to go. With a virtual machine, one then has some breathing space to do proper dependency analysis etc. in preparation for a clean OS install and should current hardware die, provided that file and db changes have been backed up in interim, wouldn't be too hard to switch over to VM. The server uses Linux software RAID1 # mdadm --detail /dev/md1 /dev/md1: Version : 00.90.03 Creation Time : Sun Mar 26 17:57:19 2006 Raid Level : raid1 Array Size : 76196224 (72.67 GiB 78.02 GB) Used Dev Size : 76196224 (72.67 GiB 78.02 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 1 Persistence : Superblock is persistent Update Time : Mon Jan 28 17:35:20 2013 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 How would you image the system, to P2V it? In theory I think one could: * Image a single drive to a virtual disk.. boot into degraded state, recover or drop raid. * Image both drives to virtual disks.. boot into normal state * Build a VM using same underlying OS then using a live environment on both systems, rsync files from source over destination, overwriting destination entirely.. Fix fstab/raid config.. Not entirely sure on which tools to use tho to do this, pitfalls and such.. Also friend wants to minimise downtime as the webapp powers a relative's web store.

Hi What's the OS the server is running on? Sent from my Android On 28 Jan 2013 06:49, "Anthony Hogan" <anthony-luv@hogan.id.au> wrote:
Hi all,
A friend has an aging linux server on which he runs a web app that he custom built. The web app's written in Perl and has grown organically with libraries and other dependencies added over the years. The server's getting a bit long in the tooth and my concern is a proper backup is needed.
My first instinct is that given he doesn't have an exact handle on dependencies etc. he needs to ensure that he has a backed up copy of the entire system "as is"... and that for backup purposes as well as having something to properly dev on, a virtual machine is the way to go. With a virtual machine, one then has some breathing space to do proper dependency analysis etc. in preparation for a clean OS install and should current hardware die, provided that file and db changes have been backed up in interim, wouldn't be too hard to switch over to VM.
The server uses Linux software RAID1
# mdadm --detail /dev/md1 /dev/md1: Version : 00.90.03 Creation Time : Sun Mar 26 17:57:19 2006 Raid Level : raid1 Array Size : 76196224 (72.67 GiB 78.02 GB) Used Dev Size : 76196224 (72.67 GiB 78.02 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 1 Persistence : Superblock is persistent
Update Time : Mon Jan 28 17:35:20 2013 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0
How would you image the system, to P2V it?
In theory I think one could: * Image a single drive to a virtual disk.. boot into degraded state, recover or drop raid.
* Image both drives to virtual disks.. boot into normal state
* Build a VM using same underlying OS then using a live environment on both systems, rsync files from source over destination, overwriting destination entirely.. Fix fstab/raid config..
Not entirely sure on which tools to use tho to do this, pitfalls and such.. Also friend wants to minimise downtime as the webapp powers a relative's web store. _______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

As the OS is new enough. You could use vmware-converter. This is what I've used with good results to an esxi server. Once you have the vmdk you can move this to other virtual server software such as virtual box. Other options available are clonezilla, or live cd with ssh and netcat. Ideally you would want to migrate to a single virtual disk. Just so it's easier to manage in the future. I'm unsure of the best way to get this done. Sorry. Andy Sent from my Android On 28 Jan 2013 07:00, "Anthony Hogan" <anthony-luv@hogan.id.au> wrote:
Hi,
What's the OS the server is running on?
# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy

Anthony Hogan writes:
[dying linux raid1 server, p2v]
Since this is a short-term goal (because you ARE gonna go back and make the "clean" VM afterwards, right?), I would keep it as dumb as possible: - boot a live medium - cat /dev/sda | ssh vm-server cat \> sda.img - cat /dev/sdb | ssh vm-server cat \> sdb.img - ssh vm-server -t kvm -curses -hda sda.img -hdb sdb.img I *think* you can skip dd'ing the second drive and just cp sda.img sdb.img. Your most likely problem will be that you don't have space for a complete copy of both disks on the VM server, even temporarily. In that case you can remove the md layer -- running the VM as a degraded array would half the space, and is perfectly reasonable (assuming the VM server's storage has redundancy, of course). Further than that, you will need to start ripping open the md and copying the filesystems or files to a fresh disk layout and ensuring the system can boot in the new configuration (by wibbling grub.cfg, fstab, etc). That isn't particularly hard if you've done it before, but can be tedious, which is why for a temporary VM I suggest not bothering. As another poster mentioned, you can use netcat instead of ssh for transferring over the network, but this assumes an ultimately trusted LAN. You could also do it by eSATA or similar.
participants (3)
-
Andy Dean
-
Anthony Hogan
-
trentbuck@gmail.com