I have an obsolete linux app-server running which I would like to migrate to a KVM virtual server with greater specifications.
I do not have physical access to the machine itself or its harddisks.
I only have access to the server across the network.
If it can be used for anything, I already have an empty spare HD installed in the server. This 2nd HD is about three times larger than then one where the data resides on.
Please ask for any other details you may need.
Assuming you don’t have remote console access, or it’s through some crappy horrible useless Java applet:
- ssh to the remote system and shut down as many services as possible. Basically everything but the ssh server itself.
From your local system, capture a copy of the running disk image back to your local system:
ssh email@example.com "dd if=/dev/sda bs=1024k" > p2v.img
Wait several hours. Depending on the size of the hard disk and your available bandwidth, this may take a very long time.
You will end up with a file
p2v.img. Mount this to a KVM virtual machine as a raw disk image and
fsckit, as there will be errors.
Since you do have remote console access to the server, I would do something like this:
- From the remote console, bring the system to single-user mode (
init 1as root, or reboot with
1added to the boot command line).
- Bring up the network manually, e.g. with the appropriate
P2V it to the remote hypervisor (or a storage server):
dd if=/dev/sda bs=1024k | ssh firstname.lastname@example.org "cat > /path/to/p2v.img"
Create a new KVM virtual machine using
p2v.imgas the disk, start it up and make any necessary changes.
The virt-v2v tool can also P2V a Linux server to a KVM virtual machine.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.