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:
From your local system, capture a copy of the running disk image back to your local system:
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 andfsck
it, as there will be errors.Since you do have remote console access to the server, I would do something like this:
init 1
as root, or reboot with1
added to the boot command line).ifconfig
androute
commands.P2V it to the remote hypervisor (or a storage server):
Create a new KVM virtual machine using
p2v.img
as 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.
All major hypervisors have a native P2V tool. Pick a hypervisor and use its tool.
A command line that worked for me:
I wrote a step-by-step detailed answer of how I solved a very similar challenge on the question: Turning a running Linux system into a KVM instance on another machine. I hope it proves a useful answer for this question too.
Goal of the answer: to take a physical Linux
P
node running live-production and virtualise it. Without having to create and allocate multi terabyte disks, nor have to use md raid in theV
guest, because the target hypervisor (Proxmox 5) used ZoL/ZFS. Also wanted to mitigate downtime/reboots on the runningP
node.