Script for searching unused disks:
Bash:
#!/bin/bash
echo "searching for unused disks...."
for vm in $(qm list | grep -v VMID | awk '{print $1}'); do
udisk=$(qm config $vm | grep vm-$vm-disk | grep unused) >> /dev/null
if [ "${udisk}" ]
then
echo "$vm has usused disks: $udisk"
udisk=""
fi
done