You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Sanjeev N (JIRA)" <ji...@apache.org> on 2013/07/29 11:19:48 UTC

[jira] [Reopened] (CLOUDSTACK-3849) [Object_store_refactor][Usage] snapshot size is set to 0 in snapshts table which inturn sets size to 0 for SNAPSHOT_CREATE event in usage_events table

     [ https://issues.apache.org/jira/browse/CLOUDSTACK-3849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanjeev N reopened CLOUDSTACK-3849:
-----------------------------------


Template size is not set to 0. Only snapshot size is set to 0. 
Following is the default cent of template (from which vm was deployed and snapshot was created from root volume) details from vm_template and template_store_ref table:


mysql> select * from vm_template where id=7\G;
*************************** 1. row ***************************
                  id: 7
         unique_name: centos53-x64
                name: CentOS 5.3(64-bit) no GUI (vSphere)
                uuid: bc9d0db4-f5b9-11e2-a8ed-06045a000066
              public: 1
            featured: 1
                type: BUILTIN
                 hvm: 0
                bits: 64
                 url: http://10.147.28.7/releases/2.2.0/CentOS5.3-x86_64.ova
              format: OVA
             created: 2013-07-26 02:08:05
             removed: NULL
          account_id: 1
            checksum: f6f881b7f2292948d8494db837fe0f47
        display_text: CentOS 5.3(64-bit) no GUI (vSphere)
     enable_password: 0
       enable_sshkey: 0
         guest_os_id: 12
            bootable: 1
         prepopulate: 0
         cross_zones: 1
         extractable: 1
     hypervisor_type: VMware
  source_template_id: NULL
        template_tag: NULL
            sort_key: 0
                size: 2147483648
               state: Allocated
        update_count: 0
             updated: NULL
dynamically_scalable: 0
1 row in set (0.00 sec)

ERROR:
No query specified

mysql> select * from template_store_ref where template_id=7\G
*************************** 1. row ***************************
            id: 12
      store_id: 2
   template_id: 7
       created: 2013-07-26 07:19:52
  last_updated: 2013-07-26 07:34:39
        job_id: b68d40ae-8a7a-43ac-af3e-e0ddfc1a6d07
  download_pct: 100
          size: 2147483648
    store_role: Image
 physical_size: 459320832
download_state: DOWNLOADED
     error_str: Install completed successfully at 7/26/13 7:34 AM
    local_path: /mnt/SecStorage/21ac712e-6690-39a2-9c7b-cc3d5108db5f/template/tmpl/1/7/dnld1821019166889105326tmp_
  install_path: template/tmpl/1/7/81284050-a425-3735-bede-3a397cfa1d6a.ova
           url: NULL
         state: Ready
     destroyed: 0
       is_copy: 0
  update_count: 3
       ref_cnt: 0
       updated: 2013-07-26 07:34:40
1 row in set (0.00 sec)

mysql>


                
> [Object_store_refactor][Usage] snapshot size is set to 0 in snapshts table which inturn sets size to 0 for SNAPSHOT_CREATE event in usage_events table
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-3849
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3849
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Snapshot, Storage Controller, Usage, VMware
>    Affects Versions: 4.2.0
>         Environment: Latest build from ACS 4.2 branch.
> Storage: NFS for both primary and secondary
>            Reporter: Sanjeev N
>            Assignee: Kishan Kavala
>            Priority: Critical
>             Fix For: 4.2.0
>
>
> [Object_store_refactor][Usage] snapshot size is set to 0 in snapshts table which inturn sets size to 0 for SNAPSHOT_CREATE event in usage_events table
> Observed this issue on VMWare only. Din't see in case of XenServer.
> Steps to Reproduce:
> ================
> 1.Bring up CS with VMWare cluster
> 2.Deploy guest vm with default cent os template
> 3.Take snapshot on guest vm's root disk
> 4.Wait for the snapshot backup to complete.
> Observations:
> ===========
> After snapshot backup was done and snapshot was in ready state in snapshot_store_ref observed the size set to 0.
> Even in snapshsots table size is set to 0 whereas in the secondary storage snapshot is present with actual physical size.
> Because of this issue size in usage_event for SNAPSHOT_CREATE is also set to 0. Since size is set to 0 user would not be charged for this snapshot.
> Following is the db output:
> =====================
> mysql> select * from snapshots where id=1\G;
> *************************** 1. row ***************************
>               id: 1
>   data_center_id: 2
>       account_id: 2
>        domain_id: 1
>        volume_id: 9
> disk_offering_id: 1
>           status: BackedUp
>             path: NULL
>             name: vm1-esx_ROOT-8_20130726084133
>             uuid: a265823a-57bd-40d0-b890-49c511ff47e4
>    snapshot_type: 0
> type_description: MANUAL
>             size: 0
>          created: 2013-07-26 08:41:33
>          removed: NULL
>   backup_snap_id: NULL
>         swift_id: NULL
>       sechost_id: NULL
>     prev_snap_id: NULL
>  hypervisor_type: VMware
>          version: 2.2
>            s3_id: NULL
> 1 row in set (0.00 sec)
> ERROR:
> No query specified
> mysql> select * from snapshot_store_ref where id=2\G;
> *************************** 1. row ***************************
>                 id: 2
>           store_id: 2
>        snapshot_id: 1
>            created: 2013-07-26 08:41:33
>       last_updated: NULL
>             job_id: NULL
>         store_role: Image
>               size: 0
>      physical_size: 0
> parent_snapshot_id: 0
>       install_path: snapshots/2/9/6a3fec79-a55b-4536-9cc2-9aea56af3527/6a3fec79-a55b-4536-9cc2-9aea56af3527
>              state: Ready
>       update_count: 4
>            ref_cnt: 0
>            updated: 2013-07-26 09:40:04
>          volume_id: 9
> 1 row in set (0.00 sec)
> ERROR:
> No query specified
> mysql> select * from usage_event where id=27\G;
> *************************** 1. row ***************************
>            id: 27
>          type: SNAPSHOT.CREATE
>    account_id: 2
>       created: 2013-07-26 09:08:31
>       zone_id: 2
>   resource_id: 1
> resource_name: vm1-esx_ROOT-8_20130726084133
>   offering_id: NULL
>   template_id: NULL
>          size: 0
> resource_type: NULL
>     processed: 0
>  virtual_size: NULL
> 1 row in set (0.00 sec)
> ERROR:
> No query specified
> Physical location of the snapshot on the secondary storage as follows:
> [root@Rhel63-Sanjeev 6a3fec79-a55b-4536-9cc2-9aea56af3527]# pwd
> /tmp/sec/sec_esx_os/snapshots/2/9/6a3fec79-a55b-4536-9cc2-9aea56af3527
> [root@Rhel63-Sanjeev 6a3fec79-a55b-4536-9cc2-9aea56af3527]# ls -l
> total 897948
> -rw-rw----+ 1 root root 459283968 Jul 25 17:01 6a3fec79-a55b-4536-9cc2-9aea56af3527-disk0.vmdk
> -rw-rw----+ 1 root root 459294720 Jul 25 17:07 6a3fec79-a55b-4536-9cc2-9aea56af3527.ova
> -rw-rw----+ 1 root root      6500 Jul 25 17:01 6a3fec79-a55b-4536-9cc2-9aea56af3527.ovf
> [root@Rhel63-Sanjeev 6a3fec79-a55b-4536-9cc2-9aea56af3527]#

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira