summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/storperf/resources/hot/agent-group.yaml
blob: c82ae170e165b1934508451b7985f2eb58850a39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
##############################################################################
# Copyright (c) 2015 EMC and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

heat_template_version: 2017-09-01

parameters:
  public_network:
    type: string
    constraints:
        - custom_constraint: neutron.network
  agent_flavor:
    type: string
    default: "storperf"
  agent_image:
    type: string
    default: 'StorPerf Ubuntu 14.04'
  volume_count:
    type: number
    default: 0
    constraints:
      - range: { min: 0, max: 512 }
        description: must be between 1 and 512 agents.
  volume_size:
    type: number
    description: Size of the volume to be created.
    default: 1
    constraints:
      - range: { min: 1, max: 1024 }
        description: must be between 1 and 1024 Gb.
  volume_type:
    type: string
    default: 'None'
  agent_count:
    type: number
    default: 1
    constraints:
      - range: { min: 1, max: 512 }
        description: must be between 1 and 512 agents.
  availability_zone:
    type: string
    default: nova
  subnet_CIDR:
    type: string
    default: '172.16.0.0/16'
  keypair_name:
    type: string
    default: storperf_agent_keypair

resources:
  slaves:
    type: OS::Heat::ResourceGroup
    depends_on: [storperf_subnet, storperf_network_router_interface,
      storperf_open_security_group, storperf_key_pair]
    properties:
      count: {get_param: agent_count}
      resource_def: {
        type: "storperf-agent.yaml",
        properties: {
          public_network: {get_param: public_network},
          agent_network: {get_resource: storperf_network},
          flavor: {get_param: agent_flavor},
          image: {get_param: agent_image},
          availability_zone: {get_param: availability_zone},
          storperf_open_security_group: {get_resource: storperf_open_security_group},
          key_name: {get_resource: storperf_key_pair},
          volume_count: {get_param: volume_count},
          volume_size: {get_param: volume_size},
          volume_type: {get_param: volume_type}
        }
      }

  storperf_network:
        type: OS::Neutron::Net

  storperf_subnet:
        type: OS::Neutron::Subnet
        properties:
          network_id: { get_resource: storperf_network }
          cidr: { get_param: subnet_CIDR}

  storperf_network_router:
        type: OS::Neutron::Router
        properties:
          external_gateway_info:
                network: { get_param: public_network }

  storperf_network_router_interface:
        type: OS::Neutron::RouterInterface
        properties:
          router_id: { get_resource: storperf_network_router }
          subnet_id: { get_resource: storperf_subnet }

  storperf_key_pair:
    type: OS::Nova::KeyPair
    properties:
      save_private_key: true
      name: { get_param: keypair_name}

  storperf_open_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
      description: An open security group to allow all access to the StorPerf slaves
      rules:
        - remote_ip_prefix: 0.0.0.0/0
          protocol: tcp
          port_range_min: 22
          port_range_max: 22
        - remote_ip_prefix: 0.0.0.0/0
          protocol: icmp



outputs:
  slave_ips: {
      description: "Slave addresses",
      value: { get_attr: [ slaves, storperf_agent_ip] }
  }