[ https://issues.apache.org/jira/browse/CLOUDSTACK-8939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15322358#comment-15322358 ]
ASF GitHub Bot commented on CLOUDSTACK-8939: -------------------------------------------- Github user bvbharatk commented on the issue: https://github.com/apache/cloudstack/pull/914 ### ACS CI BVT Run **Sumarry:** Build Number 167 Hypervisor xenserver NetworkType Advanced Passed=73 Failed=0 Skipped=3 _Link to logs Folder (search by build_no):_ https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 **Failed tests:** **Skipped tests:** test_vm_nic_adapter_vmxnet3 test_static_role_account_acls test_deploy_vgpu_enabled_vm **Passed test suits:** test_deploy_vm_with_userdata.py test_affinity_groups_projects.py test_portable_publicip.py test_vpc_vpn.py test_over_provisioning.py test_global_settings.py test_scale_vm.py test_service_offerings.py test_routers_iptables_default_policy.py test_routers.py test_reset_vm_on_reboot.py test_snapshots.py test_deploy_vms_with_varied_deploymentplanners.py test_login.py test_list_ids_parameter.py test_public_ip_range.py test_multipleips_per_nic.py test_regions.py test_affinity_groups.py test_network_acl.py test_pvlan.py test_volumes.py test_nic.py test_deploy_vm_root_resize.py test_resource_detail.py test_secondary_storage.py test_vm_life_cycle.py test_disk_offerings.py > VM Snapshot size with memory is not correctly calculated in cloud.usage_event > (XenServer) > ----------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-8939 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8939 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Affects Versions: 4.5.2 > Reporter: subhash yedugundla > > 1. created a VM snapshot with memory on a VM with 512 MB RAM > list all the VBDs for the VM > xe vbd-list vm-name-label=i-2-43-VM empty=false params=vdi-uuid > vdi-uuid ( RO) : fbe638dd-02c5-42f5-96b2-7b3d73e68658 > Verify the size of the snapshot disk and its parent (I understand from the > code we only check one parent in the chain) > # xe vdi-list params=physical-utilisation,sm-config,is-a-snapshot > uuid=fbe638dd-02c5-42f5-96b2-7b3d73e68658 > is-a-snapshot ( RO) : false > physical-utilisation ( RO): 38124032 <------------- > sm-config (MRO): > host_OpaqueRef:52c1ec01-cef6-d4fd-7d81-68795a853ee0: RW; vhd-parent: > 993e3859-8be9-414c-819b-61095ab2eff1 > parent: > # xe vdi-list params=physical-utilisation,sm-config,is-a-snapshot > uuid=993e3859-8be9-414c-819b-61095ab2eff1 > is-a-snapshot ( RO) : false > physical-utilisation ( RO): 119816704 <------------- > sm-config (MRO): vhd-blocks: > eJxrYAAB0QcMWAELduFBDwSgNAsaHxcQARGMNHMOQfsJARFGRgkGRkWgOxmxGiWCwz5c9qLLU+o+YoGooIBUp6CgIJ2sIxnQKxzoZQ8M0Dof09s/1AMALcYD3A==; > vhd-parent: 4b7ee66c-de53-47bb-b3d5-306d40a0ea08 > At this stage, not counting the "suspend VDI", the size looks as follows: > 38124032 + 119816704 = 157940736 = 150.6 MB > Now, let's calulate the "suspend VDI" size and add it to the above value: > Note my test VM has 512 MB of RAM > # xe vdi-list name-label=Suspend\ image params=all > uuid ( RO) : e2ae7a47-c410-479b-9e2b-5f05c01f1b4f > name-label ( RW): Suspend image > name-description ( RW): Suspend image > is-a-snapshot ( RO): true > physical-utilisation ( RO): 6144 > <--------------------------------------- > sm-config (MRO): vhd-parent: > c286583b-dd47-4a21-a5fe-ba2f671f1163 > Looking at the parent > # xe vdi-list uuid=c286583b-dd47-4a21-a5fe-ba2f671f1163 params=all > uuid ( RO) : c286583b-dd47-4a21-a5fe-ba2f671f1163 > name-label ( RW): base copy > is-a-snapshot ( RO): false > virtual-size ( RO): 782237696 > physical-utilisation ( RO): 252154368 > <--------------------------------------- > sm-config (MRO): vhd-blocks: eJz7/x8ZNDA0MEDAASiNyucAAHMeEPs= > > So the "suspend VDI" + its parent has "physical utilisation" of 6144 + > 252154368 = 252160512 = 17.55 MB > Now, if we add it to the previously calculated disk sizes, we'll get: > xapi (phys util): 157940736 (non-memory snap disks)+ 252160512 (memory snap > disks) = 410101248 = 391.1 MB > Let's verify the size in cloud.usage_event now: > select * from cloud.usage_event where resource_name like "i-2-43-VM%" \G > > > id: 528 > > > type: VMSNAPSHOT.CREATE > > > account_id: 2 > > > created: 2015-04-14 11:48:56 > zone_id: 1 > resource_id: 43 > resource_name: i-2-43-VM_VS_20150414114830 > offering_id: NULL > template_id: 64 > size: 119863296 <------------- > resource_type: NULL > processed: 0 > virtual_size: NULL > 1 row in set (0.01 sec) > Overall, the snapshot size in cloud.usage_event != size calculated from xapi > objects based on the code > xapi (phys util): 157940736 (non-memory snap disks)+ 252160512 (memory snap > disks) = 410101248 = 391.1 MB > but: > usage_event: 119863296 = 114.3 MB -- This message was sent by Atlassian JIRA (v6.3.4#6332)