fvancrae
Contributor
Contributor

Manage Clean Up Disks does not reduce size of vmdk

I have a local (non shared) vm with a vmdk file of 700GB, at present only 160GB is used however and I wish to reclaim disk space.

The Disk cleanup functionality sees 536GB reclaimable but performing this operation returns a success after a few seconds however with an unchanged vmdk.


How can I reduce this vmdk?

Note A clone also did not reduce the vmdk. I am using the latest vmware workstation

 

0 Kudos
6 Replies
OTChan2021
Contributor
Contributor

Hi you do know? when you make a vmware drive it you

set it to grow etc or fixed size. but in it you format a partition

for your OS.. or many partitions. so windows 10 like a MBR

boot to a Partition that might be as big as your fixed drive

file for VM.. so you have to run tool like acronis.. to reduce

the OS partition before you can shrink the vm disk.

think of it like a container in a container.

 

I had a problem the other way. I needed more space

so I used it resize to add 2gb.. then I had to boot into

windows 10 with vmware and run partition soft like acronis 11

to resize it .. there. to get more space for files and storage

for the OS. 

all was good until it rebooted.. it found no operating system

.. it was set active.. and had boot record. but it took me days

to find out.. that theres some sort of VMware workstation pro 16

bug.. in the allocations of partitions. I managed to mount and

move the partition /resize it.. there was some unallocation space

576mb infront of the windows 10 partition.. and re-did the 

fixboot and mbr.. and it booted just fine after that. 

so unallocated space.. who thought cause a problem

I tried fixboot before moving 2nd time and failed to boot

but I know nothing to do with your problem but might come

across it later. 

0 Kudos
wila
Leadership
Leadership

Hi,


@OTChan2021 wrote:

Hi you do know? when you make a vmware drive it you

set it to grow etc or fixed size. but in it you format a partition

for your OS.. or many partitions. so windows 10 like a MBR

boot to a Partition that might be as big as your fixed drive

file for VM.. so you have to run tool like acronis.. to reduce

the OS partition before you can shrink the vm disk.

think of it like a container in a container.


The above is not correct.
You cannot reduce your virtual disk by size, if you try to do this manually you are completely on your own.
There's a reason that you cannot decrease size of the virtual disk in the user interface and that's because it is not supported.

You can however reclaim the unused disk space and that is often referred to as "shrink". What it will do is release empty space within the guest partition and give that space back to the host OS.
This only works for supported guest OS partition formats such as NTFS. Unpartitioned space cannot be automatically reclaimed.


--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
wila
Leadership
Leadership

Hi,

From the looks of the screenshot the VM is using windows 10.
Normally it should indeed be easy to reclaim and I would also expect a clone to be smaller.
As that is not the case, something is different...

A few questions:
- is your VM using snapshots? If so, getting rid of them normally helps (only do this if you have plenty of free space or your disk is using disk slices)
- is your VM using disk slices for its virtual disk or is it a single growable disk? Pre-allocated disks cannnot be shrunk
- is your VM perhaps using disk encryption? Encrypted disks cannot be shrunk as "Free space" looks no different from "Used space" from a reclaim point of view.
- can you show the partition layout of your VM?

FWIW, here's a link with alternative solutions and tips for shrinking virtual disks in a guest OS.
https://www.vi-toolkit.com/wiki/index.php?title=Shrink_guest_on_hosted_platform

edit: Another question.

- Was the VM created on VMware Workstation or does it come from somewhere else, like VMware vSphere?

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
fvancrae
Contributor
Contributor

Hi, Thanks for the feedback,

1. I have no snapshots on this VM

2. It is a single growable disk (not preallocated)

3. The disk is not encrypted, it is a vmware converter P2V copy

4. See the screenshots for the layout


Because vmware calculates the space it can reclaim and indeed reports that it should be able to reclaim 536GB I consider this a bug.

This is a virtualisation of my old development laptop. It did not run in vSphere.

 

I am performing the sdelete procedure you suggested now, I'll let you know if it works 

 

 

fvancrae_1-1622369465977.png

fvancrae_2-1622370011259.png

 

 

 

0 Kudos
fvancrae
Contributor
Contributor

The vmware-vdiskmanager shrink has finished and the operation succeeded.

 

λ "C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k lemmi.vmdk
It appears that the disk 'lemmi.vmdk' may be shared by more than
one VM with different snapshot information.
Shrink: 100% done.
Shrink completed successfully.

Result:  174,990,557,184 lemmi.vmdk

 

Thanks for the help

0 Kudos
wila
Leadership
Leadership

Hi,

You're welcome.


@fvancrae wrote:

λ "C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k lemmi.vmdk
It appears that the disk 'lemmi.vmdk' may be shared by more than
one VM with different snapshot information.


This part is a bit concerning and might explain why the original shrink didn't work.
It should have given you at least a warning..

Is the above true? Do you have another VM that also has this vmdk attached?
Does that second VM have snapshots open? If both questions are answered with "yes" then that other VM might now complain...

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos