Restore the VMs in ZFS storage after reinstalling the PVE system

nsc117

New Member
Jan 10, 2023
17
0
1
I'm doing a test
Simulate a scenario
The PVE system crashes without preparation
But the data in the ZFS storage is intact
I want to know
How to Restore the VMs in ZFS storage after reinstalling the PVE system.
I have done the following:
1.Reinstall the PVE system
2.Restore ZFS storage use “zpool import”
3.Add ZFS storage to the data center
What to do next?
thanks!
 
Do you have a backup of your VM configuration files? If you have a backup of the configuration files located in /etc/pve/nodes/{nodename}/{qemu-server,lxc}, then you just need to add them again on the new node (there is a symlink to the folder for the local configuration files located in /etc/pve/{qemu-server,lxc}). With those configuration files you should just be able to run the VMs again (if the ZFS storage has the same name as before).
 
  • Like
Reactions: lkProx
Do you have a backup of your VM configuration files? If you have a backup of the configuration files located in /etc/pve/nodes/{nodename}/{qemu-server,lxc}, then you just need to add them again on the new node (there is a symlink to the folder for the local configuration files located in /etc/pve/{qemu-server,lxc}). With those configuration files you should just be able to run the VMs again (if the ZFS storage has the same name as before).
I'm simulating a situation where there is no configuration file
 
I'm simulating a situation where there is no configuration file
Then you will have to recreate the VM configuration manually and reattach the disks. You can create a new VM with the same ID as the old one, then PVE should pick up the disks again after running qm disk rescan. If you create a VM with a different ID, then you will have to rename the disks as well [1].

Generally I would just suggest backing up the configuration files as well, as it saves a lot of hassle in this exact scenario.

[1] https://pve.proxmox.com/wiki/Moving...ine_to_another#Step_3:_Rename.2FMove_the_disk
 

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!