Start VM from replicated ZVOL?

mailinglists

Active Member
Mar 14, 2012
420
36
28
Hi,

i have a PM cluster, where KVM VMs get replicated with ZFS using the GUI.
What would the official way to recover VM on another host from its ZVOL replica when the primary host is down?

I was thinking of getting ID.conf from backup (outside fromm PM) and installing it to /etc/pve/qemu-server/NEWID.conf, then changing the disk path and renaming the disk (which PM replicated) with zfs rename and start it.
 

Richard

Proxmox Staff Member
Staff member
Mar 6, 2015
719
25
28
Austria
Hi,

i have a PM cluster, where KVM VMs get replicated with ZFS using the GUI.
What would the official way to recover VM on another host from its ZVOL replica when the primary host is down?

I was thinking of getting ID.conf from backup (outside fromm PM) and installing it to /etc/pve/qemu-server/NEWID.conf, then changing the disk path and renaming the disk (which PM replicated) with zfs rename and start it.
In principle yes, when you are inside a Proxmox VE Cluster and there is no need for renaming the vm-id it is much simpler:
Code:
mv /etc/pve/nodes/<old-node>/qemu-server/<vm-id>.conf /etc/pve/nodes/<new-node>/qemu-server/.
and start.
 
  • Like
Reactions: mailinglists

guletz

Active Member
Apr 19, 2017
975
135
43
Brasov, Romania
Hi
I think this is not the safest way ;) Using this ... only move a vm.conf from node 1 (dead) to node 2 (still operational ) could be the way to disaster! If let say our valuable VM is started on node 2 ... and somehow our defunct nod1 will start ...and the replication from node1 to node2 will also start ... then someone will be very upset!

So I think the safe will be like this:
- when node 1 is dead, then go to node 2 and CHANGE your replicated vdisk from xxx-diskX with something else
- move your vm.conf from node 1 to node 2 and then change the vm id according with the vdisk id that you changed before

In this case, if node 1 will start and also the replication, it will not overwrite your data of the vm who is running on node2 (because it have another id)

Good luck!
 

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
4,763
316
83
I think this is not the safest way ;)
It is safe. pmxcfs has locks for this case to ensure this is an safe transaction.
Using this ... only move a vm.conf from node 1 (dead) to node 2 (still operational ) could be the way to disaster!
Yes and what else it suppose to do?
and the replication from node1 to node2 will also start
No, it will change the direction automatically. This means on the node where the vm.conf is the source of replication.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!