Link to home
Start Free TrialLog in
Avatar of lolekbolek
lolekbolek

asked on

How to reclaim free space on a ESXi datastore?

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

VM-screenshot.png
datastore-screenshot.png
Avatar of Justin C
Justin C
Flag of United States of America image

The VM is still running off of a snapshot.  Can you post a screenshot of the Snapshot Manager window for this VM?
Avatar of Luciano Patrão
Hi

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

Check if this can fix you problem

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012383

Jail
Hi

Sorry forget to add the next link

http://virtrix.blogspot.com/2007/06/vmware-dreadful-sticky-snapshot.html

Its old, but can fix many problems with snapshots

Jail
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
Avatar of lolekbolek
lolekbolek

ASKER

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?
after-removing-ALL-snapshots-1.png
after-removing-ALL-snapshots-2.png
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.
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.
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?
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)
and
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.
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
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!
Veeam-screenshot.png
ASKER CERTIFIED SOLUTION
Avatar of bgoering
bgoering
Flag of United States of America 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