Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

my VM called "VMKASPER" (OS WINDOWS 2003, with a single 40 GB partition ), has generate the following files:

-rw------- 1 root root 30752720896 Feb 23 09:40 VMKASPER_1-000001-delta.vmdk
-rw------- 1 root root 334 Feb 17 15:23 VMKASPER_1-000001.vmdk
-rw------- 1 root root 4513155072 Oct 15 13:19 VMKASPER_1-000002-delta.vmdk
-rw------- 1 root root 301 Oct 15 07:51 VMKASPER_1-000002.vmdk
-rw------- 1 root root 4294967296 Feb 17 15:23 VMKASPER_1-8c5ecb4d.vswp
-rw------- 1 root root 4300436774 Oct 14 14:19 VMKASPER_1-Snapshot1.vmsn
-rw------- 1 root root 4300411192 Oct 15 13:29 VMKASPER_1-Snapshot2.vmsn
-rw------- 1 root root 42949672960 Oct 14 14:05 VMKASPER_1-flat.vmdk
-rw------- 1 root root 8684 Feb 23 04:33 VMKASPER_1.nvram
-rw------- 1 root root 475 Oct 14 14:05 VMKASPER_1.vmdk
-rw------- 1 root root 845 Oct 15 13:19 VMKASPER_1.vmsd
-rwxr-xr-x 1 root root 3068 Feb 22 14:08 VMKASPER_1.vmx
-rw------- 1 root root 1850 Feb 17 15:23 VMKASPER_1.vmxf
-rw-r--r-- 1 root root 1075649 Jan 4 15:40 vmware-26.log
-rw-r--r-- 1 root root 4924787 Jan 21 11:06 vmware-27.log
-rw-r--r-- 1 root root 219223 Jan 26 08:00 vmware-28.log
-rw-r--r-- 1 root root 62654 Jan 26 08:16 vmware-29.log
-rw-r--r-- 1 root root 942987 Feb 17 14:34 vmware-30.log
-rw-r--r-- 1 root root 66672 Feb 17 15:22 vmware-31.log
-rw-r--r-- 1 root root 292261 Feb 23 08:42 vmware.log

whats the better way to shrink the size of the VM ?

thaks for your help.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Lose the snaps and logs, then clone to a smaller vmdk if you need more savings.

share|improve this answer
1  
And never, ever leave VMware snapshots running for longer than a couple of days, a week or two at most. You seem to have at least one there that has been running for at least 5 months. –  Helvick Feb 23 '10 at 17:39
    
Good point, well made - although it always freaks me out that you can leave a NetApp snap lying around for ages with little performance degradation - it's feels against nature :) –  Chopper3 Feb 23 '10 at 17:59

As suggested by Chopper3, remove all unnecessary things such as log files (but they will come back pretty soon, so you might need a scheduled script for that or change the log rotation configurations) and snapshots.

If you are using growable virtual disks (VMWare Workstation and Server) you can also use the vmware-vdiskmanager tool (part of the VMware Virtual Disk Development Kit) to Shrink the disk:

Interesting options are:

-p : prepare the mounted virtual disk specified by the drive-letter for shrinking.

-k : shrink the specified virtual disk. Only local virtual disks may be shrunk.

This will regain some HDD space especially if you have been copying and deleting files and the disk usage shown by the OS is very different by the .vmdk file size.

My direct experience is with Windows hosts but this should be the same with Linux (which I understand you are using from the format of the "ls")

If you are using VMWware ESXi you should try the "thin provisioned virtual disk" (requires ESX 3.x and above).

Hope this helps :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.