[ https://issues.apache.org/jira/browse/CLOUDSTACK-4147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kishan Kavala resolved CLOUDSTACK-4147. --------------------------------------- Resolution: Fixed > [upgrade][2.2.13 -> 2.2.14 -> 4.2][KVM] After upgrade, creation of templates > from snapshots (which were created before upgrade) is failing > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: CLOUDSTACK-4147 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4147 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: KVM, Snapshot, Upgrade > Affects Versions: 4.2.0 > Environment: upgrade from 2.2.13 (rhel 6.1 build) -> 2.2.14 (rhel 6.1 > build) -> 4.2 (rhel 6.2 build) > MS : CentOS 6.1 > KVM : CentOS 6.1 > Reporter: Abhinav Roy > Assignee: Kishan Kavala > Priority: Critical > Fix For: 4.2.0 > > Attachments: CS-4147.zip > > > steps : > ==================== > 1. Deploy CS 2.2.13 advanced zone setup with KVM. > 2. Create VMs, template,snapshots, domains, accounts etc > 3. Upgrade the management server and agent to 2.2.14 > 4. Create VMs , templates, snapshots, domain, accounts etc. > 5. Have some VMs in stopped state > 6. Upgrade the management server and agent to 4.2 > Expected behaviour : > =================== > After upgrade we should be able to create templates from the snapshots which > were created before upgrade > Observed behaviour: > =================== > 1. After upgrade i was able to create templates from snapshots which were > created after upgrade. > 2. But creation of templates from the snapshots which were created before > upgrade is failing. > 2013-08-07 16:54:05,080 DEBUG [cloud.api.ApiServlet] (catalina-exec-1:null) > ===END=== 10.144.7.7 -- GET > command=createTemplate&response=json&sessionkey=JlSNYQnYlmttQqoFIKL%2B%2B3wyyb4%3D&snapshotid=2&name=tempfromsnap-root9-2213&displayText=tempfromsnap-root9-2213&osTypeId=112&isPublic=false&passwordEnabled=false&isdynamicallyscalable=false&_=1375874413043 > 2013-08-07 16:54:05,082 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) Executing > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd for job-68 > = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ] > 2013-08-07 16:54:05,114 DEBUG [storage.image.TemplateDataFactoryImpl] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) template > 209 is already in store:4, type:Image > 2013-08-07 16:54:05,124 DEBUG [storage.motion.AncientDataMotionStrategy] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) copyAsync > inspecting src type SNAPSHOT copyAsync inspecting dest type TEMPLATE > 2013-08-07 16:54:05,155 DEBUG [agent.transport.Request] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) Seq > 7-1280901161: Sending { Cmd , MgmtId: 226870599129537, via: 7, Ver: v1, > Flags: 100011, > [{"org.apache.cloudstack.storage.command.CopyCommand":{"srcTO":{"org.apache.cloudstack.storage.to.SnapshotObjectTO":{"path":"snapshots/2/9//snapshots/1/2/9/i-2-9-VM_ROOT-9_20130805162236","volume":{"uuid":"9","volumeType":"ROOT","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"9fb7c84b-bfff-3ca2-9fc0-f50181c6b1f0","id":201,"poolType":"NetworkFilesystem","host":"10.102.192.100","path":"/cpg_vol/abhinav/kvm-pri2","port":2049}},"name":"ROOT-9","size":8589934592,"path":"c11c7a12-e9c7-495d-955b-6e814bb5b24f","volumeId":9,"vmName":"i-2-9-VM","accountId":2,"format":"QCOW2","id":9,"hypervisorType":"KVM"},"dataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"nfs://10.102.192.100/cpg_vol/abhinav/kvm-sec-old","_role":"Image"}},"vmName":"i-2-9-VM","name":"i-2-9-VM_ROOT-9_20130805162236","hypervisorType":"KVM","id":2}},"destTO":{"org.apache.cloudstack.storage.to.TemplateObjectTO":{"path":"template/tmpl/2/209","uuid":"28e40538-5ce0-492b-8fd6-496c3cb03c2a","id":209,"format":"RAW","accountId":2,"hvm":true,"displayText":"tempfromsnap-root9-2213","imageDataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"nfs://10.102.192.100/cpg_vol/abhinav/kvm-sec-old","_role":"Image"}},"name":"24f7e0d06-b196-3209-bac2-c13ee9059513","hypervisorType":"KVM"}},"executeInSequence":false,"wait":10800}}] > } > 2013-08-07 16:54:05,329 DEBUG [agent.transport.Request] > (AgentManager-Handler-4:null) Seq 7-1280901161: Processing: { Ans: , MgmtId: > 226870599129537, via: 7, Ver: v1, Flags: 10, > [{"com.cloud.agent.api.Answer":{"result":false,"details":"java.lang.NullPointerException\n\tat > > com.cloud.storage.template.TemplateLocation.addFormat(TemplateLocation.java:193)\n\tat > > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.copySnapshotToTemplateFromNfsToNfs(NfsSecondaryStorageResource.java:440)\n\tat > > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.createTemplateFromSnapshot(NfsSecondaryStorageResource.java:482)\n\tat > > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.execute(NfsSecondaryStorageResource.java:532)\n\tat > > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.executeRequest(NfsSecondaryStorageResource.java:200)\n\tat > com.cloud.agent.Agent.processRequest(Agent.java:525)\n\tat > com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:852)\n\tat > com.cloud.utils.nio.Task.run(Task.java:83)\n\tat > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n\tat > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\tat > java.lang.Thread.run(Thread.java:679)\n","wait":0}}] } > 2013-08-07 16:54:05,329 DEBUG [agent.transport.Request] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) Seq > 7-1280901161: Received: { Ans: , MgmtId: 226870599129537, via: 7, Ver: v1, > Flags: 10, { Answer } } > 2013-08-07 16:54:05,349 DEBUG [cloud.template.TemplateManagerImpl] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) Failed to > create templatejava.lang.NullPointerException > at > com.cloud.storage.template.TemplateLocation.addFormat(TemplateLocation.java:193) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.copySnapshotToTemplateFromNfsToNfs(NfsSecondaryStorageResource.java:440) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.createTemplateFromSnapshot(NfsSecondaryStorageResource.java:482) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.execute(NfsSecondaryStorageResource.java:532) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.executeRequest(NfsSecondaryStorageResource.java:200) > at com.cloud.agent.Agent.processRequest(Agent.java:525) > at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:852) > at com.cloud.utils.nio.Task.run(Task.java:83) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:679) > 2013-08-07 16:54:05,367 ERROR [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) > Unexpected exception while executing > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd > com.cloud.utils.exception.CloudRuntimeException: Failed to create > templatejava.lang.NullPointerException > at > com.cloud.storage.template.TemplateLocation.addFormat(TemplateLocation.java:193) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.copySnapshotToTemplateFromNfsToNfs(NfsSecondaryStorageResource.java:440) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.createTemplateFromSnapshot(NfsSecondaryStorageResource.java:482) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.execute(NfsSecondaryStorageResource.java:532) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.executeRequest(NfsSecondaryStorageResource.java:200) > at com.cloud.agent.Agent.processRequest(Agent.java:525) > at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:852) > at com.cloud.utils.nio.Task.run(Task.java:83) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:679) > 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:636) > 2013-08-07 16:54:05,369 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ]) Complete > async job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c ], jobStatus: 2, > resultCode: 530, result: Error Code: 530 Error text: Failed to create > templatejava.lang.NullPointerException > at > com.cloud.storage.template.TemplateLocation.addFormat(TemplateLocation.java:193) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.copySnapshotToTemplateFromNfsToNfs(NfsSecondaryStorageResource.java:440) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.createTemplateFromSnapshot(NfsSecondaryStorageResource.java:482) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.execute(NfsSecondaryStorageResource.java:532) > at > org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.executeRequest(NfsSecondaryStorageResource.java:200) > at com.cloud.agent.Agent.processRequest(Agent.java:525) > at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:852) > at com.cloud.utils.nio.Task.run(Task.java:83) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:679) > 2013-08-07 16:54:08,200 DEBUG [cloud.api.ApiServlet] (catalina-exec-3:null) > ===START=== 10.144.7.7 -- GET > command=queryAsyncJobResult&jobId=26b13614-69a4-4491-aa04-a4b3d3e9c88c&response=json&sessionkey=JlSNYQnYlmttQqoFIKL%2B%2B3wyyb4%3D&_=1375874416231 > 2013-08-07 16:54:08,211 DEBUG [cloud.async.AsyncJobManagerImpl] > (catalina-exec-3:null) Async job-68 = [ 26b13614-69a4-4491-aa04-a4b3d3e9c88c > ] completed > 2013-08-07 16:54:08,217 DEBUG [cloud.api.ApiServlet] (catalina-exec-3:null) > ===END=== 10.144.7.7 -- GET > command=queryAsyncJobResult&jobId=26b13614-69a4-4491-aa04-a4b3d3e9c88c&response=json&sessionkey=JlSNYQnYlmttQqoFIKL%2B%2B3wyyb4%3D&_=1375874416231 > 2013-08-07 16:54:11,210 DEBUG [cloud.api.ApiServlet] (catalina-exec-14:null) > ===START=== 10.144.7.7 -- GET > command=listVolumes&response=json&sessionkey=JlSNYQnYlmttQqoFIKL%2B%2B3wyyb4%3D&listAll=true&page=1&pagesize=20&_=1375874419332 > 2013-08-07 16:54:11,238 DEBUG [cloud.api.ApiServlet] (catalina-exec-14:null) > ===END=== 10.144.7.7 -- GET > command=listVolumes&response=json&sessionkey=JlSNYQnYlmttQqoFIKL%2B%2B3wyyb4%3D&listAll=true&page=1&pagesize=20&_=1375874419332 > 2013-08-07 16:54:14,384 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-6:null) SeqA 8-541: Processing Seq 8-541: { Cmd , > MgmtId: -1, via: 8, Ver: v1, Flags: 11, > [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":18,"_loadInfo":"{\n > \"connections\": []\n}","wait":0}}] } > 2013-08-07 16:54:14,388 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-6:null) SeqA 8-541: Sending Seq 8-541: { Ans: , > MgmtId: 226870599129537, via: 8, Ver: v1, Flags: 100010, > [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] } > 2013-08-07 16:54:19,385 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-7:null) SeqA 8-542: Processing Seq 8-542: { Cmd , > MgmtId: -1, via: 8, Ver: v1, Flags: 11, > [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":18,"_loadInfo":"{\n > \"connections\": []\n}","wait":0}}] } > 2013-08-07 16:54:19,391 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-7:null) SeqA 8-542: Sending Seq 8-542: { Ans: , > MgmtId: 226870599129537, via: 8, Ver: v1, Flags: 100010, > [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] } > Attaching all DB dumps, agent logs and management server logs. -- 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