How do shrink or remove files safely from my vm files?

sirius7
sirius7 used Ask the Experts™
on
I have a vmware server 2.0 running on a windows 2003 server and the files are out growing the host drive. I want eliminate some of the files but when I remove even one the vm won't boot and the file it is requesting access is not the file I deleted but a diff vm. The host server keeps running out of virtual memory even during boot.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Do you use Snapshots? Check Snapshot Manager?

Background reading of Snapshots....


A snapshot is NOT a backup of a VM; that is a gross misconception.  

A snap shot is a way to preserve a point in time when the VM was running OK before making changes. A snapshot is NOT a way to get a static copy of a VM before making changes.  When you take a snapshot of a VM what happens is that a delta file gets created and the original VMDK file gets converted to a Read-Only file.  There is an active link between the original VMDK file and the new delta file.  Anything that gets written to the VM actually gets written to the delta file.   The correct way to use a snapshot is when you want to make some change to a VM like adding a new app or a patch; something that might damage the guest OS. After you apply the patch or make the change and it’s stable, you should really go into snapshot manager and delete the snapshot which will commit the changes to the original VM, delete the snap, and make the VMDK file RW. The official stance is that you really shouldn’t have more than one snap at a time and that you should not leave them out there for long periods of time. Adding more snaps and leaving them there a long time degrades the performance of the VM.  If the patch or whatever goes badly or for some reason you need to get back to the original unmodified VM, that’s possible as well.  

I highly recommend reading these 2 articles on VMware Virtual Machine Snapshots:

Understanding Snapshots - http://kb.vmware.com/kb/1015180
Snaphot Best Practices - http://kb.vmware.com/kb/1025279

Also check out the following Snapshot Articles by Eric Siebert

Pt.1- http://is.gd/Lajg4p
Pt.2- http://is.gd/NdKQWC
Pt.3- http://is.gd/tp2vEK

Author

Commented:
ordered by date
i understand the snapshot deal. included pic of files after i created a snapshot todate

Author

Commented:
tried deleting some files but no matter which one I delete the vm wont start without it
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Can you start the VM?

What error message do you get?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
snapshots are present.

Author

Commented:
Just Deleted the snapshots. When I delete file mailsever-1 then it can't find mail server-1-0000
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Can you start the VM?

Please do not delete files, this is dangerous and you may lose data and the VM.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
what files have you deleted, and before you started randomnly deleting files, did the virtual machine startup and power on correctly?

Author

Commented:
It can power up, but the host has 50 mb of hd space left

Author

Commented:
Wasn't permanently removing them just moving out of datastore folder
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
The only way to remove a Snapshot, is to Delete them from the Menu.

Select Snapshot Manager, and Delete the Snapshot there.

Author

Commented:
I did, but I am still left with the space issue. I now have 75mb of hd space on the host. I have to beagle to get rid 1 of these files. Some of them have not been used since may of 2011. Can't I edit the vmx config file?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Do any snapshots show in the Snapshot Manager?

If not, complete the following:-

1. Create a new snapshot wait 60 seconds
2. Delete the snapshot.

this can be done when the VM is off.

Do you have any snapshots left in the folder?

Author

Commented:
No snapshots left. I deleted thru the vm mgr
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
okay, do you still have snapshot files growing on the disk though

sometimes you can have snapshots that are not listed.

complete this.

1. Create a new snapshot wait 60 seconds
2. Delete the snapshot.

this can be done when the VM is off.

Author

Commented:
I made sure that all files are visible and no other snapshots. Followed your instructions and no there are no Snapshots, but I'm still not able to remove any files. I need to find a way to shrink or remove some of these files
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
screenshot please
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
also how many disks attached to the VM, and screenshot of ALL disk settings in VM

Author

Commented:
vm pic
When you say disks attached to the vm (please be patient w/me) your referring to how many hard drives does the vm have? and disk settings? When you say disk settings are you referring to the vmx settings?

Author

Commented:
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
so it has four disks.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
vm is still running on snapshot.

you will need to use VMware Converter to complete a V2V which will create a new VM without this issue.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:

Author

Commented:
While doing as you asked I did begin to notice some differences as you will once you have viewed the excel file. Also I noticed some files not listed in the vmx files. But when I remove lets say the mailserver-1.vmdk the vm cant start and it states it cant find the MailServer_2-000001.vmdk. Of course I placed it back & no wit runs. But Im running out of files to delete

 vmsinfo.xlsx

Author

Commented:
I dont have any space to run the converter. in fact I had to uninstall it for space.

Author

Commented:
The total size of the vm folder is 336GB. Its an exchange server back-end. A vm that size will be converting for awhile. I cant afford to be offline which is why Im a lil nervous, but there is no way to edit the vmx either?  Should I create another vm to offload the work then convert?

Author

Commented:
can i add a usb storage device and make it a datastore then move the vm to it and have the vmware server 2.0 read from it?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
USB would be very slow.

I'm afraid those are you options, increase host datastore space, or use Converter.

YOU CANNOT REMOVE ANY FILES.
YOU CANNOT DELETE ANY FILES.

Currently the VM is in snapshot mode, and writing to snapshot disks, that will continue to grow and fill up the disk..

Author

Commented:
How do I snapshot mode?

Author

Commented:
Stop snapshot mode
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
It does not look like you can.

We've tried.

Author

Commented:
the host is on a dell poweredge 2850 with 6 scsi disks. I want to switch out one of the drives for a much larger drive so I can havce space to convert it. Any ideas?, but Im a little concerned that I will pull wrong the drive and it wont work.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
You need to raise a new question on swapping drives.
VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
Commented:
vmkfstools -i <most recent snapshot file name> /vmfs/volumes/<temp folder name>/<newfilename.vmdk>

at the console. (either via SSH or KVM)

Author

Commented:
cant go wrong listening to this guy

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial