BUG in qm create after latest updates on pve-storage

macleod

Well-Known Member
Aug 3, 2017
66
8
48
47
Hello

I was using some scripts to create virtual machines. After latest updates on pve-storage packages qm create returns error when creating machines with more than one virtual disk on local-lvm storage.

Code:
# /usr/sbin/qm create 101 --name test --ostype l26 --cpu cputype=host --sockets 4 --cores 1 --numa no --memory 4096 --scsihw virtio-scsi-pci --scsi0 local-lvm:20,discard=on --scsi1 local-lvm:1,backup=no,replicate=no,discard=on --net0 virtio,bridge=vmbr0 --ide2 NFS-ISO:iso/debian-9.5.0-amd64-netinst.iso,media=cdrom --boot d --onboot yes
  Using default stripesize 64.00 KiB.
  Logical volume "vm-101-disk-0" created.
Use of uninitialized value $fmt in string ne at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.
Use of uninitialized value $fmt in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.
  Logical volume "vm-101-disk-0" successfully removed
unable to create VM 101 - unsupported format '' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.

Creating a VM with a single disk works fine:
Code:
# /usr/sbin/qm create 101 --name test --ostype l26 --cpu cputype=host --sockets 4 --cores 1 --numa no --memory 4096 --scsihw virtio-scsi-pci --scsi0 local-lvm:20,discard=on --net0 virtio,bridge=vmbr0 --ide2 NFS-ISO:iso/debian-9.5.0-amd64-netinst.iso,media=cdrom --boot d --onboot yes
  Using default stripesize 64.00 KiB.
  Logical volume "vm-101-disk-0" created.

Before the pve-storage package update everything was fine.
Proxmox 5, packages up-to-date.
ii libpve-storage-perl 5.0-27 all Proxmox VE storage management library
 
Last edited:
Makes sense (assuming recover = restore) - there the disks also get created simultaneously - resulting in the same bug.

Glad to hear the issue is resolved!
 
Same bug occur on vm cloning with multi disk.

VM with 2 disk on local-lvm (thin) clone into WhiteD-Baxk (thin)
Code:
cat 98117.conf
agent: 1
bootdisk: sata0
cores: 12
cpu: Skylake-Client
ide2: local:iso/virtio-win-0.1.112.iso,media=cdrom,size=55592K
localtime: 1
memory: 32768
name: Intex
net0: e1000=5E:54:1D:F4:CD:22,bridge=vmbr0,link_down=1
net1: virtio=62:C6:FE:24:48:80,bridge=vmbr1
numa: 0
onboot: 1
ostype: win8
parent: Snap_20180917_Orig
sata0: local-lvm:vm-98117-disk-0,size=320G
sata1: local-lvm:vm-98117-disk-1,size=640G
scsihw: virtio-scsi-pci
smbios1: uuid=d8d2f645-59ff-4c9f-aa39-bef089d993d1
sockets: 2
usb0: host=1058:25e2,usb3=1
usb1: host=1058:25e2,usb3=1

[Snap_20180917_Orig]
#Snap After Migration from Throne-Back
bootdisk: sata0
cores: 12
cpu: Skylake-Client
ide2: local:iso/virtio-win-0.1.112.iso,media=cdrom,size=55592K
machine: pc-i440fx-2.11
memory: 32768
name: Intex
net0: e1000=5E:54:1D:F4:CD:22,bridge=vmbr0,link_down=1
net1: virtio=62:C6:FE:24:48:80,bridge=vmbr1
numa: 0
onboot: 1
ostype: win8
sata0: local-lvm:vm-98117-disk-0,size=320G
sata1: local-lvm:vm-98117-disk-1,size=640G
scsihw: virtio-scsi-pci
smbios1: uuid=d8d2f645-59ff-4c9f-aa39-bef089d993d1
snaptime: 1537239596
sockets: 2
vmstate: local-lvm:vm-98117-state-Snap_20180917_Orig

Storage Status
Code:
pvesm status
Name                  Type     Status           Total            Used       Available        %
Container              dir   disabled               0               0               0      N/A
QNap-Container       iscsi     active               0               0               0    0.00%
WhiteD-Baxk        lvmthin     active      1170378752               0      1170378752    0.00%
local                  dir     active        65531436         2444428        59715184    3.73%
local-lvm          lvmthin     active      1057980416       859397491       198582924   81.23%

Clone task result
Code:
create full clone of drive sata0 (local-lvm:vm-98117-disk-0)
Using default stripesize 64.00 KiB.
Logical volume "vm-991117-disk-0" created.
drive mirror is starting for drive-sata0
drive-sata0: transferred: 0 bytes remaining: 343597383680 bytes total: 343597383680 bytes progression: 0.00 % busy: 1 ready: 0
drive-sata0: transferred: 80740352 bytes remaining: 343516643328 bytes total: 343597383680 bytes progression: 0.02 % busy: 1 ready: 0
...
drive-sata0: transferred: 343623860224 bytes remaining: 0 bytes total: 343623860224 bytes progression: 100.00 % busy: 0 ready: 1
all mirroring jobs are ready
create full clone of drive sata1 (local-lvm:vm-98117-disk-1)
Use of uninitialized value $fmt in string ne at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.
Use of uninitialized value $fmt in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.
drive-sata0: Cancelling block job
drive-sata0: Done.
  Logical volume "vm-990117-disk-0" successfully removed
