每次扩展节点组时都附加一个新卷

时间:2018-11-11 20:51:07

标签: cloudify

有人会在每次扩展该实例的部署时共享任何参考模板来创建新卷并附加到新实例吗?

我的模板如下:

node_templates:
  key_pair:
    ...
  vol:
    ...
  node_host:
    ...
    relationships:
      ...
      - key_pair
      - vol
  node:
    ...
    relationships:
      - type: cloudify.relationships.contained_in
        target: node_host
      ...

groups:
  scale_up_group:
    members: [node, node_host, vol]
    policies:
      auto_scale_up:
        type: scale_policy_type
        properties:
          policy_operates_on_group: true
          scale_limit: 6
          scale_direction: '<'
          scale_threshold: 15
          service_selector: cpu.total.user
          cooldown_time: 60
        triggers:
          execute_scale_workflow:
            type: cloudify.policies.triggers.execute_workflow
            parameters:
              workflow: scale
              workflow_parameters:
                delta: 1
                scalable_entity_name: node
                scale_compute: true

1 个答案:

答案 0 :(得分:0)

由Cloudify用户组的Trammell提供:

node_templates:
  key_pair:
    type: cloudify.openstack.nodes.KeyPair
    ...

  floating_ip:
    type: cloudify.openstack.nodes.FloatingIP
    ...

  vol:
    type: cloudify.openstack.nodes.Volume
    ...
  node_host:
    type: cloudify.openstack.nodes.Server
    ...

    relationships:
      - type: cloudify.openstack.server_connected_to_keypair
        target: keypair
      - type: cloudify.openstack.server_connected_to_floating_ip
        target: floating_ip
      - type: cloudify.relationships.depends_on
        target: vol

  node:
    type: custom.node.type
    ...
    relationships:
      - type: cloudify.relationships.contained_in
        target: node_host
      ...

groups:
  scale_vm:
    members: [node, node_host, floating_ip, vol]



  scale_up_group:
    members: [node, node_host, floating_ip, vol]
    policies:
      auto_scale_up:
        type: scale_policy_type
        properties:
          policy_operates_on_group: true
          scale_limit: 6
          scale_direction: '<'
          scale_threshold: 15
          service_selector: cpu.total.user
          cooldown_time: 60
        triggers:
          execute_scale_workflow:
            type: cloudify.policies.triggers.execute_workflow
            parameters:
              workflow: scale
              workflow_parameters:
                delta: 1
                scalable_entity_name: scale_vm
                scale_compute: true

policies:
  scale_vm_policy:
    type: cloudify.policies.scaling
    properties:
      default_instances:  1
    targets: [scale_vm]

参考:https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/cloudify-users/TPepGofpSBU