Undefined subroutine &PVE::Storage::DirPlugin::alloc_image at BTRFSPlugin.pm

NickB

Member
Sep 5, 2021
5
0
6
Edinburgh
While working through the Cloud-Init at https://pve.proxmox.com/wiki/Cloud-Init_Support to create a Template on my PVE7 system that is using BTRFS storage I get the following error:

Bash:
$ sudo qm set 100 --scsihw virtio-scsi-pci --scsi0 local-btrfs:100/vm-100-disk-0.raw
update VM 100: -scsi0 local-btrfs:100/vm-100-disk-0.raw -scsihw virtio-scsi-pci
$ sudo qm set 100 --boot c --bootdisk scsi0
update VM 100: -boot c -bootdisk scsi0
$ sudo qm set 100 --serial0 socket --vga serial0
update VM 100: -serial0 socket -vga serial0

$ sudo qm set 100 --ide2 local-btrfs:cloudinit
update VM 100: -ide2 local-btrfs:cloudinit
Undefined subroutine &PVE::Storage::DirPlugin::alloc_image called at /usr/share/perl5/PVE/Storage/BTRFSPlugin.pm line 312.
 
Hi,

You ran into a bit specific bug here, thanks for noticing us.

FYI: This corner case should be fixed in libpve-storage-perl version 7.0-11, currently available through our pvetest repository.
 
  • Like
Reactions: NickB
Hi,
I got similar problem on PVE 8 when trying to create template from VM:
Code:
root@pve-home:~# qm template 9000
Undefined subroutine &PVE::Storage::DirPlugin::create_base called at /usr/share/perl5/PVE/Storage/BTRFSPlugin.pm line 265.
root@pve-home:~# pveversion -v
proxmox-ve: 8.0.2 (running kernel: 6.2.16-19-pve)
pve-manager: 8.0.9 (running version: 8.0.9/fd1a0ae1b385cdcd)
pve-kernel-6.2: 8.0.5
proxmox-kernel-helper: 8.0.5
pve-kernel-5.15: 7.4-4
proxmox-kernel-6.2.16-19-pve: 6.2.16-19
proxmox-kernel-6.2: 6.2.16-19
proxmox-kernel-6.2.16-6-pve: 6.2.16-7
pve-kernel-6.2.16-3-pve: 6.2.16-3
pve-kernel-5.15.108-1-pve: 5.15.108-1
pve-kernel-5.15.102-1-pve: 5.15.102-1
pve-kernel-5.15.85-1-pve: 5.15.85-1
pve-kernel-5.15.74-1-pve: 5.15.74-1
ceph-fuse: 16.2.11+ds-2
corosync: 3.1.7-pve3
criu: 3.17.1-2
glusterfs-client: 10.3-5
ifupdown2: 3.2.0-1+pmx6
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-4
libknet1: 1.28-pve1
libproxmox-acme-perl: 1.5.0
libproxmox-backup-qemu0: 1.4.0
libproxmox-rs-perl: 0.3.1
libpve-access-control: 8.0.6
libpve-apiclient-perl: 3.3.1
libpve-common-perl: 8.0.10
libpve-guest-common-perl: 5.0.5
libpve-http-server-perl: 5.0.5
libpve-rs-perl: 0.8.7
libpve-storage-perl: 8.0.4
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 5.0.2-4
lxcfs: 5.0.3-pve3
novnc-pve: 1.4.0-2
proxmox-backup-client: 3.0.4-1
proxmox-backup-file-restore: 3.0.4-1
proxmox-kernel-helper: 8.0.5
proxmox-mail-forward: 0.2.1
proxmox-mini-journalreader: 1.4.0
proxmox-widget-toolkit: 4.1.1
pve-cluster: 8.0.5
pve-container: 5.0.5
pve-docs: 8.0.5
pve-edk2-firmware: 3.20230228-4
pve-firewall: 5.0.3
pve-firmware: 3.9-1
pve-ha-manager: 4.0.3
pve-i18n: 3.0.7
pve-qemu-kvm: 8.1.2-2
pve-xtermjs: 5.3.0-2
qemu-server: 8.0.8
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.2.0-pve3
 
Undefined subroutine &PVE::Storage::DirPlugin::create_base called at /usr/share/perl5/PVE/Storage/BTRFSPlugin.pm line 265.
I pushed a fix for the obvious bug when calling the (grand-)parent method here, but didn't fully re-tested your use case just yet, so it might be that this alone is not enough.
 
Hi,
Thanks, with your patch "qm template" works.
I got also timeout when using "qm disk resize" on btrfs volume, but looks like volume was resized.

Code:
root@pve-home:~# qm create 9001 --name debian12-cloudinit --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --machine q35
root@pve-home:~# qm set 9001 --scsi0 local-btrfs:0,discard=on,ssd=1,format=qcow2,import-from=/root/debian-12-generic-amd64.qcow2
update VM 9001: -scsi0 local-btrfs:0,discard=on,ssd=1,format=qcow2,import-from=/root/debian-12-generic-amd64.qcow2
transferred 0.0 B of 2.0 GiB (0.00%)
[...]
transferred 2.0 GiB of 2.0 GiB (100.00%)
scsi0: successfully created disk 'local-btrfs:9001/vm-9001-disk-0.raw,discard=on,size=2G,ssd=1'


root@pve-home:~# qm disk resize 9001 scsi0 8G
command '/usr/bin/qemu-img resize -f raw /var/lib/pve/local-btrfs/images/9001/vm-9001-disk-0/disk.raw 8589934592' failed: got timeout
root@pve-home:~#
 
Hello,

i can confirm that this issue still exist. i will forward it to bugzilla now. Its the same fail. Per API call the disk cant be resized AFTER Creation. Per dashboard it works somehow after creation. after the failed "qm resize", if i run "qm rescan" it will detect the new size. After that if i run a resize on the vm aigan via API it works. Wierd.
 

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!