Sanjeev N created CLOUDSTACK-4129:
-------------------------------------

             Summary: [Object_store_refactor] Template creation from the 
stopped vm's Root disk failed with NPE
                 Key: CLOUDSTACK-4129
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4129
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Storage Controller, Template, VMware
    Affects Versions: 4.2.0
         Environment: Latest build from ACS 4.2 branch
Storage: S3 for secondary, NFS for staging storage and ISCSI for Primary storage
Cluster : VMWare
            Reporter: Sanjeev N
            Priority: Critical
             Fix For: 4.2.0


Failed to create template from the stopped vm's Root disk

Steps to Reproduce:
================
1.Bringup CS in with VMWare cluster using S3 for secondary, NFS for staging 
secondary and ISCSI for primary storage
2.Deploy guest vm using the default CentOS template
3.Stop the vm
4.Try to create template from the root disk of the vm

Result:
======
Template creation failed with NPE

Observations:
===========
When createTemplate command executed, copyCommand was executed as part of the 
process and destination path was mentioned as "volumes/2/15" on staging 
storage. Looks like wrong path was sent to copyCommand to copy template from 
primary to staging secondary storage.
I could see template got copied to volumes directory 2/15 on NFS storage. Also 
there was an entry made in volume_store_ref table with state as "Creating" and 
install_path as "volumes/2/15".
 
Following is the log snippet:
2013-08-07 02:42:40,780 DEBUG [cloud.async.AsyncJobManagerImpl] 
(catalina-exec-21:null) submit async job-40 = [ 
787ffcfe-342c-4948-871b-7e81699868ce ], details: AsyncJobVO {id:40, userId: 2, 
accountId: 2, sessionKey: null, instanceType: Template, instanceId: 209, cmd: 
org.apache.cloudstack.api.command.user.template.CreateTemplateCmd, 
cmdOriginator: null, cmdInfo: 
{"sessionkey":"cmlJrR7zOuQRRz2h2n5pjU7LMag\u003d","cmdEventType":"TEMPLATE.CREATE","ctxUserId":"2","volumeId":"64cf3aff-3e33-465a-bc71-2d30acab3595","httpmethod":"GET","isPublic":"true","osTypeId":"257e87ce-fe5f-11e2-a4b5-06045a000066","isfeatured":"true","response":"json","isdynamicallyscalable":"false","id":"209","displayText":"fromVM","passwordEnabled":"true","name":"fromVM","_":"1375857746711","ctxAccountId":"2","ctxStartEventId":"161"},
 cmdVersion: 0, callbackType: 0, callbackAddress: null, status: 0, 
processStatus: 0, resultCode: 0, result: null, initMsid: 6615759585382, 
completeMsid: null, lastUpdated: null, lastPolled: null, created: null}
2013-08-07 02:42:40,783 DEBUG [cloud.api.ApiServlet] (catalina-exec-21:null) 
===END===  10.146.0.20 -- GET  
command=createTemplate&response=json&sessionkey=cmlJrR7zOuQRRz2h2n5pjU7LMag%3D&volumeId=64cf3aff-3e33-465a-bc71-2d30acab3595&name=fromVM&displayText=fromVM&osTypeId=257e87ce-fe5f-11e2-a4b5-06045a000066&isPublic=true&passwordEnabled=true&isdynamicallyscalable=false&isfeatured=true&_=1375857746711
2013-08-07 02:42:40,786 DEBUG [cloud.async.AsyncJobManagerImpl] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Executing 
org.apache.cloudstack.api.command.user.template.CreateTemplateCmd for job-40 = 
[ 787ffcfe-342c-4948-871b-7e81699868ce ]
2013-08-07 02:42:40,833 DEBUG [storage.image.TemplateDataFactoryImpl] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) template 
209 is already in store:10, type:Image
2013-08-07 02:42:40,847 DEBUG [storage.motion.AncientDataMotionStrategy] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) copyAsync 
inspecting src type VOLUME copyAsync inspecting dest type TEMPLATE
2013-08-07 02:42:40,862 DEBUG [storage.motion.AncientDataMotionStrategy] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) 
needCacheStorage true, dest at 
template/tmpl/2/209/23110cadf-74ea-327d-862d-8d49cd55e7c6 dest role 
ImageROOT-11 src role Primary
2013-08-07 02:42:40,894 DEBUG [storage.motion.AncientDataMotionStrategy] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) copyAsync 
inspecting src type VOLUME copyAsync inspecting dest type VOLUME
2013-08-07 02:42:40,935 DEBUG [agent.transport.Request] (Job-Executor-41:job-40 
= [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Seq 3-1317535872: Sending  { Cmd , 
MgmtId: 6615759585382, via: 3, Ver: v1, Flags: 100011, 
[{"org.apache.cloudstack.storage.command.CopyCommand":{"srcTO":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"64cf3aff-3e33-465a-bc71-2d30acab3595","volumeType":"ROOT","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"b845e7d4-562a-3b2d-8e59-b1df565f99e5","id":1,"poolType":"VMFS","host":"VMFS
 datastore: 
/sanjeev/openFiler","path":"/sanjeev/openFiler","port":0}},"name":"ROOT-11","size":459110400,"path":"ROOT-11","volumeId":15,"vmName":"i-2-11-VM","accountId":2,"format":"OVA","id":15,"hypervisorType":"VMware"}},"destTO":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"64cf3aff-3e33-465a-bc71-2d30acab3595","volumeType":"ROOT","dataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"nfs://10.147.28.7/export/home/sanjeev/sec_esx_os","_role":"ImageCache"}},"name":"ROOT-11","size":459110400,"path":"volumes/2/15","volumeId":15,"vmName":"i-2-11-VM","accountId":2,"format":"OVA","id":15,"hypervisorType":"VMware"}},"executeInSequence":false,"wait":10800}}]
 }
