ZFS Pool Import - Proxmox single host reinstall without full backup

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

If you want to reinstall a Proxmox single host, you have to take care of a backup of the hypervisor resources. However, if you are using ZFS as a data pool and can handle a downtime, you can also reinstall the Proxmox host without having to backup the VMs and containers beforehand. Note: This is ONLY the case if VMs and containers are not on the same devices as the Proxmox boot pool (rpool).

Baseline scenario

  • Proxmox ZFS Singlehost with VMs and containers
  • 1x ZFS Mirror Pool for Proxmox OS (2x SSD)
  • 1x ZFS RAIDZ2 Pool "zfs-data" for the VMs und containers (resources) (4x NVMe)

The following ToDos are necessary to reinstall the host.

Backup of VM/LXC configurations

Please backup all configuration files in these paths. These files represent the configuration files of the resources. They contain the names of the VMs / containers, what virtual hardware they use and what the virtual hard disks are called etc. If you do not backup these configuration files, all "shells" of the VMs and containers are missing - this is an essential step.

root@pmx02:/etc/pve/qemu-server# ls
100.conf  101.conf  102.conf  104.conf  106.conf  119.conf  132.conf

root@pmx02:/etc/pve/lxc# ls 103.conf

Other backups (optional)

Any other backups that may be reasonably necessary:

/etc/network/interfaces

/etc/hosts

/etc/pve/storage.cfg

Shutdown of all resources (VMs / containers)

Before reinstallation, all resources should be shut down so that the data is persistent and consistent.

New installation of Proxmox VE via ISO / USB

After the VMs are shut down, the host can be shut down and reinstalled. For this one must note that one may in no case select the disks of the ZFS DATA pool. Thus, when selecting the disk(s), make sure that you select the correct disk(s) for the ZFS mirror (in our case 2x SSD). If you select the wrong disks here, it can lead to data loss, because Proxmox deletes the disks that are selected here and overwrites them with PVE 7.X.

ZFS Pool Import of the data pool

After installing Proxmox VE you can import the old ZFS pool by entering the following command:

root@pmx02:~# zpool import -f zfs-data

Recovery of VM/LCX configurations

Now you have to use a tool (SCP, WINSCP...) to put the configuration files back into the directories accordingly. For VMs: /etc/pve/qemu-server For containers: /etc/pve/lcx

Set ZFS as datastore via GUI

The pool is now imported, but the VMs cannot yet be started because the storage definition is still missing. Therefore the imported ZFS pool zfs-data has to be added as datastore via GUI. Alternatively, you can add the definition part from /etc/pve/storage.cfg again, if you have backed up this in the previous step (optional).

alternatetext=









Conclusion

Now the VMs should be executable again and can be restarted (right click on the host --> Bulk Start helps here for a quick start of all VMs on the host).


Foto Jonas Sterr.jpg

Author: Jonas Sterr

Jonas Sterr has been working for Thomas-Krenn for several years. Originally employed as a trainee in technical support and then in hosting (formerly Filoo), Mr. Sterr now mainly deals with the topics of storage (SDS / Huawei / Netapp), virtualization (VMware, Proxmox, HyperV) and network (switches, firewalls) in product management at Thomas-Krenn.AG in Freyung.


Related articles

Enable Proxmox PCIe Passthrough
Proxmox Backup Server Support Subscriptions
ZFS cannot import rpool no such pool available - fix Proxmox boot problem