Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to reclaim free space on a ESXi datastore?

Posted on 2010-09-15
Medium Priority
Last Modified: 2012-05-10
I have two vm setup on ESXi (Windows 2003 and Ubuntu).  Both have their own datastores and we haven't used Ubuntu yet, so it almost empty.  Windows 2003 vm, however is constantly running out of space. I have this error:

 msg.hbacommon.outofspace:there is no more space for vurtual disk xxx Windows 2003-000002.vmdk.  You may be able to continue this session by freeing disk space on the relevant partition.

I used to have a few snapshots on this machine simultaneously, and after deleting them in vSphere client I seem to have some leftovers. As shown on attached screenshots, in addition to the Windows 2003.vmdk file, I have Windows 2003-000001, 000002 and 000003 files.  Windows 2003.vmx file (see attached) points to Windows 2003-000002 file, but I have no idea as to which files to delete or how else to reclaim free space.
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
nvram = "XXX Windows 2003.nvram"
deploymentPlatform = "windows"
virtualHW.productCompatibility = "hosted"
unity.customColor = "|23C0C0C0"
tools.upgrade.policy = "useGlobal"
powerType.powerOff = "soft"
powerType.powerOn = "default"
powerType.suspend = "hard"
powerType.reset = "soft"

displayName = "XXX Windows 2003"
extendedConfigFile = "XXX Windows 2003.vmxf"
floppy0.present = "TRUE"

numvcpus = "2"
scsi0.present = "TRUE"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
memsize = "2048"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "XXX Windows 2003-000002.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
ide0:0.present = "TRUE"
ide0:0.fileName = "CD/DVD Drive 1"
ide0:0.deviceType = "atapi-cdrom"
ide0:0.startConnected = "FALSE"
floppy0.startConnected = "FALSE"
floppy0.fileName = "Floppy Drive 1"
ethernet0.present = "TRUE"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.networkName = "Research Machine Network"
ethernet0.addressType = "generated"
ethernet1.present = "TRUE"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.networkName = "VM Network"
ethernet1.addressType = "generated"
guestOS = "winnetstandard"
uuid.location = "56 4d 6b 9c 28 39 0c 39-0a 6e 1e ce 73 00 3d 4c"
uuid.bios = "56 4d 6b 9c 28 39 0c 39-0a 6e 1e ce 73 00 3d 4c"
vc.uuid = "52 36 58 a8 25 0c b7 88-ac 16 a8 88 81 94 ec 49"
sched.cpu.min = "0"
sched.cpu.units = "mhz"
sched.cpu.shares = "normal"
sched.mem.minsize = "0"
sched.mem.shares = "normal"

ethernet0.generatedAddress = "00:0c:29:00:3d:4c"
ethernet1.generatedAddress = "00:0c:29:00:3d:56"
tools.syncTime = "FALSE"
cleanShutdown = "FALSE"
replay.supported = "FALSE"
sched.swap.derivedName = "/vmfs/volumes/4b97d46e-0e4e6f50-05ff-001b242daf36/XXX Windows 2003/XXX Windows 2003-79b83bab.vswp"
scsi0:0.redo = ""
vmotion.checkpointFBSize = "4194304"
ethernet0.generatedAddressOffset = "0"
ethernet1.generatedAddressOffset = "10"
hostCPUID.0 = "0000000168747541444d416369746e65"
hostCPUID.1 = "00040f320002080000002001178bfbff"
hostCPUID.80000001 = "00040f320000034f0000001febd3fbff"
guestCPUID.0 = "0000000168747541444d416369746e65"
guestCPUID.1 = "00040f320000080000002001078bbbff"
guestCPUID.80000001 = "00040f320000034f00000009ebd3bbff"
userCPUID.0 = "0000000168747541444d416369746e65"
userCPUID.1 = "00040f320002080000002001078bbbff"
userCPUID.80000001 = "00040f320000034f00000009ebd3bbff"
evcCompatibilityMode = "FALSE"

ethernet1.startConnected = "FALSE"

guestOSAltName = "Microsoft Windows Server 2003, Standard Edition (32-bit)"

checkpoint.vmState.readOnly = "FALSE"
checkpoint.vmState = ""

Open in new window

Question by:lolekbolek
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +1
LVL 10

Expert Comment

ID: 33685905
The VM is still running off of a snapshot.  Can you post a screenshot of the Snapshot Manager window for this VM?
LVL 24

Expert Comment

by:Luciano Patrão
ID: 33685912

First, have create some virtual disks, then removed? Before, or after a snapshot?

Check if this can fix you problem

LVL 24

Expert Comment

by:Luciano Patrão
ID: 33685935

Sorry forget to add the next link

Its old, but can fix many problems with snapshots

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 28

Expert Comment

ID: 33686342
You need to clean up your snapshots - but you will need some free space in order to clean up the snapshots. This is because when deleting the snapshot vmware will merge changes from the snapshot back into the base disk before deleting the snapshot disk, then repeat that operation for each snapshot level that is defined. The extra space is required for the merge operation.

