[ https://issues.apache.org/jira/browse/CLOUDSTACK-3950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sanjeev N reopened CLOUDSTACK-3950: ----------------------------------- Verified this on the latest GA build. My observations are as follows: If the storage is region wide following changes are observed in UI: 1.While registering template/iso only All-Zones option is available in drop-down list. So making the template cross-zone. 2.On the registered template/Iso copy option is disable. However we are not making the entries in template_zone_ref table for every zone with zone and template id mapping. So the template is available for use in only one zone in which the template/iso was registered and not available for use in all other zones. Log snippet when tried through copyIso API: 2013-09-02 05:50:54,827 DEBUG [cloud.async.AsyncJobManagerImpl] (ApiServer-1:null) submit async job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ], details: AsyncJobVO {id:25, userId: 1, accountId: 1, sessionKey: null, instanceType: Template, instanceId: 202, cmd: org.apache.cloudstack.api.command.user.iso.CopyIsoCmd, cmdOriginator: null, cmdInfo: {"id":"d4bd15d4-182f-4a57-826b-f581391039b1","destzoneid":"3a6b476b-32ef-4aff-8380-b0036bebfcb8","cmdEventType":"TEMPLATE.COPY","ctxUserId":"1","httpmethod":"GET","ctxAccountId":"1","sourcezoneid":"d8fcb6b6-4115-4e54-bec3-ca5ca8753cf5","ctxStartEventId":"96"}, 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-09-02 05:50:54,839 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-25:job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ]) Executing org.apache.cloudstack.api.command.user.iso.CopyIsoCmd for job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ] 2013-09-02 05:50:54,876 DEBUG [cloud.template.TemplateManagerImpl] (Job-Executor-25:job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ]) Template 202 is cross-zone, don't need to copy 2013-09-02 05:50:54,890 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-25:job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ]) Complete async job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ], jobStatus: 1, resultCode: 0, result: org.apache.cloudstack.api.response.TemplateResponse@55747dae 2013-09-02 05:50:54,897 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-25:job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ]) Done executing org.apache.cloudstack.api.command.user.iso.CopyIsoCmd for job-25 = [ ec8db957-b05e-4928-8ef0-fe7494cc2fe6 ] mysql> select * from template_zone_ref where template_id=202; +----+---------+-------------+---------------------+---------------------+---------+ | id | zone_id | template_id | created | last_updated | removed | +----+---------+-------------+---------------------+---------------------+---------+ | 10 | 1 | 202 | 2013-09-02 09:25:17 | 2013-09-02 09:25:17 | NULL | +----+---------+-------------+---------------------+---------------------+---------+ 1 row in set (0.00 sec) mysql> select id,name,type,prepopulate,cross_zones,url from vm_template where id=202; +-----+-------+------+-------------+-------------+-----------------------------------------------+ | id | name | type | prepopulate | cross_zones | url | +-----+-------+------+-------------+-------------+-----------------------------------------------+ | 202 | dummy | USER | 0 | 1 | http://10.147.28.7/templates/vmware/dummy.iso | +-----+-------+------+-------------+-------------+-----------------------------------------------+ 1 row in set (0.00 sec) Attaching latest management server log file and cloud DB. > [UI] Failed to copy region-wide ISO between zones > ------------------------------------------------- > > Key: CLOUDSTACK-3950 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3950 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API > Affects Versions: 4.2.0 > Environment: Latest build from ACS 4.2 branch > Reporter: Sanjeev N > Assignee: Jessica Wang > Priority: Critical > Fix For: 4.2.0 > > Attachments: 2013-08-16-A.jpg, cloud.dmp, cloud.dmp, cloud.dmp, > jessica_1.jpg, jessica_2.jpg, jessica_3.jpg, jessica_4.jpg, > management-server.rar, management-server.rar > > > Failed to copy ISO between zones > Steps to Reproduce: > ================ > 1.Bring up CS with two zones. > zone1: Advanced with vmware cluster > zone2: Basic with xen cluster > 2.Register iso in zone1 > 3.Try to copy iso to zone2 > Result: > ======= > Copy iso failed with com.cloud.utils.exception.CloudRuntimeException: can't > find mapping in ObjectInDataStore table for: > org.apache.cloudstack.storage.image.store.TemplateObject@fde83db > But DownloadProgressCommand shows the downloadstatus as "DOWNLOADED" and > "errorString":"Install completed successfully at 7/30/13 12:07 PM" > Also I see template is copied to secondary storage in zone2. But no entries > got created for this copied template in vm_template and template_store_ref. > Following is the log snippet: > ======================= > 2013-07-30 08:07:23,216 DEBUG [cloud.api.ApiServlet] (catalina-exec-9:null) > ===START=== 10.146.0.20 -- GET > command=copyIso&id=21c7b14d-e799-4334-b5d6-62f813c2c8fa&sourcezoneid=8605b683-4c48-47d8-941a-b21f28a96b0c&destzoneid=188b12a6-00fe-49b9-b212-931f1d30af1a&response=json&sessionkey=bYZvp3S8yUe%2BpNShiKI3%2BsGhzno%3D&_=1375186043583 > 2013-07-30 08:07:23,248 DEBUG [cloud.async.AsyncJobManagerImpl] > (catalina-exec-9:null) submit async job-47 = [ > 094edee6-17ce-49ff-89a6-6211ad63f185 ], details: AsyncJobVO {id:47, userId: > 2, accountId: 2, sessionKey: null, instanceType: Template, instanceId: 203, > cmd: org.apache.cloudstack.api.command.user.iso.CopyIsoCmd, cmdOriginator: > null, cmdInfo: > {"response":"json","id":"21c7b14d-e799-4334-b5d6-62f813c2c8fa","sessionkey":"bYZvp3S8yUe+pNShiKI3+sGhzno\u003d","destzoneid":"188b12a6-00fe-49b9-b212-931f1d30af1a","cmdEventType":"TEMPLATE.COPY","ctxUserId":"2","httpmethod":"GET","_":"1375186043583","ctxAccountId":"2","sourcezoneid":"8605b683-4c48-47d8-941a-b21f28a96b0c","ctxStartEventId":"173"}, > 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-07-30 08:07:23,251 DEBUG [cloud.api.ApiServlet] (catalina-exec-9:null) > ===END=== 10.146.0.20 -- GET > command=copyIso&id=21c7b14d-e799-4334-b5d6-62f813c2c8fa&sourcezoneid=8605b683-4c48-47d8-941a-b21f28a96b0c&destzoneid=188b12a6-00fe-49b9-b212-931f1d30af1a&response=json&sessionkey=bYZvp3S8yUe%2BpNShiKI3%2BsGhzno%3D&_=1375186043583 > 2013-07-30 08:07:23,255 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) Executing > org.apache.cloudstack.api.command.user.iso.CopyIsoCmd for job-47 = [ > 094edee6-17ce-49ff-89a6-6211ad63f185 ] > 2013-07-30 08:07:23,298 DEBUG [storage.image.TemplateDataFactoryImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) template > 203 is already in store:1, type:Image > 2013-07-30 08:07:23,308 DEBUG [storage.image.TemplateDataFactoryImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) template > 203 is not in store:2, type:Image > 2013-07-30 08:07:23,308 DEBUG [storage.image.TemplateServiceImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) Setting > source template url to > https://10-147-48-3.realhostip.com/copy/SecStorage/21ac712e-6690-39a2-9c7b-cc3d5108db5f/template/tmpl/2/203/203-2-056e10f1-6788-3e3d-85af-f02d2680b8bb.iso > 2013-07-30 08:07:23,308 DEBUG [storage.image.TemplateServiceImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) Mark > template_store_ref entry as Creating > 2013-07-30 08:07:23,318 DEBUG [storage.image.TemplateDataFactoryImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) template > 203 is already in store:2, type:Image > 2013-07-30 08:07:23,326 DEBUG [storage.image.TemplateServiceImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) Invoke > datastore driver createAsync to create template on destination store > 2013-07-30 08:07:23,340 DEBUG [storage.image.BaseImageStoreDriverImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) > Downloading template to data store 2 > 2013-07-30 08:07:23,352 DEBUG [storage.image.BaseImageStoreDriverImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) > Performing image store createTemplate async callback > 2013-07-30 08:07:23,363 INFO [storage.download.DownloadMonitorImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) abandon > obsolete download listener > 2013-07-30 08:07:23,365 DEBUG [storage.image.BaseImageStoreDriverImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) > Performing image store createTemplate async callback > 2013-07-30 08:07:23,377 DEBUG [storage.image.TemplateServiceImpl] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) > Performing copy template cross zone callback after completion > 2013-07-30 08:07:23,391 DEBUG [cloudstack.storage.RemoteHostEndPoint] > (Job-Executor-47:job-47 = [ 094edee6-17ce-49ff-89a6-6211ad63f185 ]) Sending > command org.apache.cloudstack.storage.command.DownloadProgressCommand to > host: 5 > 2013-07-30 08:07:57,279 DEBUG [image.store.TemplateObject] > (RemoteHostEndPoint-1:null) failed to process event and answer > com.cloud.utils.exception.CloudRuntimeException: can't find mapping in > ObjectInDataStore table for: > org.apache.cloudstack.storage.image.store.TemplateObject@fde83db > at > org.apache.cloudstack.storage.datastore.ObjectInDataStoreManagerImpl.update(ObjectInDataStoreManagerImpl.java:239) > at > org.apache.cloudstack.storage.image.store.TemplateObject.processEvent(TemplateObject.java:210) > at > org.apache.cloudstack.storage.image.TemplateServiceImpl.copyTemplateCrossZoneCallBack(TemplateServiceImpl.java:677) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:616) > at > org.apache.cloudstack.framework.async.AsyncCallbackDispatcher.dispatch(AsyncCallbackDispatcher.java:142) > at > org.apache.cloudstack.framework.async.InplaceAsyncCallbackDriver.performCompletionCallback(InplaceAsyncCallbackDriver.java:26) > at > org.apache.cloudstack.framework.async.AsyncCallbackDispatcher.complete(AsyncCallbackDispatcher.java:120) > at > org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl.createTemplateAsyncCallback(BaseImageStoreDriverImpl.java:175) > at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:616) > at > org.apache.cloudstack.framework.async.AsyncCallbackDispatcher.dispatch(AsyncCallbackDispatcher.java:142) > at > org.apache.cloudstack.framework.async.InplaceAsyncCallbackDriver.performCompletionCallback(InplaceAsyncCallbackDriver.java:26) > at > org.apache.cloudstack.framework.async.AsyncCallbackDispatcher.complete(AsyncCallbackDispatcher.java:120) > at > com.cloud.storage.download.DownloadListener.callback(DownloadListener.java:263) > at > com.cloud.storage.download.DownloadState.onEntry(DownloadState.java:65) > at > com.cloud.storage.download.DownloadCompleteState.onEntry(DownloadCompleteState.java:38) > at > com.cloud.storage.download.DownloadListener.transition(DownloadListener.java:252) > at > com.cloud.storage.download.DownloadListener.processAnswers(DownloadListener.java:236) > at > com.cloud.storage.upload.UploadListener$Callback.complete(UploadListener.java:477) > at > com.cloud.storage.upload.UploadListener$Callback.complete(UploadListener.java:466) > at > org.apache.cloudstack.storage.RemoteHostEndPoint$CmdRunner.run(RemoteHostEndPoint.java:166) > 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.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266) > 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-07-30 08:07:57,283 WARN > [storage.datastore.ObjectInDataStoreManagerImpl] (RemoteHostEndPoint-1:null) > Template 203 is not found on image store 2, so no need to delete -- 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