Link to home
Start Free TrialLog in
Avatar of Florentino Patino
Florentino Patino

asked on

How do I delete or consolidate VMDK files in my VMware without any snapshot points in manager

I have read several of your tutorials on how to delete snapshots, but I'm not sure if I read them too late. I have a centOS VM that has grown to a silly size. The contents of the folder that currently houses the vm is about 700GB. The data size of the vm should only be about 70gb tops. I do not see any snapshots in my manager, although I do see several large files in the directory that houses my vm. I tried "cloning" but the resulting file was almost 700GB. Not sure what to do. Please help.
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Welcome to Experts Exchange.

Okay, if you work with me, we can get this sorted.

I need two screenshots....so we can proceed.

1. Screenshot of the disk properties for the VM.

2. Screenshot of the VM Folder and it's files.
Avatar of Florentino Patino
Florentino Patino

ASKER

Thank you so much. I believe this is what you asked for.
DISK-PROPERTIES.JPG
VM-FOLDER-1.JPG
VM-FOLDER-2.JPG
VM-FOLDER-3.JPG
Can I check what hypervisor, you are using ?

VMware Workstation ?

The files 0001 and 0002 indicate that there is a snapshot present, and the disk properties also reveal that it is currently writing to a snapshot.
Yes, I'm  using VMware Workstation 12
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Delete will do.

Are there no snapshots listed in snapshot manager ?

if not, we can use a command, which will create a new disk, and merge all the snapshots into it.
Correct, when I create a new snapshot is present, but only the one. When I delete that one, the process goes very quickly (seconds). What would the command be to create a new disk to merge all snapshots?
Okay, so we are going to have to create a new virtual machine disk.

1. Power off the VM.
2. Exit VMware Workstation.
3. Open a command prompt.
Ok, I've done that, what's the command?
In the VMware Workstation folder is the following command

vmware-vdiskmanager.exe

Open in new window


You need to run the command at the command prompt with the following syntax

vmware-vdiskmanager.exe -r "CentOS 64-bit-000002.vmdk" -t 0 "CentOSNew 64-bit.vmdk"

Open in new window


This will create a new virtual machine disk CentOSNew 64-bit.vmdk, which will have the snapshots merged into it...

You can create a new VM, and add this file as the disk. Once you've tested your VM, you can delete the old files.
I had already tried this before. The resulting file was about 800GB. One question that hadn't come to mind to ask, is this file shrinkable once it has been created? OR does it somehow still house all the snapshots?
Correction, I had tried it with the file labeled (CentOS 64-bit-000001.vmdk) not the 000002 file you specified. Will that make the difference we need?
Yes, because 00002 is the last snapshot, e.g. all the snapshots, if you just use 000001, you could be missing data.

If you look at the virtual disk you have created it's 2.0TB. (max), so 800GB is only a portion of that, if the data in the virtual disk is 70GB, you must have 730GB unsed as a partition!

In that case you made the initial 2TB too large!

If you want to resize the disk, you will need to use VMware Converter, but this is the process to get rid of the snapshots.
OK, got it. That "empty" space was something I was not figuring was going to be used. Because originally the container was only 20GB so I figured it would "shrink" or "expand" as needed. MY mistake for assuming there. I'll go ahead and do as you instructed and report back. Just for my info, would "cloning" have the same effect as the command you are asking me to perform? I realize that command also changes the storage container to just one file vs several, but would cloning also consolidate the snapshots?
CLONE can consolidate the snapshots....but it could also just give you what you currently have as well!
If the size of the virtual machine disk is now too large.... it's because you originally set it to 2TB, and it's been expanding to it's maximum 2TB.

If you want to shrink it use VMware Converter.

I believe the snapshot issue has now been resolved.
You created a 2TB virtual machine disk, so the maximum space this virtual disk could occupy on your host disk is 2TB.

as the data in the OS partition grows, so will the disk on your host disk. Once it grows it will not shrink, because the sector has been marked used.

So you 70GB disk, and all it's backups have grown the disk to 700-800GB. This is because of the type of disk you have created.

if you had created a FIXED 70GB disk, you would have filled it up, and it could not grow.

Not caused by snapshots.
Andrew, Thanks for your help. In the end, as you said, it was not the snapshots that were causing the problem. The size of the VM was growing to meet the growing need of the software creating and not deleting its backup files. So there was indeed a growth in the size of the snapshots, but because of the VM was requiring more of the space I had originally assigned it. The instructions that you provided for consolidating the snapshots did work. But mine did not work until I created the new snapshot, then started the VM. I then shutdown the VM and deleted the newly created snapshot and the VMware proceeded to remove and consolidate every snapshot that was in that folder. Thank you so much again for all your help and patience.