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

[jira] [Commented] (CLOUDSTACK-3934) Update Resource Count for an account is setting the primary storage usage to Zero

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-3934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13724576#comment-13724576 ] 

Prachi Damle commented on CLOUDSTACK-3934:
------------------------------------------

Analysed this issue:

1) UpdateResourceCount API is working correctly. It is just reporting what is being recorded in the database. There is no bug in this functionality.

2)  ListAccounts does not recalculate the resourcecount on every call.  The recalculation is done by updateResourceCount and it looks at the volumes databse for the primary_storage usage.
In the volumes database the size of the Root Volume is found to be 0. So it logs this and reports back the usage to be 0.

2013-07-30 14:02:11,145 INFO  [cloud.resourcelimit.ResourceLimitManagerImpl] (catalina-exec-18:null) Discrepency in the resource count (original count=2147483648 correct count = 0) for type primary_storage for account ID 7 is fixed during resource count recalculation.
 
3) So the real bug is why the Root Volume size in the volumes table is 0? 

- Volume size was set to 2GB when the VM (id=26) was being created - hence the first call to get usage reported the total usage a 2 GB.

- But during VM deployment, the prepare Volume functionality seem to have a bug for VmWare. The size reported back after volume creation is zero. That gets saved in the database and causes the usage to be reported zero on next recalculate.


Log showing the Root disk size is 2 GB before sending the CopyCmd:

2013-07-30 13:48:47,833 DEBUG [agent.transport.Request] (Job-Executor-1:job-130 = [ a5582d10-83ae-4797-8fd0-c5ffc10a54ab ]) Seq 1-126746642: Executing:  { Cmd , MgmtId: 187767034175903, via: 1, Ver: v1, Flags: 100011, [{"org.apache.cloudstack.storage.command.CopyCommand":{"srcTO":{"org.apache.cloudstack.storage.to.TemplateObjectTO":{"path":"7fcc24af33fc369192b33ecde204be31","origUrl":"http://download.cloud.com/releases/2.2.0/CentOS5.3-x86_64.ova","uuid":"69f75dca-f808-11e2-9ae5-aac5eb5f619f","id":7,"format":"OVA","accountId":1,"checksum":"f6f881b7f2292948d8494db837fe0f47","hvm":false,"displayText":"CentOS 5.3(64-bit) no GUI (vSphere)","imageDataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"3ecae8a1-c59a-33ee-b22b-6bd5758f10e8","id":1,"poolType":"NetworkFilesystem","host":"10.102.192.100","path":"/cpg_vol/sailaja/dvsps1","port":2049}},"name":"centos53-x64","hypervisorType":"VMware"}},"destTO":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"1f697d9b-9425-42ef-bfc4-244166f32a9c","volumeType":"ROOT","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"3ecae8a1-c59a-33ee-b22b-6bd5758f10e8","id":1,"poolType":"NetworkFilesystem","host":"10.102.192.100","path":"/cpg_vol/sailaja/dvsps1","port":2049}},"name":"ROOT-26","size":2147483648,"volumeId":40,"vmName":"i-7-26-VM","accountId":7,"format":"OVA","id":40,"hypervisorType":"None"}},"executeInSequence":false,"wait":0}}] }



Log showing the CopyCmdAnswer reporting back the size of the Root disk to be zero:

