Migrating disk from local-lvm to directory type storage and the disk image fill all the qcow2 image.

Gilberto Ferreira

Renowned Member
Hi there
I have a couple of vm using the local-lvm storage.
I attached a directory storage and when move the disk of the vm from local-lvm to the directory storage, using qcow2, the disk image fill all the qcow2 image.
Is that right?
For instance, I have a VM with has the disk image about 100G size, but the VM using only 50G.
In the Data column I saw 50% consumed with the lvs command.
But now, when I migrate the disk vm from local-lvm to the directory storage, the virtual disk and the disk itself are 100GB!
On the other hand, if I use raw format, then the disk image in the directory storage remains de same.
Any ideas?
Thanks.

[UPDATE]

I did a fstrim using qm guest cmd VMID fstrim and the disk size goes wild!

qemu-img info vm-102-disk-1.raw
image: vm-102-disk-1.raw
file format: raw
virtual size: 100 GiB (107374182400 bytes)
disk size: 0.981 TiB
Child node '/file':
filename: vm-102-disk-1.raw
protocol type: file
file length: 100 GiB (107374182400 bytes)
disk size: 0.981 TiB
 
Last edited:
The directory storage do not support thin provisioning.
Look at this https://pve.proxmox.com/wiki/Storage
Show your configuration of storage
Code:
cat /etc/pve/storage.cfg
dir: local
path /var/lib/vz
content backup,vztmpl,iso

lvmthin: local-lvm
thinpool data
vgname pve
content images,rootdir

pbs: BKP
datastore BKP
server 10.10.100.20
content backup
fingerprint blah
prune-backups keep-all=1
username admin@pbs

dir: VMS
path /vms
content images
preallocation off
prune-backups keep-all=1
shared 1
 
Last edited:
Please revmove fingerprint from you answer, at forum, it you security.

Yor machine are at local-lvm, type thinpool. Example VM declare 200G, data on this 1G. Real data is 1G
If you transfer from local-lvm to VMS (storage directory type) real data is 200G

/vms what mount at this?
You need to change this to something else that supports thin provisioning.
 
You need to change this to something else that supports thin provisioning.
As i said, new disk image works fine.
I was able to create a 1TB of size in the /vms mounted point, which has just about 900GB!
Already tried preallocation off, default, metadata and nothing changes when migra virtual disk from local-lvm to directory based storage.
 
Last edited:
So how to explain that I can create a virtual image with 1TB using qcow2 and directory based storage??

1722615868745.png

qemu-img info vm-104-disk-1.qcow2
image: vm-104-disk-1.qcow2
file format: qcow2
virtual size: 1 TiB (1099511627776 bytes)
disk size: 208 KiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
Child node '/file':
filename: vm-104-disk-1.qcow2
protocol type: file
file length: 208 KiB (212992 bytes)
disk size: 208 KiB
sda638:/vms/images/104# ls -lh
total 52G
-rw-r----- 1 root root 51G Aug 2 13:24 vm-104-disk-0.qcow2
-rw-r----- 1 root root 208K Aug 2 13:23 vm-104-disk-1.qcow2
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!