VMware Cloud Community
MalikPraveen
Contributor
Contributor

Snapshot file size

HI,

I have a doubt on snapshot let's say i have a VM  win2003 with the vmdk 40GB so out of that 10GB is full remaining space i  have is 30 GB  if take a snapshot delta files will be created for each  snapshot.

so these delta files will take the space of datastore  ok. so these delta files can grow Maximum to 30GB which is free space i  have on vmdk or they can grow amount of size let's say my datastore size  is 500GB.so how my delta files takes the space from datastore.

Thanks..

Reply
0 Kudos
22 Replies
Mouhamad
Expert
Expert

Please refer to the KB

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

How do snapshots work?

Our VMware API allows VMware and third-party products to perform operations with virtual machines and their snapshots. This is a list of common operations that can be performed on virtual machines and snapshots using our API:

  • CreateSnapshot: Creates a new snapshot of a virtual machine. As a side effect, this updates the current snapshot.
  • RemoveSnapshot: Removes a snapshot and deletes any associated storage.
  • RemoveAllSnapshots: Remove all snapshots associated with a virtual machine. If a virtual machine does not have any snapshots, then this operation simply returns successfully.
  • RevertToSnapshot: Changes the execution state of a virtual machine to the state of this snapshot.
  • (vSphere 5.0 only) Consolidate: Merges the hierarchy of redo logs.

