VMware Communities
Leamas
Contributor
Contributor
Jump to solution

Pre-allocated VM low on disk space

Hi,

I run 3 VM's (VMware Workstation), each has it's own hard drive. When I installed these machines I pre-allocated the disk space on the (false!) assumption that the VM's wouldn't grow. I'm now so low on disk space that one machine can't boot, and as far as I'm aware I can't shrink a pre-allocated VM?

Firstly, could somebody tell me what actually increses the size of the file, and as a percentage of available disk space how much room I should leave in future?

Secondly, how do I get myself out of this situation? As a temporary measure I could copy the VM to a drive with more space, but I will need to get it back on to the original disk eventually, is there any way of resizing a pre-allocated machine?

I think from the above you can guess I'm an end user not an IT specialist.

Thanks for your help....Marcus

0 Kudos
1 Solution

Accepted Solutions
continuum
Immortal
Immortal
Jump to solution

the command we suggest will create a clone of the current state.
The size of the resulting vmdk would be slightly larger than the netto-data on the original disk.

So if the Explorer inside the guest would claim that from the 270Gb 130 Gb are used the resulting vmdk could be as small as 140Gb.
The exact size of the resulting vmdk is not predictable exactly but it maybe significantly smaller than the original vmdk.


The performance problem with snapshots results from the simple fact that VMware then has to read several files.
It goes like this ....

GuestOS wants to read sector 100.00 on the disk = VMware first checks if sector 100.000 is inside snapshot 2.
If it is there fine - if not VMware checks if that sector is inside snapshot1. If yes fine - if not - VMware also has to read the basedisk to find the sector 100.000

This means that reading needs several steps more than if you would use a preallocated vmdk without snapshots.

I usually recommend to use growing type basedisks if you know that you want to make heavy use of snapshots


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

View solution in original post

0 Kudos
20 Replies
continuum
Immortal
Immortal
Jump to solution

are you running low on disk space on the host or inside the VMs ?

if that is inside the VMs copying them to another location will not help

VMs with preallocated vmdks do NOT grow - unless you use snapshots

the  easiest way to add free space to a VM is to simply add another disk
you can also expand the disk itself - this only works if you have no snapshots


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi Continuum,

Thank you for your swift reply. Yes, on the host.

If snapshots are the only way they can grow, then I guess it must be the snapshots. I think that each disk had 278Gb of available space, and I allocated 270Gb of that to the VM's. I'm a little suprised that the available space suddenly reached a critical level, to the point where the VM hangs during power up, even though I haven't added a new snapshot for a couple of weeks?

Since I can't power up the VM without it hanging, is there a way of moving or erasing the snapshots to free up more space?

For future reference, am I right in thinking that there is an option to store the snapshot's somewhere else?

Thanks again...

0 Kudos
continuum
Immortal
Immortal
Jump to solution

before I can tell you how to proceed best from here a few more questions

how much free space is left on the disk ?
what is the size of the snapshots ?
do you need to keep the snapshots ?

by the way - using snapshots for VMs with preallocated disks is like driving a Porsche with tyres only certified for 100km/h speed limit

you lose all advantages of the preallocated disks if you use snapshots for a longer time period


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi,

Essentially there is nothing left on the disk.

I'm not entirely clear about the structure of VM files, but the main .vmdk file is 275Gb. There is a small snaphot file that is only 30Kb, and another vmdk file that appears to have been created this morning of 3.7Gb, I'm guessing this is the one that pushed us over the edge. I have no idea why this file was created today, I should mention however that I did a few Windows updates today, could it have been created automatically?

As long as I can open the machine I'm happy to lose the snapshots, and I'll back-up another way.

I was interested by your last remark, I had no idea snapshots incurred a performance hit. Could you explain why, and which is the preferred method of backing up pre-allocated disks?

Thanks

0 Kudos
continuum
Immortal
Immortal
Jump to solution

snapshots will not be created automatically - or did you enable the "autoprotect" feature ?

and yes - a Windows update can easily add 3 gb to a snapshot

if the disk is full now you have not a lot of options :

A: copy the whole VM to another disk with enough free space
B: consolidate the snapshot with vmware-vdiskmanager to a temporary location

the command looks like this

vmware-vdiskmanager.exe -r  "full path to\name-00000x.vmdk" -t 0 "full path to temp location\new.vmdk"

if you attach the vmware.log I can give you the full cmd


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi,

Thanks again for your continued help and support, ii is appreciated.

I tried your cmd and got the following message;

Creating disk ‘Z:\.......000001.vdmk’ (New Snapshot Location)

Failed to convert disk: A file was not found

Mobile; +44 7785 375725

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Can you please post a list of all files in the VM's folder (with names, sizes, date/time) and attach the latest vmware.log as well as the vmx file.

Also post the full command you used to convert the virtual disk.

André

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi Andre,

Thanks for your help. Please see attached file, I hope I’ve managed to collect all the data you need.

Cheers….M

Message was edited by: a.p. - removed personal information

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

One quick question before going into details. Does the "Z:\Snapshots" folder already exist? If not you need to create it, prior to running the command. Regarding the command, use:

vmware-vdiskmanager.exe -r Q:\VM_QCollector\VM_QCollector-000001.vmdk –t 0 Z:\Snapshots\VM-QCollector.vmdk

This will create a single growable virtual disk on the destination (with merging the snapshot into the base disk)

Maybe there will be issues with the new virtual disk, but let's try the command first and see what happens.

