[
https://issues.apache.org/jira/browse/CLOUDSTACK-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13711895#comment-13711895
]
Fang Wang commented on CLOUDSTACK-3604:
---------------------------------------
it is a set up issue. With another developer's set up, I can't reproduce the
problem and it works fine.
We found the root cause of this problem:
the template directory requires "root" privilage to do write.
drwxr-xr-x. 9 root root 4096 Jul 17 16:14 tmpl
In your set up, you are running as user "cloud" which does not have permission
to write in that dir.
and create a directory and write to it caused the permission denied error. I
verified it manually, loging as "cloud",
I can't do a mkdir :
-sh-4.1$ pwd
/var/cloudstack/mnt/VM/90928106758026.1ecaaabf/template/tmpl
-sh-4.1$ ls
1 101 14 17 406 411 81
-sh-4.1$ mkdir 2
mkdir: cannot create directory `2': Permission denied
> [Automation][BVT] Failed to create template from root volume
> ------------------------------------------------------------
>
> Key: CLOUDSTACK-3604
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3604
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Template
> Affects Versions: 4.2.0
> Environment: VMware
> branch 4.2
> Reporter: Rayees Namathponnan
> Assignee: Fang Wang
> Priority: Blocker
> Fix For: 4.2.0
>
> Attachments: CLOUDSTACK-3604.rar
>
>
> BVT test case cloudstack/test/integration/smoke/test_templates.py failed
> To reproduce this manually, create a template from vm's root volume. it
> failed with below error
> ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-22:job-1610 = [
> 07ba278a-ccc2-4481-ab3a-562fe58df847 ]) Unexpected exception while executing
> org.apache.cloudstack.api.command.user.template.CreateTemplateCmd
> com.cloud.utils.exception.CloudRuntimeException: Failed to create
> templateCreatePrivateTemplateFromVolumeCommand exception:
> java.lang.Exception: unable to prepare template directory:
> template/tmpl/417/228, storage:
> nfs://10.223.110.232:/export/home/automation/SC-CLOUD-QA03/secondary1, error
> msg: mkdir: cannot create directory
> `/var/cloudstack/mnt/VM/90928106758026.1ecaaabf/template/tmpl/417':
> Permission denied
> com.cloud.storage.resource.VmwareStorageProcessor.createTemplateFromVolume(VmwareStorageProcessor.java:492)
> com.cloud.storage.resource.VmwareStorageProcessor.createTemplateFromVolume(VmwareStorageProcessor.java:576)
> com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.execute(StorageSubsystemCommandHandlerBase.java:81)
> com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.handleStorageCommands(StorageSubsystemCommandHandlerBase.java:49)
> com.cloud.hypervisor.vmware.resource.VmwareResource.executeRequest(VmwareResource.java:565)
> com.cloud.agent.manager.DirectAgentAttache$Task.run(DirectAgentAttache.java:186)
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> java.util.concurrent.FutureTask.run(FutureTask.java:166)
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> java.lang.Thread.run(Thread.java:722)
> at
> com.cloud.template.TemplateManagerImpl.createPrivateTemplate(TemplateManagerImpl.java:1372)
> at
> com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
> at
> org.apache.cloudstack.api.command.user.template.CreateTemplateCmd.execute(CreateTemplateCmd.java:256)
> 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:722)
--
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