[SOLVED] LVM Thick with ISCSI PVE 9.0.3

Jun 24, 2024
8
7
3
Hi,
i'm trying to use snapshot on LVM Thick over ISCSi. The snapshot corretly work if the VM is powered OFF, if the VM is powered ON i recieve the following error
Code:
snapshotting 'drive-scsi0' (OS-LVM:vm-111-disk-0.qcow2)
external qemu snapshot
Creating a new current volume with xx as backing snap
  Renamed "vm-111-disk-0.qcow2" to "snap_vm-111-disk-0_xx.qcow2" in volume group "OS-LVM-G0"
  Rounding up size to full physical extent <120.02 GiB
  Logical volume "vm-111-disk-0.qcow2" created.
Formatting '/dev/OS-LVM-G0/vm-111-disk-0.qcow2', fmt=qcow2 cluster_size=131072 extended_l2=on preallocation=metadata compression_type=zlib size=128849018880 backing_file=snap_vm-111-disk-0_xx.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
blockdev replace current by xx
snapshot create failed: starting cleanup
TASK ERROR: VM 111 qmp command 'blockdev-reopen' failed - Failed to find node with node-name='drive-scsi0'

Then, if i try to take one other snapshot with the same name

Code:
snapshotting 'drive-scsi0' (OS-LVM:vm-111-disk-0.qcow2)
snapshot create failed: starting cleanup
TASK ERROR: error rename vm-111-disk-0.qcow2 to xx - target volume 'snap_vm-111-disk-0_xx.qcow2' already exists

So checking in the shell the img-info i have as output

Code:
root@pve02:~# qemu-img info /dev/OS-LVM-G0/vm-111-disk-0.qcow2
image: /dev/OS-LVM-G0/vm-111-disk-0.qcow2
file format: qcow2
virtual size: 120 GiB (128849018880 bytes)
disk size: 0 B
cluster_size: 131072
backing file: snap_vm-111-disk-0_xx.qcow2 (actual path: /dev/OS-LVM-G0/snap_vm-111-disk-0_xx.qcow2)
backing file format: qcow2
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: true
Child node '/file':
    filename: /dev/OS-LVM-G0/vm-111-disk-0.qcow2
    protocol type: host_device
    file length: 120 GiB (128869990400 bytes)
    disk size: 0 B

To fix this i have to use
Code:
qemu-img rebase -f qcow2 -b "" /dev/OS-LVM-G0/vm-111-disk-0.qcow2

Then the lvs is still there

Code:
lvs | grep snap_vm-111-disk-0
  snap_vm-111-disk-0_xx.qcow2 OS-LVM-G0 -wi-a----- <120,02g

and i have to remove it with

Code:
lvremove OS-LVM-G0/snap_vm-111-disk-0_xx.qcow2
Do you really want to remove active logical volume OS-LVM-G0/snap_vm-111-disk-0_xx.qcow2? [y/n]: y
  Logical volume "snap_vm-111-disk-0_xx.qcow2" successfully removed.


The /etc/pve/storage.cfg
Code:
lvm: OS-LVM
        vgname OS-LVM-G0
        base OceanStor:0.0.1.scsi-SHUAWEI_XSG1_2102354CMHTUN29100040001
        content rootdir,images
        saferemove 0
        shared 1
        snapshot-as-volume-chain 1


Am i missing something? I'm not able to snapshot powered ON VMs.

Thanks
 
Last edited:
Hey,

Did you realize fine a live snapshot without RAM snapshoting ? or not ?
Not really in peace with your case, never experienced myself. But if LUN host'mounted, maybe an option needed ( really no idea on what needed for LVM2 on LUN)
 
Tried both, same result
Code:
snapshotting 'drive-scsi0' (OS-LVM:vm-111-disk-0.qcow2)
external qemu snapshot
Creating a new current volume with xx as backing snap
  Renamed "vm-111-disk-0.qcow2" to "snap_vm-111-disk-0_xx.qcow2" in volume group "OS-LVM-G0"
  Rounding up size to full physical extent <120.02 GiB
  Logical volume "vm-111-disk-0.qcow2" created.
Formatting '/dev/OS-LVM-G0/vm-111-disk-0.qcow2', fmt=qcow2 cluster_size=131072 extended_l2=on preallocation=metadata compression_type=zlib size=128849018880 backing_file=snap_vm-111-disk-0_xx.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
blockdev replace current by xx
snapshot create failed: starting cleanup
TASK ERROR: VM 111 qmp command 'blockdev-reopen' failed - Failed to find node with node-name='drive-scsi0'
 
Yes the VM is present since PVE 8.
Code:
qm config 111
agent: 1
bios: ovmf
boot: order=scsi0
cores: 4
cpu: x86-64-v2-AES
efidisk0: OS-LVM:vm-111-disk-1.qcow2,size=128K
ide2: none,media=cdrom
machine: pc-i440fx-8.1
memory: 8192
meta: creation-qemu=8.1.5,ctime=1718378025
name: W10-EoiP
net0: e1000e=00:0c:29:dc:ea:a6,bridge=vmbr0,tag=137
numa: 0
ostype: win10
scsi0: OS-LVM:vm-111-disk-0.qcow2,iothread=1,size=120G
scsihw: virtio-scsi-single
smbios1: uuid=564d2fe4-3a20-2e81-358c-5e5b2edceaa6
sockets: 1
tags: prod
vmgenid: 7418fccc-ee46-4059-9b30-ffece4c77b69

