VMware Cloud Community
bazzw
Contributor
Contributor
Jump to solution

Snapshot files increase in size after copy

I have recently setup an ESXi 4.1 u1 installation. One of the VMs has two disks (vmdk) running w2k3 and it has one snapshot taken while the VM was suspended. Before making some major alterations to w2k3 I decided to backup this VM by copying (while it was still suspended) all the files to another folder within the datastore using the the datastore browser within vSphere.

This has worked fine except I am puzzled and alarmed the by a large increase in the size of both the snapshot vmdk files. The original snapshots were respectively 508mb and 82mb and the base vmdk files are 20gb and 10gb respectively. After copying all the VM files to another backup folder within the datastore, the snapshot vmdk files had increased in size to 10.2gb and 5.5gb respectively. The base vmdk files are the same size as the originals.

Could someone please explain the increased sizes. Clearly after a dozen or so snapshots if this behaviour was replicated for every snapshot then any copy would fill the entire datastore.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

I didn't find any documentation why this would happen, but this behavior is what you have to expect when copying snapshot vmdks. I did a couple of tests some time ago (I think it was with ESX 4.0 GA release) and the only way - if I remember correctly - to copy snapshot files without size increase was to evacuate the snapshot by first moving it to a new/empty folder on the same datastore (away from the base vmdk) and then copy it.

André

View solution in original post

0 Kudos
8 Replies
GaryHertz
Enthusiast
Enthusiast
Jump to solution

Did the snapshots increase in size while the vm was suspended or after?

When you take a snapshot the original files are frozen and any changes are saved to the snapshot files.  You would expect them to grow.  You should keep a snapshot for as long as is needed to verify the changes you made where sucessful and then remove it.  When you remove the snapshot the snapshot file is merged with the original file.  Any updated files in the original are discarded so the combined files should be in line with the changes.

You shouldn't keep snapshots any longer than absolutely needed and you should never have a dozen or so snapshots for the very reason you state.  It also degrades performance since multiple vmdk files need to be accessesed as data is spread out across snapshots.  I will rarely create a second snapshot on a vm unless absolutely necessary and try to keep a snapshot a few days after an upgrade is finished at most.

bazzw
Contributor
Contributor
Jump to solution

Thanks for your replay Gary, I now understand more about how snapshots work and will take on board the performance implications of snapshots.

In answer to your question the sequence of events were

1) Suspended the VM

2) Created snapshot 1

3) Decided to copy all the VM files in the VM Folder to another backup location in the datastore so I could do an offline copy to an external USB drive.

4) Resumed the VM

It was the copy in step 3 that resulted in the large increase in size of the copied snapshot files in the backup folder. The original snapshots were unchanged in size. My difficulty is understanding what is happening during a simple copy (copy and paste) that could cause such an increase to the snaphot file size.

0 Kudos
john23
Commander
Commander
Jump to solution

can you check the editsetting  of you vm  and check the harddisk ,after resume hard disk its pointing.

Thanks

-A

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
admin
Immortal
Immortal
Jump to solution

What is the maximum size of the VM's used and the block size of the disk you are using.

0 Kudos
john23
Commander
Commander
Jump to solution

When you say copy, are you using cloning or  vmkfstools??

Thanks

-A

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
bazzw
Contributor
Contributor
Jump to solution

The block size is 1mb and the VM has two disks maximum capacities are 20gb and 10gb.

The files were copied using the vSphere Client Datastore Browser. I created a new backup folder in the datastore and then used copy and paste as you would using Win Explorer.

The VM and associated files have no issues, it is just the copied snapshot files that have changed in size during the copy, and it is this size change that I don't understand and which increases the amount of data that I need to move to external storage.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I didn't find any documentation why this would happen, but this behavior is what you have to expect when copying snapshot vmdks. I did a couple of tests some time ago (I think it was with ESX 4.0 GA release) and the only way - if I remember correctly - to copy snapshot files without size increase was to evacuate the snapshot by first moving it to a new/empty folder on the same datastore (away from the base vmdk) and then copy it.

André

0 Kudos
bazzw
Contributor
Contributor
Jump to solution

So if I understand you correctly Andre a copy operation within the datastore is not merely a block copy but is also using link information from within the snapshot to include data from the base vdmk in the copied snapshot. Upon looking at the copied snapshot filesizes again they correspond fairly closely to the amount of used space on each disk within the VM. I now wonder if the copied snapshots are effectively merged copies of the base vmdk plus the snapshot and whether they would be usable as such.

0 Kudos