[VVP] Misc tweaks and fixes to preload generation
[vvp/validation-scripts.git] / ice_validator / app_tests / preload_tests / sample_heat / incremental.yaml
1 heat_template_version: 2015-04-30
2
3 description: Base Module of Sample VNF
4
5 parameters:
6
7   # ONAP Assigned Parameters
8   workload_context:
9     type: string
10     description: Unique ID for this VNF instance
11
12   environment_context:
13     type: string
14     description: Unique ID for this VNF instance
15
16   vnf_id:
17     type: string
18     description: Unique ID for this VNF instance
19
20   vf_module_id:
21     type: string
22     description: Unique ID for this VNF module instance
23
24   vf_module_index:
25     type: number
26     description: Index of this VF Module
27
28   vnf_name:
29     type: string
30     description: Unique name for this VNF instance
31
32
33   # Availability Zones
34   availability_zone_0:
35     type: string
36     description: Primary Availability Zone
37
38
39   # External Networks
40   ha_net_id:
41     type: string
42     description:  High Availability Network
43
44   int_private_net_id:
45     type: string
46     description: Private network
47
48   int_private_subnet_id:
49     type: string
50     description: Private network subnet
51   
52   # Server Inputs: Loadbalancer
53   lb_names:
54     type: comma_delimited_list
55     description: Load Balancer Names
56
57   lb_image_name:
58     type: string
59     description: Loadbalancer VM Image
60
61   lb_flavor_name:
62     type: string
63     description: Loadbalancer VM Flavor
64
65   lb_ha_floating_ip:
66     type: string
67     description: Floating HA IP for LB
68
69   lb_ha_floating_v6_ip:
70     type: string
71     description: Floating HA IP for LB
72
73   # Server Inputs: Services
74   svc_0_names:
75     type: comma_delimited_list
76     description: Service VM Names
77
78   svc_1_names:
79     type: comma_delimited_list
80     description: Service VM Names
81
82   svc_2_names:
83     type: comma_delimited_list
84     description: Service VM Names
85
86   svc_image_name:
87     type: string
88     description: Service VM Image
89
90   svc_flavor_name:
91     type: string
92     description: Service VM Flavor
93
94   svc_count:
95     type: number
96     description: Number of instances of Service to create
97
98 resources:
99
100           
101   lb_server_1:
102     type: OS::Nova::Server
103     properties:
104       image: { get_param: lb_image_name }
105       flavor: { get_param: lb_flavor_name }
106       name: { get_param: [lb_names, {get_param: vf_module_index}] }
107       metadata:
108         vnf_id: { get_param: vnf_id }
109         vf_module_id: { get_param: vf_module_id }
110         vf_module_index: { get_param: vf_module_index }
111         vnf_name: { get_param: vnf_name }
112         workload_context: { get_param: workload_context }
113         environment_context: { get_param: environment_context }
114       networks:
115         - port: { get_resource: lb_1_int_private_port_0 }
116         - port: { get_resource: lb_1_ha_port_0 }
117       user_data: { get_file: user.data }
118       availability_zone: { get_param: availability_zone_0 }
119
120   lb_1_ha_port_0:
121     type: OS::Neutron::Port
122     properties:
123       network: { get_param: ha_net_id }
124       allowed_address_pairs:
125         - ip_address: {get_param: lb_ha_floating_ip }
126         - ip_address: {get_param: lb_ha_floating_v6_ip }
127
128   lb_1_int_private_port_0:
129     type: OS::Neutron::Port
130     properties:
131       network: { get_param: int_private_net_id }
132       fixed_ips: 
133         - subnet: { get_param: int_private_subnet_id }
134   
135   svc_resource_group_1:
136     type: OS::Heat::ResourceGroup
137     properties:
138       count: { get_param: svc_count }
139       resource_def:
140         type: nested_svc.yaml
141         properties:
142           workload_context: {get_param: workload_context}
143           environment_context: {get_param: environment_context}
144           vnf_id: {get_param: vnf_id}
145           vf_module_id: {get_param: vf_module_id}
146           vnf_name: {get_param: vnf_name}         
147           availability_zone_0: {get_param: availability_zone_0}
148           svc_names:
149           - {get_param: [svc_0_names, {get_param: vf_module_index}]}
150           - {get_param: [svc_1_names, {get_param: vf_module_index}]}
151           - {get_param: [svc_2_names, {get_param: vf_module_index}]}
152           svc_image_name: {get_param: svc_image_name}
153           svc_flavor_name: {get_param: svc_flavor_name}
154           int_private_net_id: {get_param: int_private_net_id}
155           int_private_subnet_id: {get_param: int_private_subnet_id}
156           index: "%index%"