VMware Cloud Community
Janies
Contributor
Contributor
Jump to solution

Delete old VMDK from Datastore

Hell VMWare gurus,

I have a file server that had this configuration (windows server 2012 R2)

E: drive = 6TB

:anguished_face: Drive = 3 virtual disks with 2 TB each

c:  Drive = 100 GB

Originally, it only had 2 drives..  C and E:.  But since we were looking into Azure Site Repication, it couldn't support a single drive over 4TB.  This is why I created :anguished_face: drive with 3 x 2TB drives.  I have since deleted and removed E: drive from the vm and would like to free up the 6TB from its Datastore.  How do I safely go about deleting the old vmdk so that I can reclaim the disk storage back.

1 Solution

Accepted Solutions
sjesse
Leadership
Leadership
Jump to solution

If its powered on, and if the drive is in use, vmware won't let you delete it. I'd make sure you have a good backup, but you can delete it. Another thing you may want to do to be sure is run a script like this

Orphaned files and folders - Spring cleaning - LucD notes

This will find any file that is not associated with a VM and tell you the location. If it shows up in that list its safe to delete, again to cover your self I'd make sure you have backups of anything you are going to delete.

View solution in original post

7 Replies
Debashish_Rath
Enthusiast
Enthusiast
Jump to solution

Hi,

You said you have deleted and removed the "E" Drive , you mean to say its only removed from the VM but it is still sitting in the Datastore.

Sincerely, Debashish Kumar Rath SkyLine Support Moderator
Reply
0 Kudos
SureshKumarMuth
Commander
Commander
Jump to solution

Is that a thin or think provisioned disk. If the virtual disk is thick provisioned then the data space will be automatically released.

Regards,
Suresh
https://vconnectit.wordpress.com/
Reply
0 Kudos
Janies
Contributor
Contributor
Jump to solution

HI Debashish,

I removed it from VM (From WIndows AND the vm settings). I should expect 6TB of disk space freed up from my datastore, but nothing has changed.  Can I delete the highlighted vmdk file?

pastedImage_0.png

pastedImage_1.png

Reply
0 Kudos
Janies
Contributor
Contributor
Jump to solution

Hello Suresh,

It is Thin provisioned.

Reply
0 Kudos
SureshKumarMuth
Commander
Commander
Jump to solution

If the disk is still shown in DS then you might have removed from the VM from settings rather deleting completely. If you are sure about the name of the disk, you can delete the disk from datastore browser. That will clear the space.

Regards,
Suresh
https://vconnectit.wordpress.com/
sjesse
Leadership
Leadership
Jump to solution

If its powered on, and if the drive is in use, vmware won't let you delete it. I'd make sure you have a good backup, but you can delete it. Another thing you may want to do to be sure is run a script like this

Orphaned files and folders - Spring cleaning - LucD notes

This will find any file that is not associated with a VM and tell you the location. If it shows up in that list its safe to delete, again to cover your self I'd make sure you have backups of anything you are going to delete.

daphnissov
Immortal
Immortal
Jump to solution

You're asking about reclaiming the space, previously occupied by a large VMDK file, from the datastore itself. For this, you will need to issue the UNMAP command to the datastore if it is VMFS-5. Starting with VMFS-6, the UNMAP command is issued automatically. For that, you will need to use the command esxcli storage vmfs unmap to issue the UNMAP to the datastore.