Often that is kind of difficult if you have no free space to give. If you have additional space laying around consider adding an extent to the datastore that is hosting your Windows vm. If not you may be able to get by with using vmware converter (free download from web site) to convert your ESXi based Windows vm to another platform like VMware Workstation. The convert process will also merge the changes, but do it on the destination. Don't worry if you don't have VMware Workstation, you won't need it because it is just creating files on your disk that define the vm as if you were to run it on VMware server.

At this point I would download the free VMware player application and power up your converted VM for a sanity check that it is indeed all there and looks as you would expect.

After that conversion is completed successfully and you have verified it with VMware player, you can completely delete your source ESXi vm and free up all of its space on the datastore.

Finally use converter again, and this time go the other way with the source as your offline image, and the destination as your ESXi server.

Good Luck

Author Comment

ID: 33687247
Thank you for the suggestions.  I followed them - adding a snapshot and then going to Snapshot Manager -> Delete All.  It took two hours to delete it, but it showed task status as "complete" in vSphere Client and there is nothing shown in Snapshot Manager (see attached).

However, my disk is still almost full.  The only thing that changed, I now have a very tiny file named "XXX Windows 2003-000004.vmdk" and VM -> Edit Settings now points the virtual drive to this file and not the "XXX Windows 2003-000002.vmdk" as before.  Does it mean that it is safe to delete:

"XXX Windows 2003-000001.vmdk"
"XXX Windows 2003-000002.vmdk"
"XXX Windows 2003-000003.vmdk"

or/and should I try the VMware vCenter Converter as suggested above? Because having the virtual drive pointing to a 000004.vmdk instead of the original one is not right?
LVL 28

Expert Comment

ID: 33687347
Nothing so far as snapshots are safe to delete manually... You can do it, and point your .vmx file back to your base disk, but you will lose all changes since the first snapshot was created. Most folks don't want that.
LVL 28

Expert Comment

ID: 33687357
If you have vCenter server (not the free ESXi) you could also try cloneing the vm to to another datastore if you have one with more room - rather than the converter method I posted earlier.

Author Comment

ID: 33687390
Hi bgoering, thank you.  In my situation, could I delete the -0000x files and then export the VM so I can import it (as a substitute for a snapshot)?

And one more question - shall I just rename the

scsi0:0.fileName = "XXX Windows 2003-000004.vmdk"

line in .vmx to point to "XXX Windows 2003.vmdk"?  Is it ok that it had no word "-flat" in the name?
LVL 28

Expert Comment

ID: 33687420
If you don't mind losing the data you can do that. If you have both a

XXX Windows 2003.vmdk (would be a small descripter file)
XXX Windows 2003-flat.vmdk (would be size of virtual disk)

keep them both and point .vmx to XXX Windows 2003.vmdk

If you only have a large XXX Windows 2003.vmdk that is all you need to keep.

Note that you can't really trust the datastore browser as sometimes it doesn't show you the flat files, from the console go to the datastore and do a "ls" to see what is there.
LVL 28

Expert Comment

ID: 33687444
A process I use to back up running vms on a free ESXi is as follows:

Using Veeam FastSCP

1. Delete (commit) all snapshots - will leave just the base disk
2. Create a snapshot - freezes I/O to base disk and points .vmx to new snapshot
3. Back up VM folder except the new -00001 file and .vmx using Veeam FastSCP
4. Delete the snapshot you just created for the backup - points .vmx back to base disk
5. Back up .vmx file using Veeam FastSCP

Doing this leaves everything in the correct state where if you need to restore you just copy the entire backup folder back to ESXi and add vm to inventory and go

Good Luck

Author Comment

ID: 33688780
Thank you again, bgoering.  I am much closer now, but have a couple steps in your process to clarify.

Should the vm be running when I delete/create snapshots?
Do I have to do your steps 1 and 2 using FastSCP or the ESXi Snapshot Manager?

I've already created a screenshot and used "Delete All" (both using Snapshot Manager).  After this, the scsi0:0.fileName in .vmx is pointing to a new file "XXX Windows 2003-000004.vmdk" (a snapshot file?)  I've backed up the whole directory using FastSCP (great app - thanks a lot).  Where I'm stack is what files on the attached FastSCP screenshot can I delete and in what order.

Sorry to bug you, I am almost done!
LVL 28

Accepted Solution

bgoering earned 2000 total points
ID: 33691915
Taking the questions in order - It doesn't make any difference if the vm is running or not to create and delete snapshots. Steps 1 & 2 are done using the snapshot manager. If you are willing to have the vm down while backing it up most of the process isn't necessary. If the vm is down you can just copy off the entire folder then bring it back up.

You are having trouble with the delete process because you are out of space on your datastore - so changes can't be merged back in. You largest snapshot is the -000001 at 24.50 GB, so if you are willing to lose the data you can manually delete all of the -00000* files and point the vmx to the base disk.

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
A look into Log Analysis and Effective Critical Alerting.
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question