This post describes the process of migration from OpenVZ to Proxmox 5.2.

Because the standard migration process with a vzdump and pct restore (link https://pve.proxmox.com/wiki/Convert_OpenVZ_to_LXC) not work with Proxmox 5.


On OpenVZ:

  1. Do NOT STOP the VM (which must be migrated), stop the services (like MySQL and etc…) that can change data.

 

On Proxmox 5.2 Server:

  1. Create new CT (virtual machine) with the same OS as the virtual machine on which you are going to migrate;
  2. Login in to this virtual machine via ssh;
  3. Install rsync.
  4. Create file /root/exclude.txt with list of exclude dirs on Virtual Machine:
## ONLY FOR Cent 7 /usr/lib64. ***DO NOT USE WITH DEBIAN***
## ONLY FOR Cent 7 /usr/lib. ***DO NOT USE WITH DEBIAN***
/boot
/proc
/sys
/tmp
/dev
/var/lock
/etc/fstab
/etc/mtab
/etc/resolv.conf
/etc/conf.d/net
/etc/network/interfaces
/etc/networks
/etc/sysconfig/network*
/etc/sysconfig/hwconf
/etc/sysconfig/ip6tables-config
/etc/sysconfig/kernel
/etc/hostname
/etc/HOSTNAME
/etc/hosts
/etc/modprobe*
/etc/modules
/net
/lib/modules
/etc/rc.conf
/usr/share/nova-agent*
/usr/sbin/nova-agent*
/etc/init.d/nova-agent*
/etc/ips
/etc/ipaddrpool
/etc/ips.dnsmaster
/etc/resolv.conf
/etc/sysconfig/network-scripts
  1. Synchronize files of created VM with files on OpenVZ VM. Command:
# rsync --exclude-from="/root/exclude.txt" --delete --numeric-ids -avpogtStlHz --progress -e "ssh -p 22" root@IPADDRESSHERE:/* /
  1. You will also want to make sure you rename the getty target service otherwise you will never get a login prompt after rebooting:
# mv /etc/systemd/system/getty.target.wants/getty\@tty2.service /etc/systemd/system/getty.target.wants/getty\@tty1.service
  1. Restart the VM;
  2. Enjoy =)

 

source: https://bbrader.com/2017/11/20/openvz-to-kvm-migration-process/


Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *