VMware Cloud Community
uday1kiran
Contributor
Contributor

VMware ESXi decrease vmdk size

With vmware esxi product, below version details.

1.33.3

12923304

6.7.0

13006603

I have increased size of a virtual machine, with machine --> edit (edit settings) -->

pastedImage_0.png

WHen I increase the size, it is increased.

ANd it came into unpartitioned space of the windows 10 machine, I increased that using disk management to 400 GB.

Later, I shrinked the partition and kept the 200 GB as unparititoned space.

Now, when I try to decrease the space in the esxi settings, I am getting below error.

pastedImage_1.png

SO, please suggest me how to decrease the disk space.

Even, I tried by connecting to ssh to the esxi server and ran the below command to decrease disk size.

vmkfstools -X <new size> <virtual disk>.vmdk

But getting error as not a valid vmdk file.

Please suggest.

Same error with any machine.

Tags (3)
Reply
0 Kudos
4 Replies
scott28tt
VMware Employee
VMware Employee

Same question was asked yesterday: Is there a way to shrink a virtual disk safely within vSphere? (either ESXi or vCenter)


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
jburen
Expert
Expert

I have used the steps outlined in Shrink a VMware Virtual Machine Disk (VMDK) – virtualman one time. It worked but it is not supported as stated in this article: VMware Knowledge Base

Consider giving Kudos if you think my response helped you in any way.
Reply
0 Kudos
uday1kiran
Contributor
Contributor

Hi, this option is changing the value in esxi server webpage.

But when I checked the size of flat.vmdk file, it is still showing as the old size.

When I tried vmkfstools command to decrease, I am getting message as not a virtual disk

Reply
0 Kudos
NathanosBlightc
Commander
Commander

But getting error as not a valid vmdk file.

Does your VM have any snapshot?!

And are you aware about amount of filled space of that disk (VMDK file) inside the VM guest OS?  are you sure it's free enough to decrease to that required space level?!

Please mark my comment as the Correct Answer if this solution resolved your problem
Reply
0 Kudos