Cloud Director | How it works with VM Snapshot

Hello Guys,

Hope all are healthy and safe and enjoying the present. If you are healthy and safe and still not enjoying the life then start enjoying it :) This was today's Gyan!

I wish that as VMware has this snapshot feature, life also should have this feature. When you feel that I am most content, successful and happiest then take snapshot and save it somewhere and in adverse days, revert the snapshot. Unfortunately, it doesn't happens. Because whatever happens in life, happens for once and get implemented permanently. No more Gyan! let's start the main discussion :D

You will be surprised to know that this behavior has not documented by VMware either in form of KB article or documentation. There is one good documentation from Tomas Fojta which explain it but I thought to showcase this behavior in bit explained way and with snippets. Before demonstrating it with snippets, I would like to share that

1. vCenter works differently than vCD in terms of snapshots
2. When you take snapshot of any VM in vCloud Director, vCD reserve the size, equal to total size of all disks in its allocation table
3. Actual storage usage by snapshot in datastore will still increase as per snapshot definition in vcenter server.
4. In vcenter, if you take snapshot of 100 GB VM then snapshot size might be in few MBs
5. In vCD, if you take snapshot of 100 GB VM then snapshot size still will be in few MBs but vCD allocation table reserve the size equal to total size of VM. If it sounds weird to you then continue reading it
6. Thin-provisioning or thick-provisioning doesn't change the snapshot behavior in vCD
7. It does mean that if you have any VM of size 1 TB and if you want to take snapshot then make sure you have 1 TB free space in allocation given to your OrgvDC else you will have to increase the allocation quota.

I made a test and below are the details-

vCD version - 9.7 (Versin doesn't matter)
VM hdd size - 40 GB
VM MEM Size - 2 GB

When I created this VM, used allocation of OrgvDC storage quota changed from 0GB to 42 GB (40 GB disk and 2 GB memory). See below image. Allocated space is 200 GB

Now, I took the snapshot with MEM and below is the modified allocation usage. It means that 40 GB actual hdd size + 2 GB MEM size + 40 GB storage allocated for snapshot by vcd in allocation table.

In vcenter, snapshot size still will be in few MBs.
Why it happens because vcd can't know that how much your snapshot can grow. So, it use the logic that your snapshot can grow up to equal size of your HDD size hence block the same storage in advance.

8. I took snapshot without memory as well but allocation was till 82 GB. I think that "might be" because we still need to reserve the space to potentially be able to suspend the VM. 

Conclusion is that, snapshot reserve the space equal to hdd(s) size and for mem it doesn't bother.

9. Last but not the least, you can take one snapshot if any VM which is hosted on vCD. In vCenter you can take many snapshots of a VM on different stages but in vCD, if you take second snapshot then first snapshot will automatically delete.

I hope this information will be helpful for you. Must comment if any doubt\query.


1 comment:

  1. Can SnapShots created via vCD have the username that created them associated with that instance of the snapshot. Currently they have to go through the tasks and find the snapshot task to get the username.

    I can see that via the PowerCLI there are extra attributes associated with the PowerCLI type "VMware.VimAutomation.Cloud.Views.Snapshot", these fields 'AnyAttr' and 'VCloudExtension'. Can these fields can be used to have the username added that created the snapshot, or a method to populate them?

    Same when checking the SnapShotType via the API, it lists extra attribute 'VCloudExtension' too.

    ReplyDelete