Almost live migration between two differents nodes (version 3 --> 4 example) with NFS

whitewater

Member
Nov 26, 2012
107
0
16
france
Hello,
I migrate VMs from a cluster PVE 3 to a PVE 4.
Ideally, it should use a backup / restore of each VM from the old node proxmox 3 (A), to the new node proxmox 4 (B).

Here's an idea to have very little downtime :
Migrate hard drives between each node with NFS storage, then, stop VM on old node and restart it on the new.

Here a little tuto :
Node B : install and config NFS server.
Code:
apt-get install nfs-kernel-server

think nfs storage will be on /var/lib/vz/nfs :
Code:
mkdir /var/lib/vz/nfs

configuration for nfs, add this line to /etc/exports :
Code:
/var/lib/vz/nfs    <ip of client, node A>/24(rw,no_root_squash,anonuid=1000,anongid=1000,sync,no_subtree_check)

then restart the service :
Code:
service nfs-kernel-server restart

now add this nfs storage on both node with disk image attribute.

Then, for each VM :
- migrate hard drives node A to B by this NFS storage.
- In node B : Copy the VM conf file (or copy / paste to a new file) to /etc/pve/qemu-server, adjusting hard drives line in this file, for pointing to nfs storage, with VM number as folder, like "local storage".

For exemple, if you have :
Code:
virtio0: drbdr0:vm-102-disk-1,cache=writethrough,size=165964M

change it by :
Code:
virtio0: nfs:102/vm-102-disk-1,cache=writethrough,size=165964M

- When migration is finished, shutdown the VM on the node A. When it is stopped, start it on node B.
- Correct "start on boot" option if needed.
- Last migration of hard drive to another storage.

Et voila :)
certainly useful for other uses.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!