Main disk issue

jordan_dig

New Member
Feb 9, 2023
6
0
1
Good morning,
The disc where Proxmox was installed has just died.
The disks of my VMs were stored on a ZFS raid, is it possible to reinstall Proxmox on a new disk while restoring the disks of my VMs and recreate them?
 
Yes, you can import that old ZFS pool after installing PVE (see "zpool import" command) and then add it as a storage (PVE webUi at Datacenter -> Storage -> Add -> ZFS). But those only contain the virtual disks of the VMs. A VM also needs all the config file which were stored in the /etc/pve folder on your failed system disk. I guess you didn't backup that /etc/pve folder or the /var/lib/pve-proxy/config.db? In that case you would need to create new VMs from scratch (without disks) using the same settings (or they won't boot/work) and then attach the old virtual disks to them. For that you would need to rename the virtual disks and then run the "qm rescan" command.
Or in case you got backups of your VMs, you could extract the config file from there.
 
Last edited:
  • Like
Reactions: jordan_dig
Yes, you can import that old ZFS pool after installing PVE (see "zpool import" command) and then add it as a storage (PVE webUi at Datacenter -> Storage -> Add -> ZFS). But those only contain the virtual disks of the VMs. A VM also needs all the config file which were stored in the /etc/pve folder on your failed system disk. I guess you didn't backup that /etc/pve folder or the /var/lib/pve-proxy/config.db? In that case you would need to create new VMs from scratch (without disks) using the same settings (or they won't boot/work) and then attach the old virtual disks to them. For that you would need to rename the virtual disks and then run the "qm rescan" command.
Or in case you got backups of your VMs, you could extract the config file from there.
Hi, tanks for your answer !
I don’t have any backup, so it is possible to do without them ?
 
Last edited:
Hi, tanks for your answer !
I don’t have any backup, so it is possible to do without them ?
Then you should set up backups for the future and create new VMs and try to reuse the old disks. But if you don't remember the old configs (OVMF/SeaBIOS, vortioSCSI/virtio-block/SATA/IDE, preenrolledkeys yes/no, ...) they won't work.
 
  • Like
Reactions: jordan_dig
Then you should set up backups for the future and create new VMs and try to reuse the old disks. But if you don't remember the old configs (OVMF/SeaBIOS, vortioSCSI/virtio-block/SATA/IDE, preenrolledkeys yes/no, ...) they won't work.
Okay, thank you very much.
 
Yes, you can import that old ZFS pool after installing PVE (see "zpool import" command) and then add it as a storage (PVE webUi at Datacenter -> Storage -> Add -> ZFS). But those only contain the virtual disks of the VMs. A VM also needs all the config file which were stored in the /etc/pve folder on your failed system disk. I guess you didn't backup that /etc/pve folder or the /var/lib/pve-proxy/config.db? In that case you would need to create new VMs from scratch (without disks) using the same settings (or they won't boot/work) and then attach the old virtual disks to them. For that you would need to rename the virtual disks and then run the "qm rescan" command.
Or in case you got backups of your VMs, you could extract the config file from there.
Hello,
How do I attach the disk contained in the zfs pool to a VM? And how do I rename it ?
 
How do I attach the disk contained in the zfs pool to a VM?
You setup the storage (Datacenter -> Storage -> Add), rename the virtual disks to match the VMID and empty virtual port ("scsi1" or whatever controller you use and what is not in use), run the "qm rescan" or "pct rescan" commands.
Then the VM/LXC should show the disk as "unattached" and you can edit that disk to attach it.
And how do I rename it ?
Depends on your storage. Directory/NFS/SMB you could just rename the image file. ZFS you would work with the "zfs rename" command and LVM with the "lv rename" command.
 
You setup the storage (Datacenter -> Storage -> Add), rename the virtual disks to match the VMID and empty virtual port ("scsi1" or whatever controller you use and what is not in use), run the "qm rescan" or "pct rescan" commands.
Then the VM/LXC should show the disk as "unattached" and you can edit that disk to attach it.

Depends on your storage. Directory/NFS/SMB you could just rename the image file. ZFS you would work with the "zfs rename" command and LVM with the "lv rename" command.
I remember the VM IDs (I had VMs from 100 to 103) I don't need to rename the disks?
 

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!