2013-07-30 13:48:52,484 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-7:null) Seq 1-126746642: Response Received: 
2013-07-30 13:48:52,485 DEBUG [agent.transport.Request] (DirectAgent-7:null) Seq 1-126746642: Processing:  { Ans: , MgmtId: 187767034175903, via: 1, Ver: v1, Flags: 10, [{"org.apache.cloudstack.storage.command.CopyCmdAnswer":{"newData":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"size":0,"path":"ROOT-26-40","accountId":0,"id":0}},"result":true,"wait":0}}] }










                
> Update Resource Count for an account is setting the primary storage usage to Zero
> ---------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-3934
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3934
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.2.0
>            Reporter: Sailaja Mada
>            Assignee: Prachi Damle
>            Priority: Critical
>             Fix For: 4.2.0
>
>         Attachments: apilog.log, cloud-backup.dmp, management-server.log
>
>
> Setup: VMWARE ESXI 5.0 U2 servers 
> Steps:
> 1. Create an account and deploy instances using this user account  (Root Volume size is 2 GB)
> 2.  Check the primary storage usage for this account :  (2 GB)
> <primarystoragelimit>200</primarystoragelimit>
> <primarystoragetotal>2</primarystoragetotal>
> <primarystorageavailable>198</primarystorageavailable>
> 3. Update Resource count of this account 
> 4. Verify primary storage resource usage :
> It is set to Zero .
> <primarystoragelimit>200</primarystoragelimit>
> <primarystoragetotal>0</primarystoragetotal>
> <primarystorageavailable>200</primarystorageavailable>
> Log Details:
> 2013-07-30 14:02:07,542 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-73:null) Ping from 11
> 2013-07-30 14:02:07,829 DEBUG [cloud.api.ApiServlet] (catalina-exec-9:null) ===START===  10.144.6.19 -- GET  command=listAccounts&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&id=9bd0da33-2d3a-415a-bd8d-9c05ca3859f0&_=1375173355796
> 2013-07-30 14:02:07,853 DEBUG [cloud.api.ApiServlet] (catalina-exec-9:null) ===END===  10.144.6.19 -- GET  command=listAccounts&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&id=9bd0da33-2d3a-415a-bd8d-9c05ca3859f0&_=1375173355796
> 2013-07-30 14:02:07,874 DEBUG [cloud.api.ApiServlet] (catalina-exec-23:null) ===START===  10.144.6.19 -- GET  command=listResourceLimits&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173355864
> 2013-07-30 14:02:07,901 DEBUG [cloud.user.AccountManagerImpl] (catalina-exec-23:null) Access granted to Acct[2-admin] to Domain:2/cdc/ by DomainChecker_EnhancerByCloudStack_900ba6a1
> 2013-07-30 14:02:07,983 DEBUG [cloud.api.ApiServlet] (catalina-exec-23:null) ===END===  10.144.6.19 -- GET  command=listResourceLimits&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173355864
> 2013-07-30 14:02:11,009 DEBUG [agent.manager.AgentManagerImpl] (AgentManager-Handler-11:null) SeqA 2-241: Processing Seq 2-241:  { Cmd , MgmtId: -1, via: 2, Ver: v1, Flags: 11, [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":2,"_loadInfo":"{\n  \"connections\": []\n}","wait":0}}] }
> 2013-07-30 14:02:11,016 DEBUG [agent.manager.AgentManagerImpl] (AgentManager-Handler-11:null) SeqA 2-241: Sending Seq 2-241:  { Ans: , MgmtId: 187767034175903, via: 2, Ver: v1, Flags: 100010, [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] }
> 2013-07-30 14:02:11,033 DEBUG [cloud.api.ApiServlet] (catalina-exec-18:null) ===START===  10.144.6.19 -- GET  command=updateResourceCount&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173358954
> 2013-07-30 14:02:11,056 DEBUG [cloud.user.AccountManagerImpl] (catalina-exec-18:null) Access granted to Acct[2-admin] to Domain:2/cdc/ by DomainChecker_EnhancerByCloudStack_900ba6a1
> 2013-07-30 14:02:11,145 INFO  [cloud.resourcelimit.ResourceLimitManagerImpl] (catalina-exec-18:null) Discrepency in the resource count (original count=2147483648 correct count = 0) for type primary_storage for account ID 7 is fixed during resource count recalculation.
> 2013-07-30 14:02:11,238 DEBUG [cloud.api.ApiServlet] (catalina-exec-18:null) ===END===  10.144.6.19 -- GET  command=updateResourceCount&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173358954
> 2013-07-30 14:02:11,664 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-175:null) Ping from 6
> 2013-07-30 14:02:14,376 DEBUG [cloud.api.ApiServlet] (catalina-exec-6:null) ===START===  10.144.6.19 -- GET  command=listAccounts&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&id=9bd0da33-2d3a-415a-bd8d-9c05ca3859f0&_=1375173362310
> 2013-07-30 14:02:14,399 DEBUG [cloud.api.ApiServlet] (catalina-exec-6:null) ===END===  10.144.6.19 -- GET  command=listAccounts&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&id=9bd0da33-2d3a-415a-bd8d-9c05ca3859f0&_=1375173362310
> 2013-07-30 14:02:14,492 DEBUG [cloud.api.ApiServlet] (catalina-exec-16:null) ===START===  10.144.6.19 -- GET  command=listResourceLimits&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173362439
> 2013-07-30 14:02:14,505 DEBUG [cloud.user.AccountManagerImpl] (catalina-exec-16:null) Access granted to Acct[2-admin] to Domain:2/cdc/ by DomainChecker_EnhancerByCloudStack_900ba6a1
> 2013-07-30 14:02:14,577 DEBUG [cloud.api.ApiServlet] (catalina-exec-16:null) ===END===  10.144.6.19 -- GET  command=listResourceLimits&response=json&sessionkey=VHIuqmSzsTH06hVFE2yGPkjQrSY%3D&domainid=e73e5b2a-806c-45bd-b74e-478d82f1ebdd&account=newuser1&_=1375173362439

--
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