qemu-img: output file is smaller than input file ?

niuk

New Member
Feb 20, 2017
27
0
1
55
I am trying to convert PA-VM-KVM-8.0.0.qcow2 image to disk in the VM I just created (see VM config 101.conf). It says output file is smaller than input file , why ?

root@pve:/var/lib/vz/images# cat /etc/pve/nodes/pve/qemu-server/101.conf
bootdisk: virtio0
cores: 1
ide2: none,media=cdrom
memory: 2048
name: pan-os-8.0
net0: virtio=DE:5F:17:16:D1:3C,bridge=vmbr0
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=4c337c77-5489-40d5-8f21-3cb56f43e70a
sockets: 1
virtio0: local-lvm:vm-101-disk-1,size=16G
root@pve:/var/lib/vz/images# find / -name vm-101-disk-1
/dev/pve/vm-101-disk-1
root@pve:/var/lib/vz/images# ls -lh
total 1.9G
-rw-r--r-- 1 root root 1.9G Mar 17 09:22 PA-VM-KVM-8.0.0.qcow2
root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 local-lvm:vm-101-disk-1
qemu-img: Unknown protocol 'local-lvm'

root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 local-lvm:vm-101-disk-1
qemu-img: Unknown protocol 'local-lvm'

root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 /dev/pve/vm-101-disk-1
qemu-img: output file is smaller than input file
 

udo

Famous Member
Apr 22, 2009
5,865
161
83
Ahrensburg; Germany
I am trying to convert PA-VM-KVM-8.0.0.qcow2 image to disk in the VM I just created (see VM config 101.conf). It says output file is smaller than input file , why ?

root@pve:/var/lib/vz/images# cat /etc/pve/nodes/pve/qemu-server/101.conf
bootdisk: virtio0
cores: 1
ide2: none,media=cdrom
memory: 2048
name: pan-os-8.0
net0: virtio=DE:5F:17:16:D1:3C,bridge=vmbr0
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=4c337c77-5489-40d5-8f21-3cb56f43e70a
sockets: 1
virtio0: local-lvm:vm-101-disk-1,size=16G
root@pve:/var/lib/vz/images# find / -name vm-101-disk-1
/dev/pve/vm-101-disk-1
root@pve:/var/lib/vz/images# ls -lh
total 1.9G
-rw-r--r-- 1 root root 1.9G Mar 17 09:22 PA-VM-KVM-8.0.0.qcow2
root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 local-lvm:vm-101-disk-1
qemu-img: Unknown protocol 'local-lvm'

root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 local-lvm:vm-101-disk-1
qemu-img: Unknown protocol 'local-lvm'

root@pve:/var/lib/vz/images# qemu-img convert -O raw -p -n PA-VM-KVM-8.0.0.qcow2 /dev/pve/vm-101-disk-1
qemu-img: output file is smaller than input file
Hi,
does the qcow2-file fit in the logical volume?
Code:
qemu-img info /var/lib/vz/images/PA-VM-KVM-8.0.0.qcow2
lvdisplay /dev/pve/vm-101-disk-1
In this case the qcow2-file allready on the local storage (if defined as image-storage) - you can simply add them to config, like this:
Code:
mkdir /var/lib/vz/images/101
mv /var/lib/vz/images/PA-VM-KVM-8.0.0.qcow2 /var/lib/vz/images/101/vm-101-disk-1.qcow2
echo "virtio0: local:101/vm-101-disk-1.qcow2,size=16G" >> /etc/pve/nodes/pve/qemu-server/101.conf
# remove the line "virtio0: local-lvm:vm-101-disk-1,size=16G" in the config.
After the VM work, you can migrate the storage with the gui.

Udo
 
  • Like
Reactions: niuk
Jun 21, 2011
42
1
28
I had the same error ("output file is smaller than input file") while importing a vhd disk from external to a VM using Ceph storage target (with command "qm importdisk"). I solved by firstly converting from vhd to raw using "qemu-img convert" and then running "qm importdisk" worked!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!