GitHub user knishimoto-idcf edited a discussion: vm_snapshot_chain_size in VMware
Let me confirm how to calculate vm_snapshot_chain_size in VMware. The "volumes" table of CloudStack DB has the column "vm_snapshot_chain_size". CloudStack seems to consider size of -flat.vmdk, -xxxxxx.vmdk and -xxxxxx-delta.vmdk files when it calculates vm_snapshot_chain_size. https://github.com/apache/cloudstack/blob/81e052cfebf5bcdb09e1922393a1753eb6707dae/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java#L1313-L1322 Consider the following cases. ### 1. No VM snapshot Create a virtual machine (i-2-268-DEVM). .vmdk and -flat.vmdk files are created as follows: ``` [root@esxi67-host01:/vmfs/volumes/a9d31e3b-dd41814d/i-2-268-DEVM] ls -al *vmdk *vmsn -rw------- 1 root root 16106127360 Sep 17 10:02 i-2-268-DEVM_268-flat.vmdk -rw------- 1 root root 537 Sep 3 03:36 i-2-268-DEVM_268.vmdk ``` Is the vm_snapshot_chain_size expected to be 0? ### 2. One VM snapshot Create a VM snapshot. .vmdk and -flat.vmdk files are created as follows: ``` [root@esxi67-host01:/vmfs/volumes/a9d31e3b-dd41814d/i-2-268-DEVM] ls -al *vmdk *vmsn -rw------- 1 root root 21577 Sep 17 10:02 i-2-268-DEVM-Snapshot2.vmsn -rw------- 1 root root 16809984 Sep 17 10:16 i-2-268-DEVM_268-000001-delta.vmdk -rw------- 1 root root 313 Sep 17 10:06 i-2-268-DEVM_268-000001.vmdk -rw------- 1 root root 16106127360 Sep 17 10:02 i-2-268-DEVM_268-flat.vmdk -rw------- 1 root root 537 Sep 3 03:36 i-2-268-DEVM_268.vmdk ``` Size of current volume vdisk (i-2-268-DEVM_268-000001-delta.vmdk) may grow up to the allocated size (=the value of the "size" column of the "volumes" table). So the total size of the volume may grow up to "the size of i-2-268-DEVM_268-flat.vmdk + the allocated size + the size of i-2-268-DEVM-Snapshot2.vmsn". Is the vm_snapshot_chain_size expected to be 16106148937 (=16106127360+21577)? ### 3. Two VM snapshotVM .vmdk and -flat.vmdk files are created as follows: ``` [root@esxi67-host01:/vmfs/volumes/a9d31e3b-dd41814d/i-2-268-DEVM] ls -al *vmdk *vmsn -rw------- 1 root root 21577 Sep 17 10:02 i-2-268-DEVM-Snapshot2.vmsn -rw------- 1 root root 21581 Sep 17 10:16 i-2-268-DEVM-Snapshot3.vmsn -rw------- 1 root root 16809984 Sep 17 10:16 i-2-268-DEVM_268-000001-delta.vmdk -rw------- 1 root root 313 Sep 17 10:06 i-2-268-DEVM_268-000001.vmdk -rw------- 1 root root 16809984 Sep 17 10:33 i-2-268-DEVM_268-000002-delta.vmdk -rw------- 1 root root 320 Sep 17 10:16 i-2-268-DEVM_268-000002.vmdk -rw------- 1 root root 16106127360 Sep 17 10:02 i-2-268-DEVM_268-flat.vmdk -rw------- 1 root root 537 Sep 3 03:36 i-2-268-DEVM_268.vmdk ``` Size of current volume vdisk (i-2-268-DEVM_268-000002-delta.vmdk) may grow up to the allocated size (=the value of the "size" column of the "volumes" table). So the total size of the volume may grow up to "the size of i-2-268-DEVM_268-flat.vmdk + i-2-268-DEVM_268-000001.vmdk + i-2-268-DEVM_268-000001-delta.vmdk + the allocated size + the size of i-2-268-DEVM-Snapshot2.vmsn + i-2-268-DEVM-Snapshot3.vmsn". Is the vm_snapshot_chain_size expected to be 16122980815 (=16106127360+21577+313+16809984+21581)? GitHub link: https://github.com/apache/cloudstack/discussions/10230 ---- This is an automatically sent email for users@cloudstack.apache.org. To unsubscribe, please send an email to: users-unsubscr...@cloudstack.apache.org