TASK ERROR: clone failed: unsupported format '' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.

Plugin.pm patched
Code:
   528    my $get_vm_disk_number = sub {
   529        my ($disk_name, $scfg, $vmid, $suffix) = @_;
   530
   531        my $type = $scfg->{type};
   532        my $def = { %{$defaultData->{plugindata}->{$type}} };
   533        my $valid_formats = $def->{format}[0];
   534
   535        my $disk_regex = qr/(vm|base)-$vmid-disk-(\d+)$suffix/;
   536        $disk_regex = qr/(vm|base|subvol|basevol)-$vmid-disk-(\d+)/
   537        if $valid_formats->{subvol};
   538
   539        if ($disk_name =~ m/$disk_regex/) {
   540        return $2;
   541        }
   542
   543        return undef;
   544    };

but still not work on cloning.

add, pve version
Code:
pveversion -v
proxmox-ve: 5.2-2 (running kernel: 4.15.18-4-pve)
pve-manager: 5.2-8 (running version: 5.2-8/fdf39912)
pve-kernel-4.15: 5.2-7
pve-kernel-4.15.18-4-pve: 4.15.18-23
pve-kernel-4.15.17-1-pve: 4.15.17-9
corosync: 2.4.2-pve5
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.0-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-38
libpve-guest-common-perl: 2.0-17
libpve-http-server-perl: 2.0-10
libpve-storage-perl: 5.0-27
libqb0: 1.0.1-1
lvm2: 2.02.168-pve6
lxc-pve: 3.0.2+pve1-2
lxcfs: 3.0.0-1
novnc-pve: 1.0.0-2
proxmox-widget-toolkit: 1.0-19
pve-cluster: 5.0-30
pve-container: 2.0-26
pve-docs: 5.2-8
pve-firewall: 3.0-14
pve-firmware: 2.0-5
pve-ha-manager: 2.0-5
pve-i18n: 1.0-6
pve-libspice-server1: 0.12.8-3
pve-qemu-kvm: 2.11.2-1
pve-xtermjs: 1.0-5
qemu-server: 5.0-33
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.9-pve1~bpo9
 
Last edited:
@Sendiri: this was fixed in libpve-storage-perl 5.0-28
 
Code:
aptitude install libpve-storage-perl
The following packages will be upgraded: 
  libpve-common-perl libpve-storage-perl pve-manager 
3 packages upgraded, 0 newly installed, 0 to remove and 80 not upgraded.
Need to get 2107 kB of archives. After unpacking 39.9 kB will be used.
Do you want to continue? [Y/n/?] 
Get: 1 http://download.proxmox.com/debian/pve stretch/pve-no-subscription amd64 libpve-common-perl all 5.0-42 [92.8 kB]
Get: 2 http://download.proxmox.com/debian/pve stretch/pve-no-subscription amd64 pve-manager amd64 5.2-12 [1926 kB]
Get: 3 http://download.proxmox.com/debian/pve stretch/pve-no-subscription amd64 libpve-storage-perl all 5.0-32 [88.4 kB]                                       
Fetched 2107 kB in 6s (331 kB/s)

hope it will work.
 
Code:
create full clone of drive sata0 (local-lvm:vm-98117-disk-0)
Using default stripesize 64.00 KiB.
Logical volume "vm-991117-disk-0" created.
drive mirror is starting for drive-sata0
drive-sata0: transferred: 0 bytes remaining: 343597383680 bytes total: 343597383680 bytes progression: 0.00 % busy: 1 ready: 0
drive-sata0: transferred: 83886080 bytes remaining: 343513497600 bytes total: 343597383680 bytes progression: 0.02 % busy: 1 ready: 0
...
drive-sata0: transferred: 343635394560 bytes remaining: 0 bytes total: 343635394560 bytes progression: 100.00 % busy: 0 ready: 1
all mirroring jobs are ready
create full clone of drive sata1 (local-lvm:vm-98117-disk-1)
Using default stripesize 64.00 KiB.
Logical volume "vm-991117-disk-1" created.
drive mirror is starting for drive-sata1
drive-sata0: transferred: 343636180992 bytes remaining: 0 bytes total: 343636180992 bytes progression: 100.00 % busy: 0 ready: 1
drive-sata1: transferred: 0 bytes remaining: 687194767360 bytes total: 687194767360 bytes progression: 0.00 % busy: 1 ready: 0 
...
drive-sata0: transferred: 345855688704 bytes remaining: 0 bytes total: 345855688704 bytes progression: 100.00 % busy: 0 ready: 1
drive-sata1: transferred: 688080027648 bytes remaining: 0 bytes total: 688080027648 bytes progression: 100.00 % busy: 0 ready: 1
all mirroring jobs are ready
Qemu Guest Agent is not running - VM 98117 qmp command 'guest-ping' failed - unable to connect to VM 98117 qga socket - timeout after 31 retries
suspend vm
trying to acquire lock...
drive-sata0: Cancelling block job
drive-sata1: Cancelling block job
drive-sata0: Done.
drive-sata1: Done.
resume vm
trying to acquire lock...
found pending changes, discarding for clone
TASK OK

Cloning work like a charm. even there is some notif. but the cloning booting and working well.
thanks for the help!