with a new vm the snapshot work correctly
Code:
()
snapshotting 'drive-scsi0' (OS-LVM:vm-118-disk-0.qcow2)
external qemu snapshot
Creating a new current volume with yy as backing snap
  Renamed "vm-118-disk-0.qcow2" to "snap_vm-118-disk-0_yy.qcow2" in volume group "OS-LVM-G0"
  Rounding up size to full physical extent <32.01 GiB
  Logical volume "vm-118-disk-0.qcow2" created.
Formatting '/dev/OS-LVM-G0/vm-118-disk-0.qcow2', fmt=qcow2 cluster_size=131072 extended_l2=on preallocation=metadata compression_type=zlib size=34359738368 backing_file=snap_vm-118-disk-0_yy.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
blockdev replace current by yy
blockdev-snapshot: reopen current with yy backing image
TASK OK



Code:
qm config 118
boot: order=scsi0;ide2;net0
cores: 1
cpu: x86-64-v2-AES
ide2: local:iso/mikrotik-7.16.1.iso,media=cdrom,size=64080K
memory: 2048
meta: creation-qemu=10.0.2,ctime=1754492853
name: Test
net0: virtio=BC:24:11:13:AD:80,bridge=vlan2,firewall=1
numa: 0
ostype: l26
parent: yy
scsi0: OS-LVM:vm-118-disk-0.qcow2,iothread=1,size=32G
scsihw: virtio-scsi-single
smbios1: uuid=d63f7c34-f15a-4469-ad2c-f4b9faee9440
sockets: 1
vmgenid: 8afc5627-e1c3-431b-bf16-36ce5c71e857
 
Last edited:
Tried with cold start and it fail, now i'm tring to upgrade the VM version to 10, and i will update the post

Code:
machine: pc-i440fx-8.1
to
Code:
machine: pc-i440fx-10.0
 
Last edited:
  • Like
Reactions: waltar
I suspect that the old VM is still running under old QEMU binary and needs a cold start.
Perhaps someone from Proxmox staff will confirm and will add this as a caveat.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Confirmed, upgrading to 10.0 fixed the problem

Code:
qm config 111
agent: 1
bios: ovmf
boot: order=scsi0
cores: 1
cpu: x86-64-v2-AES
efidisk0: OS-LVM:vm-111-disk-1.qcow2,size=128K
ide2: none,media=cdrom
machine: pc-i440fx-10.0
memory: 8192
meta: creation-qemu=8.1.5,ctime=1718378025
name: W10-EoiP
net0: e1000e=00:0c:29:dc:ea:a6,bridge=vmbr0,tag=137
ostype: win10
scsi0: OS-LVM:vm-111-disk-0.qcow2,iothread=1,size=120G
scsihw: virtio-scsi-single
smbios1: uuid=564d2fe4-3a20-2e81-358c-5e5b2edceaa6
sockets: 2
tags: prod
vmgenid: 38c55b44-3abb-4567-8e64-24513a57f816

Code:
QEMU Guest Agent is not running - VM 111 qmp command 'guest-ping' failed - got timeout
snapshotting 'drive-scsi0' (OS-LVM:vm-111-disk-0.qcow2)
external qemu snapshot
Creating a new current volume with zz as backing snap
  Renamed "vm-111-disk-0.qcow2" to "snap_vm-111-disk-0_zz.qcow2" in volume group "OS-LVM-G0"
  Rounding up size to full physical extent <120.02 GiB
  Logical volume "vm-111-disk-0.qcow2" created.
Formatting '/dev/OS-LVM-G0/vm-111-disk-0.qcow2', fmt=qcow2 cluster_size=131072 extended_l2=on preallocation=metadata compression_type=zlib size=128849018880 backing_file=snap_vm-111-disk-0_zz.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
blockdev replace current by zz
blockdev-snapshot: reopen current with zz backing image
snapshotting 'drive-efidisk0' (OS-LVM:vm-111-disk-1.qcow2)
external qemu snapshot
Creating a new current volume with zz as backing snap
  Renamed "vm-111-disk-1.qcow2" to "snap_vm-111-disk-1_zz.qcow2" in volume group "OS-LVM-G0"
  Rounding up size to full physical extent 4.00 MiB
  Logical volume "vm-111-disk-1.qcow2" created.
Formatting '/dev/OS-LVM-G0/vm-111-disk-1.qcow2', fmt=qcow2 cluster_size=131072 extended_l2=on preallocation=metadata compression_type=zlib size=131072 backing_file=snap_vm-111-disk-1_zz.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
blockdev replace current by zz
blockdev-snapshot: reopen current with zz backing image
TASK OK