VMware Cloud Community
chenchen30
Contributor
Contributor

vmfs unmap command

Hi

esxi 5.5. Thin Provision

I have delete a lot of guest os files.

VMDK file is still big.

I understand i need to run esxcli storage vmfs unmap command in order to unmap the deleted blocks.

What will happen then? the VMDK will be smaller, so the SAN (EMC) will also reclaim it's space?

What would happen if i won't run it? does the dead block will be re-used by the SAN ? Or should the LUN will consume more space?

Reply
0 Kudos
7 Replies
tayfundeger
Hot Shot
Hot Shot

Unused blocks are returned when you run unmap. This opens the unused space in storage. You can use the Unmap command at any time. There is no negative impact on the virtual machine.

The command is as follows.

esxcli storage vmfs unmap -l DATASTORE-NAME

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.
chenchen30
Contributor
Contributor

Thanks.

I am curious to know what happens as default behavior if I don't use that one?

Will these blocks will be reuse by storage? or are they "dead" forever?

Reply
0 Kudos
tayfundeger
Hot Shot
Hot Shot

these blocks will be returned to the storage side, so they will be available again.

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.
Reply
0 Kudos
chenchen30
Contributor
Contributor

So, if they will be returned as default, why do i need to run unmap then?

Reply
0 Kudos
sjesse
Leadership
Leadership

No they aren't returned by default, that's what the unmap command does. When you run the unmap command your letting the array know you don't need to reserve that space anymore, and something else can use it.

Reply
0 Kudos
chenchen30
Contributor
Contributor

Is that also relevant for deleting guest os files? for example, after massive SQL data deletes?

Because thin provision VMDK itself, by definition, doesn't reclaim it's space to vsphere.

So will unmap have any impact here?

Reply
0 Kudos
tayfundeger
Hot Shot
Hot Shot

After deleting the files in the operating system, you need to use the punchzero command to reduce the vmdk size.

VMKFSTOOLS –Punchzero | Shrink VMDK | VMware Virtualization Blog

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.
Reply
0 Kudos