from the log file:

Aug 15 10:34:42.221: vmx| [msg.vmxaiomgr.corrupted] VMware Workstation cannot sync with disk before abort. Disk Q:\VM_QCollector\VM_QCollector-000001.vmdk may be inconsistent.

André

0 Kudos
continuum
Immortal
Immortal
Jump to solution

the files are fine

possible reason for the failed cmd:  the directory Z:\snapshots does not exist - vmware-vdiskmanager can not create directories so create it yourself


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi Andre,

Just before I try this, can I clarify what I’m doing. This command only relocates the snapshot is that correct? There is only about 30Gb of available disk space on the Z drive, I’m assuming that’s enough for the snapshot?

Thereafter I’m assuming that for all future snapshots I can send them to the same directory.

Thanks…..Marcus

Message was edited by: a.p. - removed personal information

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

No, the command creates a complete new virtual disk (base disk including the merged snapshot).

Please take a look at http://kb.vmware.com/kb/1015180 to understand how snapshots work in VMware products.

André

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

Just before I try this, can I clarify what I’m doing. This command only relocates the snapshot is that correct? There is only about 30Gb of available disk space on the Z drive, I’m assuming that’s enough for the snapshot?

Thereafter I’m assuming that for all future snapshots I can send them to the same directory.

Your assumptions are wrong and you need to have enough free space to store the entire virtual hard disk as the command suggested by continuum creates a new virtual hard disk consolidating the snapshots and base disk into a new base disk.  I'm assuming he suggested it because you were out of free space on the current drive the Virtual Machine is presently stored.  BTW If I was in the same situation as you are presently I'd also use vmware-vdiskmanager to create a new consolidated disk and then swap it out for the old one with the snapshots.

If you do not have adequate free disk space to preform these types of actions then you'll have to either free up some space or acquire an external drive to do it.

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Hi Andre,

Sorry I’m losing the plot a little here.

I can find a larger drive but, does the command actually moves the snapshot off its original drive, thus allowing me enough disk space to power-up the VM in its original location/drive?

Thanks…M

From; Marcus Hyde

Email; marcus@marcushyde.com<mailto:marcus@marcushyde.com>

Mobile; +44 7785 375725

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

I can find a larger drive but, does the command actually moves the snapshot off its original drive, thus allowing me enough disk space to power-up the VM in its original location/drive?

No, vmware-vdiskmanager will create a new base disk (or parent disk) without any snapshots, then the newly created virtual hard disk contains everything that's in the base/parent disk and the snapshot/child disks thus ending up with a consolidated virtual hard disk that you can then swap out for the existing virtual hard disk and all the snapshot disks.

Or move the entire Virtual Machine to a disk with adequate free space to preform the necessary actions via the Snapshot Manager and then move it back.

It's your choice.

Leamas
Contributor
Contributor
Jump to solution

Hi Andre,

I tried the command, it came back with ‘Diskname or some other argument is missing’?

And yes, the folder Z:\Snapshots already exists.

Cheers….M

From; Marcus Hyde

Email; marcus@marcushyde.com<mailto:marcus@marcushyde.com>

Mobile; +44 7785 375725

0 Kudos
Leamas
Contributor
Contributor
Jump to solution

Thank you Woody, now I’m beginning to understand what we’re trying to do.

So if I have a 275Gb pre-allocated VM on a 278Gb disk, by bouncing it over to another drive and forming a new ‘consolidated’ disk, this will the consolidate the disk back to its original 275Gb but somehow incorporating the snapshot within it? And then I just bounce it back to the original disk?

Or, is it simpler to achieve via your second route? I move it temporarily to a larger disk, presumably remove the snapshot in snapshot manager thus reducing it to its original size of 275Gb, and then move it back to its original disk? Am I now on track or am I still missing something?

Finally, Continuum hinted that using snapshots for pre-allocated disks incurred a performance hit (for reasons unspecified), so what is best practice for back-up?

Thanks for your time….M

From; Marcus Hyde

Email; marcus@marcushyde.com<mailto:marcus@marcushyde.com>

Mobile; +44 7785 375725

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Did you copy and paste the command I posted? I saw there is a flaw in the command. I copied the command from the pdf you provided and somehow the hyphen in front of the "t" was replaced. "–t" should be a "-t". Here is the corrected command line:

vmware-vdiskmanager.exe -r Q:\VM_QCollector\VM_QCollector-000001.vmdk -t 0 Z:\Snapshots\VM_QCollector.vmdk

André

continuum
Immortal
Immortal
Jump to solution

the command we suggest will create a clone of the current state.
The size of the resulting vmdk would be slightly larger than the netto-data on the original disk.

So if the Explorer inside the guest would claim that from the 270Gb 130 Gb are used the resulting vmdk could be as small as 140Gb.
The exact size of the resulting vmdk is not predictable exactly but it maybe significantly smaller than the original vmdk.


The performance problem with snapshots results from the simple fact that VMware then has to read several files.
It goes like this ....

GuestOS wants to read sector 100.00 on the disk = VMware first checks if sector 100.000 is inside snapshot 2.
If it is there fine - if not VMware checks if that sector is inside snapshot1. If yes fine - if not - VMware also has to read the basedisk to find the sector 100.000

This means that reading needs several steps more than if you would use a preallocated vmdk without snapshots.

I usually recommend to use growing type basedisks if you know that you want to make heavy use of snapshots


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos