VMware Cloud Community
gjbrown
Enthusiast
Enthusiast

storage usage not correct

I feel like a newbie asking this, I have a vm, with 2 drives 1x60gb 1x3.52TB, both are thin provisioned on a SAN.

looking in windows the server total usage is ~ 1.4TB, however in vcenter storage usage is showing 3.48.  This doesn't seem correct.  What am I missing?

Thanks,

GB

Reply
0 Kudos
8 Replies
sk84
Expert
Expert

Virtual disks in vSphere are provided as files at the storage layer and the file which hold the data is a binary file. This binary file do not change its size at will. Or, more exactly, these binary files can only grow (also with thin provisioned disks).

If you want to reduce the size of virtual disks, you would have to reorganize the entire blocks within this binary file. That only happens with a Storage vMotion since much effort is involved in this operation.

An example, to illustrate this behavior:

You create a 100 GB thin provisioned disk and attach it to a VM. Then you copy 50 GB of data to that disk. In the operating system and vSphere you will now see a disk usage of 50 GB. Then you delete 25 GB. In the OS you now only see an used capacity of 25 GB. In vSphere, however, you see an used capacity of 50 GB since the underlying binary file is still 50 GB large.

So, if you migrate the VM to another datastore, the size should match the size displayed in the OS again. At least, until it drifts apart again.

--- Regards, Sebastian VCP6.5-DCV // VCP7-CMA // vSAN 2017 Specialist Please mark this answer as 'helpful' or 'correct' if you think your question has been answered correctly.
Reply
0 Kudos
ChrisFD2
VMware Employee
VMware Employee

Edit - never mind, re-read your reply!

Regards,
Chris
VCIX-DCV 2023 | VCIX-NV 2023 | vExpert *** | CCNA R&S
Reply
0 Kudos
gjbrown
Enthusiast
Enthusiast

Hi Sebastian, thank you for the reply, however I have tried a storage vmotion, making sure to choose thin provision and still showing usage of 3.47TB.

GB

Reply
0 Kudos
ChrisFD2
VMware Employee
VMware Employee

Where in vCenter are you looking at the storage usage?

Has the guest ever used more than the 1.4TB that windows is showing?

vCenter will show you how much space that the OS has used on the disk, based on what the ESXi host is reporting.

If you have a 1TB disk and write 100GB to it, Windows will show 100GB, vCenter will show 100GB usage.

If you put an additional 800GB on it, Windows will show 900GB, vCenter will show 900GB.

If you then delete the 800GB from Windows, it will show 100GB used but vCenter will still show 900GB.

That is because on a thin provisioned disk, Windows will not reclaim storage blocks it has written to, it just marks them as available for write operations. As far as a host is concerned, the blocks have data on them still.

You would have to use sdelete or similar in Windows to punch zero's back onto the drive, then shut down the VM and run a vmkfstools command on the host to allow it to punch zero's back to it as well. It is a timely process.

Regards,
Chris
VCIX-DCV 2023 | VCIX-NV 2023 | vExpert *** | CCNA R&S
Reply
0 Kudos
gjbrown
Enthusiast
Enthusiast

Thanks ChrisFD, I am not sure if the drive was fully used at some point.  I did find this posting basically saying the same thing you are

https://community.hitachivantara.com/docs/DOC-1006003

I am running the sdelete now and it is taking a LOOONG time. Any guess on the vmkfstools timing? As long as the sdelete, just a few quick min, or could be hours?  I know you don't know my env so your answer would be a guess at this point, but any info would be appreciated.

Thanks for replying,

GB

Reply
0 Kudos
ChrisFD2
VMware Employee
VMware Employee

In my experience the vmkfstools takes just as long as sdelete. I've just had to run it on an Exchange server where the que file was eating up 1TB.

I have read that sdelete is hanging with version 2.0, it may be worth using the older 1.61 version.

SDelete hangs at 100%

Regards,
Chris
VCIX-DCV 2023 | VCIX-NV 2023 | vExpert *** | CCNA R&S
Reply
0 Kudos
gjbrown
Enthusiast
Enthusiast

so I am testing the process with my syslog server.  I deleted 100GB worth of older logs.  ran sdelete 2.0.2 (which was slow) then ran vmkfstools -K myvmdk  This did not seem to free up any free space with the view in vcenter.  I am seeing the storage usage on the summary tab of the vm within vcenter.  I even tried a storage vmotion after the above, with no change.

Thoughts?  (FYI, vmkfstools was about 3x faster than sdelete, but as the link ChrisFD2 mentions, 2.0.x seems to be much slower than 1.6)

Reply
0 Kudos
c0sm042
Contributor
Contributor

Hi Chris,

Thanks for this it was info. I wasn't even getting from VMware support.

"if you then delete the 800GB from Windows, it will show 100GB used but vCenter will still show 900GB"

Using the above if you were then to add 100GB would vCenter still show 900GB and Windows 200GB or would would vCenter show 1000GB and windows 200GB?

Cheers,

Jason C.

Reply
0 Kudos