KVM VM to Proxmox migration avoiding downtime

  • Thread starter Thread starter valferon
  • Start date Start date
V

valferon

Guest
Hello, here is the situation :
I have 10 VM to migrate to proxmox, they are running on Debian (Lenny / Squeeze).

I know that it can be done very easily using the virtual disk (disk.raw) but my problem is that those VM must be always running (a 10min downtime is ok).

I tried to do it as if it was a physical server with Rsync but I run into problems too so if anyone has already managed to to it with a short downtime, I'd appreciate some tips!

Thanks in advance!

Valentin
 
where are the disk images, local or SAN?
 
Here is the way I found to do it :

*Create VM / same disk space +1G
*Boot on rescueCD
*Gparted on virtual disk to create partitions

*Rsync from 'old' VM:

rsync \
--stats \
--compress \
--recursive \
--times \
--perms \
--links \
--delete \
--verbose \
--owner \
--group \
--numeric-ids \
--hard-links \
--devices \
--exclude /proc/ \
--exclude /sys/ \
/ {$VMip}:/mnt/vda3

On my new VM :
*mount -o bind /dev/ /mnt/vda3/dev/
*chroot /mnt/vda3 /bin/bash

/usr/sbin/grub-mkdevicemap
/usr/sbin/update-grub2
/usr/sbin/grub-install

From here my server is almost migrated, I have to stop the production VM and boot on it with rescCD to Rsync with both VM down to get exactly the same VM.

I can restart the new one, with a limited downtime.

If you have a better solution, I'm Listening!!

thanks
 
Here is the way I found to do it :

*Create VM / same disk space +1G
*Boot on rescueCD
*Gparted on virtual disk to create partitions

*Rsync from 'old' VM:

rsync \
--stats \
--compress \
--recursive \
--times \
--perms \
--links \
--delete \
--verbose \
--owner \
--group \
--numeric-ids \
--hard-links \
--devices \
--exclude /proc/ \
--exclude /sys/ \
/ {$VMip}:/mnt/vda3

On my new VM :
*mount -o bind /dev/ /mnt/vda3/dev/
*chroot /mnt/vda3 /bin/bash

/usr/sbin/grub-mkdevicemap
/usr/sbin/update-grub2
/usr/sbin/grub-install

From here my server is almost migrated, I have to stop the production VM and boot on it with rescCD to Rsync with both VM down to get exactly the same VM.

I can restart the new one, with a limited downtime.

If you have a better solution, I'm Listening!!

thanks
Hi,
i think this is the only way to get the time short as possible, but i guess you need a little bit more than 10 min. downtime. If you have a lot of files it takes some time do build the filelist for rsync...
If your cpu aren't so powerfull, perhaps you are faster without "compress" - depends on your network.

Udo
 
Yes, I forgot to mention that I Rsync with the source running, and when it's finished, I stop it and rsync again. This way it's really fast :)