VMware vSphere

 View Only
  • 1.  vmfs unmap command

    Posted Oct 23, 2019 06:41 PM

    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?



  • 2.  RE: vmfs unmap command

    Posted Oct 24, 2019 08:18 AM

    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



  • 3.  RE: vmfs unmap command

    Posted Oct 25, 2019 05:27 AM

    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?



  • 4.  RE: vmfs unmap command

    Posted Oct 25, 2019 06:32 AM

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



  • 5.  RE: vmfs unmap command

    Posted Oct 25, 2019 08:33 AM

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



  • 6.  RE: vmfs unmap command

    Posted Oct 25, 2019 09:29 AM

    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.



  • 7.  RE: vmfs unmap command

    Posted Oct 25, 2019 05:06 PM

    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?



  • 8.  RE: vmfs unmap command

    Posted Oct 26, 2019 06:57 PM

    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