Make network name unique to the job
[releng/builder.git] / openstack-hot / csit-apex-3-instance-type.yaml
1 ---
2 heat_template_version: 2016-04-08
3
4 parameters:
5     job_name:
6         type: string
7         description: Name of job running this template
8     silo:
9         type: string
10         description: Jenkins Silo job is running in (typically releng|sandbox)
11     vm_0_count:
12         type: number
13         description: Number of VMs for 1st VM type
14     vm_0_flavor:
15         type: string
16         default: v1-standard-1
17         description: Flavor to run instance on for 1st VM type
18     vm_0_image:
19         type: string
20         description: Image to run instance on for 1st VM type
21     vm_1_count:
22         type: number
23         description: Number of VMs for 2nd VM type
24     vm_1_flavor:
25         type: string
26         default: v1-standard-1
27         description: Flavor to run instance on for 2nd VM type
28     vm_1_image:
29         type: string
30         description: Image to run instance on for 2nd VM type
31     vm_2_count:
32         type: number
33         description: Number of VMs for 3rd VM type
34     vm_2_flavor:
35         type: string
36         default: v1-standard-1
37         description: Flavor to run instance on for 3rd VM type
38     vm_2_image:
39         type: string
40
41 resources:
42     192_network:
43         type: OS::Neutron::Net
44         properties:
45             name:
46                 str_replace:
47                     template: SILO-JOB_NAME-NET
48                     params:
49                         "SILO": {get_param: silo}
50                         "JOB_NAME": {get_param: job_name}
51                         "NET": 'APEX_192_network'
52             port_security_enabled: false
53
54     192_subnet:
55         type: OS::Neutron::Subnet
56         properties:
57             name:
58                 str_replace:
59                     template: SILO-JOB_NAME-SUBNET
60                     params:
61                         "SILO": {get_param: silo}
62                         "JOB_NAME": {get_param: job_name}
63                         "SUBNET": 'APEX_192_subnet'
64             network_id: {get_resource: 192_network}
65             cidr: 192.0.2.0/24
66             allocation_pools:
67                 - start: 192.0.2.2
68                   end: 192.0.2.50
69
70     vm_0_group:
71         type: "OS::Heat::ResourceGroup"
72         properties:
73             count: {get_param: vm_0_count}
74             resource_def:
75                 type: apex-server.yaml
76                 properties:
77                     job_name: {get_param: job_name}
78                     silo: {get_param: silo}
79                     index: "%index%"
80                     group: "0"
81                     vm_flavor: {get_param: vm_0_flavor}
82                     vm_image: {get_param: vm_0_image}
83                     vm_network: {get_resource: 192_network}
84
85     vm_1_group:
86         type: "OS::Heat::ResourceGroup"
87         properties:
88             count: {get_param: vm_1_count}
89             resource_def:
90                 type: apex-server.yaml
91                 properties:
92                     job_name: {get_param: job_name}
93                     silo: {get_param: silo}
94                     index: "%index%"
95                     group: "1"
96                     vm_flavor: {get_param: vm_1_flavor}
97                     vm_image: {get_param: vm_1_image}
98                     vm_network: {get_resource: 192_network}
99
100     vm_2_group:
101         type: "OS::Heat::ResourceGroup"
102         properties:
103             count: {get_param: vm_2_count}
104             resource_def:
105                 type: apex-server.yaml
106                 properties:
107                     job_name: {get_param: job_name}
108                     silo: {get_param: silo}
109                     index: "%index%"
110                     group: "2"
111                     vm_flavor: {get_param: vm_2_flavor}
112                     vm_image: {get_param: vm_2_image}
113                     vm_network: {get_resource: 192_network}