2013-08-07 02:44:55,547 DEBUG [agent.transport.Request] 
(AgentManager-Handler-13:null) Seq 3-1317535872: Processing:  { Ans: , MgmtId: 
6615759585382, via: 3, Ver: v1, Flags: 10, 
[{"org.apache.cloudstack.storage.command.CopyCmdAnswer":{"newData":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"path":"volumes/2/15/8f8453c285cd43918bcde7472bde0889","accountId":0,"id":0}},"result":true,"wait":0}}]
 }
2013-08-07 02:44:55,547 DEBUG [agent.transport.Request] (Job-Executor-41:job-40 
= [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Seq 3-1317535872: Received:  { Ans: 
, MgmtId: 6615759585382, via: 3, Ver: v1, Flags: 10, { CopyCmdAnswer } }
2013-08-07 02:44:55,555 DEBUG [storage.motion.AncientDataMotionStrategy] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) copy object 
failed: java.lang.NullPointerException
2013-08-07 02:44:55,556 DEBUG [storage.motion.AncientDataMotionStrategy] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) copy failed
com.cloud.utils.exception.CloudRuntimeException: java.lang.NullPointerException
        at 
org.apache.cloudstack.storage.motion.AncientDataMotionStrategy.copyObject(AncientDataMotionStrategy.java:210)
        at 
org.apache.cloudstack.storage.motion.AncientDataMotionStrategy.copyAsync(AncientDataMotionStrategy.java:386)
        at 
org.apache.cloudstack.storage.motion.DataMotionServiceImpl.copyAsync(DataMotionServiceImpl.java:55)
        at 
org.apache.cloudstack.storage.image.TemplateServiceImpl.copyAsync(TemplateServiceImpl.java:549)
        at 
org.apache.cloudstack.storage.image.TemplateServiceImpl.createTemplateFromVolumeAsync(TemplateServiceImpl.java:562)
        at 
com.cloud.template.TemplateManagerImpl.createPrivateTemplate(TemplateManagerImpl.java:1367)
        at 
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
        at 
org.apache.cloudstack.api.command.user.template.CreateTemplateCmd.execute(CreateTemplateCmd.java:263)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158)
        at 
com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
2013-08-07 02:44:55,569 DEBUG [cloud.template.TemplateManagerImpl] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Failed to 
create templatecom.cloud.utils.exception.CloudRuntimeException: 
java.lang.NullPointerException
2013-08-07 02:44:55,583 ERROR [cloud.async.AsyncJobManagerImpl] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Unexpected 
exception while executing 
org.apache.cloudstack.api.command.user.template.CreateTemplateCmd
com.cloud.utils.exception.CloudRuntimeException: Failed to create 
templatecom.cloud.utils.exception.CloudRuntimeException: 
java.lang.NullPointerException
        at 
com.cloud.template.TemplateManagerImpl.createPrivateTemplate(TemplateManagerImpl.java:1378)
        at 
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
        at 
org.apache.cloudstack.api.command.user.template.CreateTemplateCmd.execute(CreateTemplateCmd.java:263)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158)
        at 
com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
2013-08-07 02:44:55,586 DEBUG [cloud.async.AsyncJobManagerImpl] 
(Job-Executor-41:job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ]) Complete 
async job-40 = [ 787ffcfe-342c-4948-871b-7e81699868ce ], jobStatus: 2, 
resultCode: 530, result: Error Code: 530 Error text: Failed to create 
templatecom.cloud.utils.exception.CloudRuntimeException: 
java.lang.NullPointerException


Attaching management server log file and cloud DB.


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

Reply via email to