"qm importdisk" fails after importing .vmdk with "Can't deactivate LV '/dev/.../vm-103-disk-0: Logical volume .../vm-103-disk-0 in use."

Daerimin

New Member
Jul 8, 2021
7
0
1
46
pve-manager/7.0-11/63d82f4e

The source volume is a VMFS filesystem from which I have imported other .vmdk's. Destination drive is a single 1Tb drive, no hardware issues apparent. After issuing the command, the system reads through the entire file, outputting % Complete as it should, and when it reaches 100%, it sits for a moment, then dies with the above error, and deletes the newly-imported disk.

FYI: the "..." is a redacted placeholder for my actual VG (it's got a company name in it, so I can't show it).

I have done all the latest updates as of 8:00pm CST, 8/9. Any help would be appreciated.

Thank you!!
 
can you check while importing with 'lsof /dev/.../vm-103-disk-0' who else except the importdisk task has it open?
 
I've had it on "watch" - this is the only result:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
qemu-img 202521 root 10u BLK 253,12 0x1400000000 761 /dev/.../../dm-12
 
hmm, that's quite strange. is it reproducible if you try again?

if it is and you feel comfortable with that, you could edit /usr/share/perl5/PVE/QemuServer/ImportDisk.pm and add sleep(30); between the qemu_img_convert and deactivate_volume calls:
Code:
  72         PVE::QemuServer::qemu_img_convert($src_path, $dst_volid, $src_size, undef, $zeroinit);
  73         PVE::Storage::deactivate_volumes($storecfg, [$dst_volid]);

apt install --reinstall qemu-server will revert to the stock version again.