7d8d5129d0e2cb08efbfda0a49669769f3a8cef6
[sdc.git] /
1 heat_template_version: 2015-04-30
2 #################################
3 # Author: Dmitry Orzhehovsky
4 # Email:  dorzheho@cisco.com
5 #################################
6 description: >
7   The template intended for deploying vSON VM instance.
8
9 parameters:
10
11   instance_index:
12     type: number
13     label: Instance Index
14     description: Index of the instance.
15
16   vnf_name:
17     type: string
18     label: VF name
19     description: Unique name for this VF instance.
20
21   vnf_id:
22     type: string
23     label: VF ID
24     description: Unique ID for this VF instance.
25
26   vf_module_name:
27     type: string
28     label: VF module name
29     description: Unique name for this VF module instance.
30
31   vf_module_id:
32     type: string
33     label: VF module ID
34     description: Unique ID for this VF Module instance
35
36   vfc_role:
37     type: string
38     label: VF module ID
39     description: Unique ID for this VF Module instance
40
41   oam_net_id:
42     type: string
43     label: OAM network ID
44     description: The ID of the OAM network.
45
46   oam_net_subnet_prefix_length: 
47     type: string
48     label: OAM net subnet prefix length
49     description: Prefix length of the subnet on the OAM network.
50
51   default_gateway: 
52     type: string
53     label: Default gateway
54     description: Default gateway.
55
56   dns_servers:
57     type: comma_delimited_list
58     label: DNS servers
59     description: List of DNS servers.
60
61   ntp_servers:
62     type: comma_delimited_list
63     label: NTP servers 
64     description: List of NTP servers.
65
66   oam_net_security_group_id:
67     type: string
68     label: OAM network security group ID
69     description: >
70       The ID of Security group applied on the port
71       bound to the vSON OAM network.
72
73   availability_zones:
74     type: comma_delimited_list
75     label: Availability zones
76     description: List of availability zones.
77
78   vson_server_group_id:
79     type: string
80     label: vSON server group ID
81     description: >
82       Tells what policy should be applied to the ServerGroup.
83       Affinity policy will force instances to share the same hypervisor.
84       Anti-affinity will force instances to run in different hypervisors.
85
86   vson_vm_names:
87     type: comma_delimited_list
88     label: vSON Cluster leader names
89     description: A list of unique names to be issued to the vSON Cluster leaders.
90
91   oam_net_ips:
92     type: comma_delimited_list
93     label: vSON OAM network IP addresses
94     description: Fixed IP assignments for vSON instances on the OAM network.
95
96   vson_vm_image_name:
97     type: string
98     label: vSON base VM image name
99     description: VM Image name the vSON instance will be created from.
100
101   vson_vm_flavor_name:
102     type: string
103     label: Flavor name
104     description: The ID or name of the flavor to boot onto.
105
106   vson_cluster_name:
107     type: string
108     label: vSON Cluster name
109     description: Name of the vSON Cluster.
110
111   vson_clm_oam_net_ip:
112     type: string
113     label: vSON Cluster Manager IP
114     description: IP of the vSON Cluster Manager.
115
116   swift_storage_url:
117     type: string
118     label: swift storage URL
119     description: >
120       Swift storage URL.
121       Example: http://172.16.209.246:8080/v1/AUTH_a4d426b5ef2e41408a8e6e6b9a8d3029
122       http://172.16.209.246:8080 - protocol, IP and port,
123       v1 - API version
124       AUTH_a4d426b5ef2e41408a8e6e6b9a8d3029 - account ID
125
126   swift_account_auth_token:
127     type: string
128     label: Swift account auth token
129     description: >
130       Swift account auth token.
131       Example:  041a5187bb4641f9b89583e2539776b0
132
133   swift_son_container_name:
134     type: string
135     label: SON Swift
136     description: Swift container storing vSON artifacts.
137
138 resources:
139
140   wait_condition:
141     type: OS::Heat::SwiftSignal
142     properties:
143       handle: {get_resource: wait_handle}
144       count: 1
145       timeout: 800
146
147   wait_handle:
148     type: OS::Heat::SwiftSignalHandle
149
150 # vSON server OAM network port
151   vson_server_oam_net_port_0:
152     type: OS::Neutron::Port
153     properties:
154       name: 
155         str_replace:
156           template: VNF_NAME_VNF_ID_SERVER_NAME_oam_net_port_0
157           params:
158             VNF_NAME: {get_param: vnf_name}
159             VNF_ID: {get_param: vnf_id}
160             SERVER_NAME: {get_param: [vson_vm_names, {get_param: instance_index}]}
161       network_id: {get_param: oam_net_id}
162       fixed_ips:
163         - ip_address: {get_param: [oam_net_ips, {get_param: instance_index}]}
164       security_groups:
165       - {get_param: oam_net_security_group_id}
166
167 # Create vSON server 
168   vson_server:
169     type: OS::Nova::Server
170     depends_on: [vson_server_oam_net_port_0]
171     properties:
172       name: {get_param: [vson_vm_names, {get_param: instance_index}]}
173       availability_zone: {get_param: [availability_zones, {get_param: instance_index}]}
174       image: {get_param: vson_vm_image_name}
175       flavor: {get_param: vson_vm_flavor_name}
176       config_drive: True
177       metadata: 
178         vnf_name: {get_param: vnf_name}
179         vnf_id: {get_param: vnf_id}
180         vf_module_name: {get_param: vf_module_name}
181         vf_module_id: {get_param: vf_module_id}
182         vm_role: {get_param: vfc_role}
183       networks:
184       - port: {get_resource: vson_server_oam_net_port_0}
185       scheduler_hints:
186         group: {get_param: vson_server_group_id}
187       user_data_format: RAW
188       user_data:
189         str_replace:
190           template: {get_file: deploy.sh}
191           params:
192             $HOT_INSTANCE_INDEX: {get_param: instance_index}
193             $HOT_VFC_ROLE: {get_param: vfc_role}
194             $HOT_CLM_SERVER_IP: {get_param: vson_clm_oam_net_ip}
195             $HOT_THIS_INSTANCE_OAM_NET_IP: {get_param: [oam_net_ips, {get_param: instance_index}]}
196             $HOT_THIS_INSTANCE_OAM_NET_PREFIX: {get_param: oam_net_subnet_prefix_length}
197             $HOT_THIS_INSTANCE_DEFAULT_GATEWAY: {get_param: default_gateway}
198             $HOT_DNS_SERVERS: {list_join: [',', {get_param: dns_servers}]}
199             $HOT_NTP_SERVERS: {list_join: [' ', {get_param: ntp_servers}]}
200             $HOT_SWIFT_AUTH_TOKEN: {get_param: swift_account_auth_token}
201             $HOT_CLUSTER_NAME: {get_param: vson_cluster_name}
202             $HOT_SWIFT_STORAGE_URL: {get_param: swift_storage_url}
203             $HOT_SWIFT_CONTAINER_NAME: {get_param: swift_son_container_name}
204             $HOT_WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
205