This is a high-level overview of how to create, remove, or revert snapshot requests that are processed within the VMware environment:

  1. A request to create, remove, or revert a snapshot for a virtual machine is sent from the client to the server using the VMware API.


  2. The request is forwarded to the VMware ESX host that is currently hosting the virtual machine in question.

    Note: This only occurs if the original request was sent to a different server, such as vCenter, which is managing the ESX host.


  3. If the snapshot includes the memory option, the ESX host writes the memory of the virtual machine to disk.

    Note: The length of time the ESX host takes to write the memory onto the disk is relative to the amount of memory the virtual machine is configured to use.


  4. If the snapshot includes the quiesce option, the ESX host requests the guest operating system to quiesce the disks via VMware Tools.

    Note: Depending on the guest operating system, the quiescing operation can be done by the sync driver, the vmsync module, or Microsoft's Volume Shadow Copy (VSS) service. For more information on quiescing, see Troubleshooting Volume Shadow Copy (VSS) quiesce related issues (1007696) for VSS or A virtual machine can freeze under load when you take quiesced snapshots or use custom quiescing scr... for the SYNC driver.


  5. The ESX host makes the appropriate changes to the virtual machine's snapshot database (.vmsd file) and the changes are reflected in the snapshot manager of the virtual machine.

    Note: When removing a snapshot, the snapshot entity in the snapshot manager is removed before the changes are made to the child disks. The snapshot manager does not contain any snapshot entries while the virtual machine continues to run from the child disk. For more information, see Committing snapshots when there are no snapshot entries in the snapshot manager (1002310).


  6. The ESX host calls a function similar to the Virtual Disk API functions to make changes to the child disks (-delta.vmdk and .vmdk files) and the disk chain.

    Note: During a snapshot removal, if the child disks are large in size, the operation may take a long time. This can result in a timeout error message from either VirtualCenter or the VMware Infrastructure Client. For more information about timeout error messages, see vCenter operation times out with the error: Operation failed since another task is in progress (1004....
VCP-DCV, VCP-DT, VCAP-DCD, VSP, VTSP
Reply
0 Kudos
continuum
Immortal
Immortal

each snapshot can grow to the nominal size of its basedisk.
So if you have a vmdk with nominal size 40 Gb then each snapshot can grow to those 40 Gb as well


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

Reply
0 Kudos
MalikPraveen
Contributor
Contributor

ok so i base vmdk is 40GB so each delta file can grow up to 40GB and when i delete these delta file will they require additional space for merging

meaning 40GB+Delta data am i right.

Reply
0 Kudos
a_p_
Leadership
Leadership

ok so i base vmdk is 40GB so each  delta file can grow up to 40GB

Yes!

... and when i delete these delta file will  they require additional space for merging. meaning 40GB+Delta data am i right.

No. Each virtual disk (base or snapshot) can only grow up to the initially configured size (40GB in your case). If the base disk has been "full provisioned" (40 GB .vmdk file) it will not grow any further, if it was "sparse provisioned" (growing as needed) it may grow up to 40 GB. Since the snapshot can contain modified data blocks as well as new data blocks, merging the snapshot - in case of sparse provisioning - may result in the base disk growing anywhere between 0 bytes up to the size of the snapshot.

André

Reply
0 Kudos
MalikPraveen
Contributor
Contributor

thank you Andre for the answer.

now just small thing to discuss let's say my vmdk is 40GB out of that 10 GB is full so now remaining space i have is 30GB. now i take a first snapshot

so now my delta can grow upto 30GB beacuse 10 GB i already used.right???

or still it can grow to 40GB????

and how merging process will work let's say the size of snapshot is 20GB so when i will delete it will it take space from base vmdk ????

Reply
0 Kudos
mcowger
Immortal
Immortal

MalikPraveen wrote:

thank you Andre for the answer.

now just small thing to discuss let's say my vmdk is 40GB out of that 10 GB is full so now remaining space i have is 30GB. now i take a first snapshot

so now my delta can grow upto 30GB beacuse 10 GB i already used.right???

or still it can grow to 40GB????

Your snapshot can ALWAYS grow up to the size of its base disk.  Whether it will is highly dependent on filesystem, workload type, usage, etc.

and how merging process will work let's say the size of snapshot is 20GB so when i will delete it will it take space from base vmdk ????

It might grow the base, it might not.  Again, it depends on which blocks were touched.


You should ALWAYS bet that each snapshot could end up at the same size as the base, and that committing a snapshot could grow the base to 100% of its provisioned size.

--Matt VCDX #52 blog.cowger.us
Reply
0 Kudos
a_p_
Leadership
Leadership

Maybe a short example will clarify this:

Assuming you have a sparse (growing as needed) virtual disk with a configured size for up to 500 data blocks, in which blocks 1 through 100 are used. Then you take a snapshot. While the snapshot is active, blocks 11-20 are modified and blocks 101-110 are newly allocated. In this case the snapshot contains 20 data blocks. Once you commit the snapshot to the base disk, blocks 11-20 will not need additional disk space as they are already allocated. Since blocks 101-110 are new, they are appended to the base disk, resulting in growing the .vmdk file by 10 blocks.

André

Reply
0 Kudos
mcowger
Immortal
Immortal

Andre's analogy is excellent, and exactly the point I was trying to get across.

Bravo!

--Matt VCDX #52 blog.cowger.us
Reply
0 Kudos
patrickbuller
Contributor
Contributor

In this example, the datastore this VM is on is 2TB. Do I have enough space to commit the snapshot? This is from an ESXi 4.1 host, although my understanding is that this works the same on ESXi 5, right?

# du -h ts11*.vmdk
1.4T    ts11_1-000001-delta.vmdk
64.0k   ts11_1-000001.vmdk
185.0G  ts11_1-000002-delta.vmdk
64.0k   ts11_1-000002.vmdk
0       ts11_1-flat.vmdk
64.0k   ts11_1.vmdk

Reply
0 Kudos
continuum
Immortal
Immortal

the size of the flat.vmdk is 0 ???

did you take the first snapshot before even starting that VM for the first time ?


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

Reply
0 Kudos
patrickbuller
Contributor
Contributor

It is a very good question. I don't know. It would appear that way wouldn't it? Is there any other explanation?

Reply
0 Kudos
a_p_
Leadership
Leadership

Do I have enough space to commit the snapshot?

No, you don't.

Since snapshot 1 already consumes 1.4TB, there's less then ~600GB left on the datastore which means there's not enough space to commit the data from snapshot 1 to the base disk. Btw. what size does an ls -lisa command show for the files?

André

Reply
0 Kudos
continuum
Immortal
Immortal

the basedisk then has the nominal size of at least 1.4 TB - you did not mention it so far or  did I overlook it ???

so in this case you would temporarily need 1.4 TB + the files that already exist.
That would exceed the size that is available

please look up the nominal size
and look up the "effective" size - thats what the guest reports as used


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

Reply
0 Kudos
patrickbuller
Contributor
Contributor

# ls -lisa ts11*.vmdk
281021828 1535746048 -rw-------    1 root     root      1572598923264 Sep 10 18:50 ts11_1-000001-delta.vmdk
285216132   64 -rw-------    1 root     root                343 Dec  3  2010 ts11_1-000001.vmdk
373296516 194093056 -rw-------    1 root     root       198746259456 Jan 26 22:42 ts11_1-000002-delta.vmdk
377490820   64 -rw-------    1 root     root                350 Sep 10 18:56 ts11_1-000002.vmdk
247467396    0 -rw-------    1 root     root      1759218605056 Dec  3  2010 ts11_1-flat.vmdk
251661700   64 -rw-------    1 root     root                523 Dec  3  2010 ts11_1.vmdk

Why does the flat file show so big?

Reply
0 Kudos
patrickbuller
Contributor
Contributor

How do I look up nominal and effective size? Or is that what I just posted to Andre?

Reply
0 Kudos
continuum
Immortal
Immortal

we need to know the nominal size of that vmdk


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

Reply
0 Kudos
a_p_
Leadership
Leadership

Why does the flat file show so big?

This looks like you have a 1.6TB thin provisioned disk!? To confirm you may want to take a look at (or attach) the "ts11_1.vmdk".

André

Reply
0 Kudos
patrickbuller
Contributor
Contributor

vSphere Client when looking at the hard disks on the VM says that ts11_1-000002.vmdk is a 1.6TB Thick disk.

Reply
0 Kudos
patrickbuller
Contributor
Contributor

Would it make sense to use vmkfstools -i to clone the disk from the current datastore to a new datastore? My understanding is that vmkfstools -i will consolidate the disk and copy it in one step to a new datastore. The only other datastore I have is also 2TB. When using vmkfstools -i, does it need more space than 1.6TB to consolidate the disk?

Reply
0 Kudos