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
 
To be honest, I'm a little upset by this situation. In VMware (ESXi, etc) products, the virtual machine is a package all in itself. If you reinstall the hypervisor, you don't have any problems. Just connect the old storage and connect the virtual machines back. All information about the virtual machine is in its folder, it's fast and convenient. I just reinstalled Proxmox, logically saving the old storage, and suddenly I find out that I had to save some config from the system disk. Why is this done, God, who came up with this? It's illogical and inconvenient, isn't it?
 
Can the ZFS disk recovery be done? Do you have the steps? Cheers.
This is an old thread. Usually it is recommended to open a new one for a new problem.

Please describe your problem with some details about the system setup and about your actual problem.

In advance: do you have a ZFS pool with only a single disk? Then there is zero redundancy --> if that disk fails, the data is (probably) gone.
 

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!