zfs zvol import to existing vm

magnum

Member
Aug 31, 2021
42
0
11
35
Hello,

i have a headache.. I swapped my server hardware and wanted to still use my zpool mirror tankr0 on two hdd and a new one rpool on two ssd. Unfortunately, i was able to import the tankr0 (zpool import -f tankr0) but my datasets/zvol are not possible to access. How can one take the 102-disk-0 from tankr0 and import it in vm 116?
Bash:
➜  qemu-server zfs list
NAME                             USED  AVAIL     REFER  MOUNTPOINT
rpool                            150G  64.7G      112K  /rpool
rpool/ROOT                      2.50G  64.7G       96K  /rpool/ROOT
rpool/ROOT/pve-1                2.50G  64.7G     2.50G  /
rpool/backup                     969M  64.7G      969M  /rpool/backup
rpool/ctdata                    8.69G  64.7G      136K  /rpool/ctdata
rpool/ctdata/subvol-106-disk-0  1.24G  10.8G     1.24G  /rpool/ctdata/subvol-106-disk-0
rpool/ctdata/subvol-107-disk-0   255M  7.75G      255M  /rpool/ctdata/subvol-107-disk-0
rpool/ctdata/subvol-107-disk-1   104M  11.9G      104M  /rpool/ctdata/subvol-107-disk-1
rpool/ctdata/subvol-108-disk-0  4.21G  3.79G     4.21G  /rpool/ctdata/subvol-108-disk-0
rpool/ctdata/subvol-115-disk-0   412M  7.60G      412M  /rpool/ctdata/subvol-115-disk-0
rpool/ctdata/subvol-118-disk-0  2.49G  27.5G     2.49G  /rpool/ctdata/subvol-118-disk-0
rpool/data                        96K  64.7G       96K  /rpool/data
rpool/vmdata                     138G  64.7G       96K  /rpool/vmdata
rpool/vmdata/vm-109-disk-0         3M  64.8G       56K  -
rpool/vmdata/vm-109-disk-1      33.0G  85.6G     12.2G  -
rpool/vmdata/vm-116-disk-0      39.2G  74.3G     29.6G  -
rpool/vmdata/vm-116-disk-1      66.0G  77.8G     52.9G  -
tankr0                          2.62T   909G      136K  /tankr0
tankr0/backup                     96K   909G       96K  /tankr0/backup
tankr0/basevol-110-disk-0       43.4M  7.96G     43.4M  /tankr0/basevol-110-disk-0
tankr0/basevol-111-disk-0        175M  7.79G      217M  /tankr0/basevol-111-disk-0
tankr0/ctdata                     96K   909G       96K  /tankr0/ctdata
tankr0/subvol-100-disk-0         377M  7.63G      377M  /tankr0/subvol-100-disk-0
tankr0/subvol-100-disk-1         115M  7.89G      115M  /tankr0/subvol-100-disk-1
tankr0/subvol-103-disk-0          96K  12.0G       96K  /tankr0/subvol-103-disk-0
tankr0/subvol-103-disk-1        1.52G  10.8G     1.23G  /tankr0/subvol-103-disk-1
tankr0/subvol-104-disk-0         104K  7.79G      217M  /tankr0/subvol-104-disk-0
tankr0/subvol-105-disk-0         213M  7.59G      418M  /tankr0/subvol-105-disk-0
tankr0/subvol-112-disk-0         705M  7.10G      920M  /tankr0/subvol-112-disk-0
tankr0/subvol-117-disk-0        2.84G  27.5G     2.50G  /tankr0/subvol-117-disk-0
tankr0/vm-101-disk-0               3M   909G       56K  -
tankr0/vm-101-disk-1            33.0G   930G     12.5G  -
tankr0/vm-102-disk-0            2.42T  1.75T     1.55T  -
tankr0/vm-102-disk-1            66.0G   922G     53.0G  -
tankr0/vm-102-disk-2            39.2G   918G     29.8G  -
tankr0/vm-113-disk-0            33.0G   940G     2.28G  -
tankr0/vmdata                   35.1G   909G       96K  /tankr0/vmdata
tankr0/vmdata/vm-116-disk-0     33.0G   942G       56K  -
tankr0/vmdata/vm-119-disk-0     2.06G   911G       56K  -
I
1695151590325.png
 
Last edited:
Hi, you can rename the disk to fit the new VMID, e.g. zfs rename tankr0/vm-102-disk-0 tankr0/vm-116-disk-1 and run a qm rescan. This will detect the disk and add it to the VM config as unused disk. From there, you can attach it to the VM again via the WebUI.
 
  • Like
Reactions: fromport

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!