Cause I like been a rebel here is the way to do it with just ESXi/vSphere and Linux tools. The below instructions is with a CentOS machine. As always test this with a test machine before you try it on a real system. Always make a backup before you do this. I'm not responsible for your data loss. This was tested on vSphere/ESXi 6.5.
Shrinking a physical volume in VMWare (LVM2)
1. Boot your system with a LiveCD
2. Open terminal window
3. Run a FSCK on the volume you are going to shrink
sudo e2fsck -pfv /dev/mapper/VolGroup-lv_root
4. Use LVREDUCE to reduce the logical volume size to something a little lower than what is intended. In my case I want to make it 40GB, but since I can always extend I will choose 38GB to give myself some room.
sudo lvreduce -L 38G -resizefs -v /dev/mapper/VolGroup-lv_root
5. Now lets resize the physical volume to 39GB (sda2 is the physical volume with the LVM partition)
sudo pvresize --setphysicalvolumesize 39G -v /dev/sda2
6. Shutdown your VM.
7. While in ESXi or vSphere remove the VM from inventory
8. Log into the ESXi server via SSH
9. Go to the desired location of the VM
cd /vmfs/volumes/VM_DATASTORE_1/testvm/
10. vi the vmdk file, NOT the file with FLAT on it
vi testvm.vmdk
11. Use the following formula with the new size you want to use. In this case I will use 40GB for X
Formula [X * (1024 * 1024 * 1024)] / 512 = X = Resulting Size in GB
12. On the RW line you will see a big number, remove this number and use the following formula to get the right size for 40GB:
for 40GB the number is 83886080
So the line should look like so:
RW 83886080 VMFS "testvm-flat.vmdk"
Save and exit to the command line
13. Now shrink the vmdk to a new file
vmkfstools -i testvm.vmdk -d thin shrunk-testvm.vmdk
14. Now backup the original to a new file
vmkfstools -E testvm.vmdk orig-testvm.vmdk
15. Now replace the base file with the shrunk version
vmkfstools -E shrunk-testvm.vmdk testvm.vmdk
16. Reregister your VM in ESXi or vSphere again
17. Boot your system via your regular OS.
18. Resize the physical volume
sudo pvresize /dev/sda2
18. Use lvextend with resize2fs to extend the logical volume to the physica dimensions of the disk.
sudo lvextend -resizefs -extents +100%FREE /dev/mapper/VolGroup-lv_root
Hope this helps someone.