First of all, need to shrink the disk on OS, and move all data to top size of partition, means the free space will be in the bottom of partition.
Execute this command on PVE shell to reduce 40G. If current the disk size is 200G, after executed the command, it will become 160G.
qemu-img resize –shrink vm-103-disk-1.qcow2 — -40G
Update VM conf file on PVE shell. The configure file is located in /etc/pve/local/qemu-server. This is okay to use nano or vim to edit it, for example nano 103.conf.
On the configure file, there is a line to show something like local:vm-103-disk-1.qcow2,200G. Change 200G to 160G to reflect the new disk size after executed shrink disk command, and then save the configure file.
Go to PVE GUI to confirm the new disk size, and start the VM to confirm as well.