You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "subhash yedugundla (JIRA)" <ji...@apache.org> on 2015/10/06 18:07:26 UTC

[jira] [Created] (CLOUDSTACK-8939) VM Snapshot size with memory is not correctly calculated in cloud.usage_event (

subhash yedugundla created CLOUDSTACK-8939:
----------------------------------------------

             Summary: VM Snapshot size with memory is not correctly calculated in cloud.usage_event (
                 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

*************************** 1. row ***************************                                                                                                                                
           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)