首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Cloudify文件插件“不允许操作”错误

Cloudify文件插件“不允许操作”错误
EN

Stack Overflow用户
提问于 2019-02-21 00:16:10
回答 1查看 52关注 0票数 0

我正在尝试使用cloudify.nodes.File类型将文件复制到VM,但遇到了权限错误,我在找出该错误时遇到了麻烦。

根据the documentation的说法,我应该能够使用以下命令复制文件:

代码语言:javascript
复制
docker_yum_repo:
type: cloudify.nodes.File
properties:
  resource_config:
    resource_path: resources/docker.repo
    file_path: /etc/yum.repos.d/docker.repo
    owner: root:root
    mode: 644

我的蓝图的相关部分是:

代码语言:javascript
复制
vm_0:
  type: cloudify.nodes.aws.ec2.Instances
  properties:
    client_config: *client_config
    agent_config:
      install_method: none
      user: ubuntu
    resource_config:
      kwargs:
        ImageId: { get_attribute: [ ami, aws_resource_id ] }
        InstanceType: t2.micro
        UserData: { get_input: install_script }
        KeyName: automation
  relationships:
    - type: cloudify.relationships.depends_on
      target: ami
    - type: cloudify.relationships.depends_on
      target: nic_0
...
file_0:
  type: cloudify.nodes.File
  properties:
    resource_config:
      resource_path: resources/config/file.conf
      file_path: /home/ubuntu/file.conf
      owner: root:root
      mode: 644
  relationships:
    - type: cloudify.relationships.contained_in
      target: vm_0

但是,我一直收到错误:

代码语言:javascript
复制
2019-02-20 15:36:59.128  CFY <sbin> 'install' workflow execution failed:   RuntimeError: Workflow failed: Task failed 'cloudify_files.tasks.create' ->   [Errno 1] Operation not permitted: './file.conf'
Execution of workflow install for deployment sbin failed. [error=Traceback (most recent call last):
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 571, in _remote_workflow_child_thread
workflow_result = self._execute_workflow_function()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 600, in _execute_workflow_function
result = self.func(*self.args, **self.kwargs)
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/workflows.py", line 30, in install
node_instances=set(ctx.node_instances))
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/lifecycle.py", line 29, in install_node_instances
processor.install()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/lifecycle.py", line 102, in install
graph.execute()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/workflows/tasks_graph.py", line 237, in execute
raise self._error
RuntimeError: Workflow failed: Task failed 'cloudify_files.tasks.create' -> [Errno 1] Operation not permitted: './file.conf'

我尝试了几个不同的file_path值:"/home/ubuntu/file.conf“、"/tmp/file.conf”和"./file.conf“(如上面的错误输出所示),但每次都收到相同的权限错误。我也尝试过关系:cloudify.relationships.depends_on,但也没有成功。

我通过他们的Docker镜像使用Cloudify Manager 4.5.5。

有没有人看过这个问题?我是不是错误地使用了插件?这是“最佳实践”吗?还是应该创建一个已经拥有所有必需文件并在AWS上启动的新虚拟机?

提前感谢!

更新我忘了提一下,如果我试图将文件的所有者设置为ubuntu:ubuntu,我会得到一个关于找不到用户的错误:

代码语言:javascript
复制
2019-02-20 16:19:21.743  CFY <sbin> 'install' workflow execution failed:     RuntimeError: Workflow failed: Task failed 'cloudify_files.tasks.create' -> 'getpwnam(): name not found: ubuntu'
Execution of workflow install for deployment sbin failed. [error=Traceback (most recent call last):
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 571, in _remote_workflow_child_thread
workflow_result = self._execute_workflow_function()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 600, in _execute_workflow_function
result = self.func(*self.args, **self.kwargs)
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/workflows.py", line 30, in install
node_instances=set(ctx.node_instances))
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/lifecycle.py", line 29, in install_node_instances
processor.install()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/plugins/lifecycle.py", line 102, in install
graph.execute()
  File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/workflows/tasks_graph.py", line 237, in execute
raise self._error
RuntimeError: Workflow failed: Task failed 'cloudify_files.tasks.create' -> 'getpwnam(): name not found: ubuntu'

看起来虚拟机还没有准备好接收文件(因为它在安装生命周期中失败了)。

EN

回答 1

Stack Overflow用户

发布于 2019-02-21 04:24:18

在"resource_config“块中尝试"use_sudo: true”。还要添加一个接口块,如下所示:interfaces: cloudify.interfaces.lifecycle: create: executor: host_agent delete: executor: host_agent

如果不覆盖执行程序,它将在管理器上运行(这可能是您看到"ubuntu“用户不存在的原因)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54790839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档