I have one VM running Windows server 2012 R2. Now C: drive is full and can't expand space because of snapshot. Can I expand without deleting the snapshot or how to delete snapshot safely ?
-
3VMFS snapshots shouldn't be kept for more than 48-72 hours, long-term snaps often introduce significant or unrecoverable corruption - it's not a backup system – Chopper3 Feb 08 '19 at 09:04
2 Answers
You can't extend a virtual disk as long as it has a snapshot.
Just delete the snapshot, it is a safe procedure. Just make sure you delete it via the interface, don't delete files on the datastore directly.
One word of warning though: Your machine will be frozen during the time it takes to delete the snapshot. If your snapshot is large (tens or even hundreds of gigabytes) this might take time, up to several hours.
If this is the case and you want to prevent downtime of your service, there is a nice simple trick to prevent this:
- Take a new snapshot (you can have multiple snapshots of a VM)
- Delete the large snapshot. Since the VM writes all changes to the disk file of the newly created snapshot, your machine will continue to work instead of freezing
- After the large snapshot is deleted, delete the new one. Since it shouldn't have become that large in the time it took to delete the large snapshot, this should be quite quick.
Never keep a snapshot longer than a few days. Snapshots are not meant as a long term backup.

- 23,274
- 8
- 57
- 89
The VMware Knowledge Base: "Best practices for using snapshots in the vSphere environment (1025279)" recommends:
When using a third-party backup software, ensure that snapshots are deleted after a successful backup.
Ensure that there are no snapshots before:
Performing Storage vMotion in vSphere 4.x and earlier environments.
Note: vSphere 5.0 and later support Storage vMotion with snapshots on a virtual machine.Increasing the virtual machine disk size or virtual RDM.
Increasing the disk size when snapshots are still available can corrupt snapshots and result in data loss.
As long as VMware and the operating system running inside are operating correctly you won't need to rollback and thus have no need to keep your snapshots. In any event it's advised not to make more than a few snapshots nor keep them for more than 72 hours - so if you don't need them they can be deleted, and if you've finished backing up your drive you don't need them.
I haven't used VMware for years but when I had problems with running out of space on the harddrive partition I was able to make a backup from the OS (outside of VMWare) and optimize the harddrive, then copy the deleted files back. Everything would then be contiguous and there would be room to expand the partition. That differs from increasing the virtual machine disk but appears to be what you are asking about.
Years ago it didn't check if you did that sort of thing, and I would suspect that it still doesn't; otherwise you wouldn't be able to make backups that could be restored and work correctly.
It depends upon the capabilities of your repartition software, Windows Disk Manager isn't as flexible as other software, see this article: "How to expand partition that has free space to the left with diskpart?" which recommends: "MiniTool Partition Wizard Free 11", "EaseUS Partition Master Free 13.0" or "AOMEI Partition Assistant Server Edition" be used instead. Some partition software has bootable CD or bootable Flash drive versions, these access the disk without Windows.
Always backup what you can't afford to lose, especially when doing things you are not familiar with.
Speaking of backups, that's all the snapshot is. You can most safety delete it from within VMWare. I have deleted excess snapshots outside of VMWare from the OS, that can leave index files and VMware may think you have some of your snapshots; until you actually try to restore to them.
Sometimes you have to simply buy a new HD, as you continue to have problems with getting low on disk space and get tired of trying to find something to delete. That's another option, if you have some videos (or lots of photos) that you can backup to free cloud storage; getting rid of stuff you don't really need on your HD for day to day usage can free up a surprisingly large amount of space, that trick only works so many times then you must buy a bigger disk.

- 320
- 1
- 3
- 9