shrinking VM disks

Miguel

Member
Nov 27, 2017
44
0
11
49
Hi,

I am migrating from a server with Proxmox 4.4-18 with SATA drives to a
Proxmox 5.1-36 with SSD drives.

I am trying to get the best in performance. I already split OS and data
disk drives so /home folder is not being backed up by Proxmox, only OS.

Filesystem Size Used Avail Use% Mounted on
/dev/sda5 29G 17G 12G 58% /
tmpfs 8.3G 0 8.3G 0% /dev/shm
/dev/sdb1 50G 33G 14G 71% /home
/dev/sda1 504M 178M 301M 38% /boot
/dev/sda2 2.0G 75M 1.8G 4% /tmp

The sda drive was 250 Gb and I shrink it to 36 Gb. I have already zeroed
all sda partitions with dd but still after converting qcow2 following
this https://pve.proxmox.com/wiki/Shrink_Qcow2_Disk_Files the resulting
qcow2 file is 48 Gb, not 36-40 Gb.

Something am I missing?

On the other hand, a few more questions:

- Should I move to RAW format? Pros? Cons? I have read that backups take
longer but performance boost is better.

- Anything that I have to change in Proxmox settings when using SSD
instead of SATA?

Thanks!

Miguel
 
if you want performance use raw. if you wanna have qcow2 features and go on a small filesize or even (initial compressed) go qcow

now what you dont wanna do is using single drives for vhosts. the I7O load is gonna kill you once you start more then one machine let alone 5-10
i also recommend not using raid 5

on virtualisation you need i/o , so raid 10 is your friend.
raw is another friend

also give your vms a seperate swap disk
put system disks of vms if possible on ssds
always use raid, one single disk cannot handle the i/o properly
even simpel mirror disks does actually help (not at write but at reads)


otherwise you gonna lock up your machien if one vm needs todo heavy lifiting on the file side
worst case is doing stuff with many many many small files (ive one vm with a couple million of these)
a one disk system gonna give you a lot of waits there
 
But what about what am I asking?

Why am I not getting the real size in my qcow2 disks?

Any special settings for SSD?
 
qcow2 overhead ofc
you ened to compress that image for minimum space requirement
but you never get the same filesize as host disksize
because cqow2 saves much more in that image than raw

you have metadata, snapshots, etc. also it depends which blocksize you use and other factors.
so diskspace on the hsot is never quiet the same.

so yes raw uses less diskspace if you fully use vms space
qcow uses less space in total but still more than the vm
 
I ended up cloning the qcow2 disk with gparted into a second disk I created. For the record, make sure to copy the MBR. Now I have a qcow2 with a smaller disk size.