首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cloudify自定义工作流缺少cloudify_agent运行时信息

cloudify自定义工作流缺少cloudify_agent运行时信息
EN

Stack Overflow用户
提问于 2016-06-07 07:12:42
回答 1查看 524关注 0票数 0

我想用自己的插件在cloudify中开发自己的工作流“备份”,但当我运行该工作流时,出现了以下错误

代码语言:javascript
复制
'backup' workflow execution failed: RuntimeError: Workflow failed: Task failed 'script_runner.tasks.run' -> Missing cloudify_agent runtime information. This most likely means that the Compute node never started successfully

我不明白为什么,谁能帮我解决这个问题?这是我的主要蓝图代码和插件代码。

我的主要蓝图

代码语言:javascript
复制
tosca_definitions_version: cloudify_dsl_1_2

imports:
  - plugins/backup.yaml
  - types/types.yaml

node_templates:

  mynode:
    type: cloudify.nodes.Compute
    properties:
      ip: "ip"
      agent_config:
        install_method: none
        user: "user"
        key: "key_uri"

  myapp:
    type: cloudify.nodes.ApplicationModule
    interfaces:
      test_platform_backup:
        backup:
          implementation: scripts/backup.sh
          inputs:
            port: 6969
        post_backup:
          implementation: scripts/post_backup.sh
    relationships:
      - type: cloudify.relationships.contained_in
        target: mynode

我的插件代码:

代码语言:javascript
复制
from cloudify.decorators import workflow
from cloudify.workflows import ctx
from cloudify.workflows.tasks_graph import forkjoin

@workflow
def backup(operation, type_name, operation_kwargs, is_node_operation, **kwargs):
    graph = ctx.graph_mode()

    send_event_starting_tasks = {}
    send_event_done_tasks = {}

    for node in ctx.nodes:
        if type_name in node.type_hierarchy:
            for instance in node.instances:
                send_event_starting_tasks[instance.id] = instance.send_event('Starting to run operation')
                send_event_done_tasks[instance.id] = instance.send_event('Done running operation')

    for node in ctx.nodes:
        if type_name in node.type_hierarchy:
            for instance in node.instances:

                sequence = graph.sequence()

                if is_node_operation:
                    operation_task = instance.execute_operation(operation, kwargs=operation_kwargs)
                else:
                    forkjoin_tasks = []
                    for relationship in instance.relationships:
                        forkjoin_tasks.append(relationship.execute_source_operation(operation))
                        forkjoin_tasks.append(relationship.execute_target_operation(operation))
                    operation_task = forkjoin(*forkjoin_tasks)

                sequence.add(
                    send_event_starting_tasks[instance.id],
                    operation_task,
                    send_event_done_tasks[instance.id])

    for node in ctx.nodes:
        for instance in node.instances:
            for rel in instance.relationships:

                instance_starting_task = send_event_starting_tasks.get(instance.id)
                target_done_task = send_event_done_tasks.get(rel.target_id)

                if instance_starting_task and target_done_task:
                    graph.add_dependency(instance_starting_task, target_done_task)

    return graph.execute()
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-07 10:44:33

您的VM似乎没有启动。

从您的代码中,我无法理解您想要做什么。您没有安装和代理,也没有到VM的结构连接,但是您试图在VM上运行操作。

您应该安装一个代理,例如删除"install_method: none",或者向VM添加一个fabric连接并使用它运行操作。

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

https://stackoverflow.com/questions/37672747

复制
相关文章

相似问题

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