Migrate CentOS 5.4 to Ovirt
Purpose
A very old install of CentOS 5.4 needed to be migrated to an Ovirt Hypervisor. This was a special install of Hylafax, a productions server that could not be taken offline, and was critical to business operations.
Several attempts were made to replicate the server and it's 500GB of data. Including running a disk dump over ssh to the destination VM and another physical server.
Steps
My final idea was to rsync the system to the new VM disk, install grub, then go from there.
Rsync
First I created a VM in Ovirt with a disk large enough to hold the data, plus extra as the existing server was running out of space.
After that was completed I
- booted off a live fedora ISO
- ran fdisk
- created first partition with enough space for the boot partition.
- created second partition with rest of space.
- started sshd
- created a password for liveuser
- On the old server, ran ssh-copy-id liveuser@newvm to ensure key based ssh was setup.
rsync boot partition
While still in the live fedora shell
- mounted /dev/sda1 on /mnt
- chown liveuser /mnt
Then on the old server ran the following dry run to check for errors.
rsync -avn /boot/* liveuser@newvm:/mnt/ &> rsync.log
Then the live transfer
rsync -avz /boot/* liveuser@newvm:/mnt/ &> rsync.log
rsync root partition
Back in the line fedora shell
- umount