1 heat_template_version: 2015-10-15
3 OpenStack compute node post deployment for Docker.
10 description: Value which changes if the node configuration may need to be re-applied
13 default: tripleoupstream
16 DockerComputeDataImage:
20 DockerNeutronAgentImage:
22 DockerOpenvswitchImage:
24 DockerOvsVswitchdImage:
26 DockerOpenvswitchDBImage:
30 default: "/etc/libvirt/libvirtd.conf"
33 default: "/etc/nova/nova.conf"
34 NeutronOpenvswitchAgentConfig:
36 default: "/etc/neutron/neutron.conf,/etc/neutron/plugins/ml2/ml2_conf.ini"
39 default: "/etc/neutron/neutron.conf,/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
40 NeutronAgentPluginVolume:
42 description: The neutron agent plugin to mount into the neutron-agents container
43 default: "/var/lib/etc-data/neutron/plugins/ml2/openvswitch_agent.ini:/var/lib/kolla/config_files/ovs_neutron_plugin.ini:ro"
44 NeutronAgentOvsVolume:
46 description: The neutron agent ovs agents to mount into the neutron-agents container
52 type: OS::Heat::SoftwareConfig
58 tags: package,file,concat,file_line,nova_config,neutron_config,neutron_agent_ovs,neutron_plugin_ml2
60 - name: tripleo::packages::enable_install
66 get_file: ../puppet/manifests/overcloud_compute.pp
68 ComputePuppetDeployment:
69 type: OS::Heat::SoftwareDeployments
71 servers: {get_param: servers}
72 config: {get_resource: ComputePuppetConfig}
74 update_identifier: {get_param: NodeConfigIdentifiers}
75 tripleo::packages::enable_install: True
78 type: OS::Heat::SoftwareConfig
83 config: {get_file: ./copy-etc.sh}
86 type: OS::Heat::SoftwareDeployments
87 depends_on: ComputePuppetDeployment
89 config: {get_resource: CopyEtcConfig}
90 servers: {get_param: servers}
93 type: OS::Heat::SoftwareConfig
97 - name: libvirt_config
99 - name: neutron_openvswitch_agent_config
100 - name: neutron_agent_config
108 libvirt_perms = '644'
110 libvirt_config = os.getenv('libvirt_config').split(',')
111 nova_config = os.getenv('nova_config').split(',')
112 neutron_openvswitch_agent_config = os.getenv('neutron_openvswitch_agent_config').split(',')
113 neutron_agent_config = os.getenv('neutron_agent_config').split(',')
115 # Command, Config_files, Owner, Perms
116 services = {'nova-libvirt': ['/usr/sbin/libvirtd', libvirt_config, 'root', libvirt_perms],
117 'nova-compute': ['/usr/bin/nova-compute', nova_config, 'nova', file_perms],
118 'neutron-openvswitch-agent': ['/usr/bin/neutron-openvswitch-agent', neutron_openvswitch_agent_config, 'neutron', file_perms],
119 'neutron-agent': ['/usr/bin/neutron-openvswitch-agent', neutron_agent_config, 'neutron', file_perms],
120 'ovs-vswitchd': ['/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/openvswitch/ovs-vswitchd.log'],
121 'ovsdb-server': ['/usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --log-file=/var/log/openvswitch/ovsdb-server.log']
125 def build_config_files(config, owner, perms):
126 config_source = '/var/lib/kolla/config_files/'
127 config_files_dict = {}
128 source = os.path.basename(config)
130 config_files_dict.update({'source': config_source + source,
134 return config_files_dict
137 for service in services:
138 if service != 'ovs-vswitchd' and service != 'ovsdb-server':
139 command = services.get(service)[0]
140 config_files = services.get(service)[1]
141 owner = services.get(service)[2]
142 perms = services.get(service)[3]
143 config_files_list = []
144 for config_file in config_files:
145 if service == 'nova-libvirt':
146 command = command + ' --config ' + config_file
148 command = command + ' --config-file ' + config_file
149 data['command'] = command
150 config_files_dict = build_config_files(config_file, owner, perms)
151 config_files_list.append(config_files_dict)
152 data['config_files'] = config_files_list
154 data['command'] = services.get(service)[0]
155 data['config_files'] = []
157 json_config_dir = '/var/lib/etc-data/json-config/'
158 with open(json_config_dir + service + '.json', 'w') as json_file:
159 json.dump(data, json_file, sort_keys=True, indent=4, separators=(',', ': '))
162 type: OS::Heat::SoftwareDeployments
163 depends_on: CopyEtcDeployment
165 config: {get_resource: CopyJsonConfig}
166 servers: {get_param: servers}
168 libvirt_config: {get_param: LibvirtConfig}
169 nova_config: {get_param: NovaConfig}
170 neutron_openvswitch_agent_config: {get_param: NeutronOpenvswitchAgentConfig}
171 neutron_agent_config: {get_param: NeutronAgentConfig}
173 NovaComputeContainersDeploymentOVS:
174 type: OS::Heat::StructuredDeployments
175 depends_on: CopyJsonDeployment
177 config: {get_resource: NovaComputeContainersConfigOVS}
178 servers: {get_param: servers}
180 NovaComputeContainersConfigOVS:
181 type: OS::Heat::StructuredConfig
183 group: docker-compose
189 - [ {get_param: DockerNamespace}, {get_param: DockerOvsVswitchdImage} ]
190 container_name: ovs-vswitchd
196 - /lib/modules:/lib/modules:ro
197 - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
199 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
205 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
206 container_name: ovsdb-server
211 - /var/lib/etc-data/json-config/ovsdb-server.json:/var/lib/kolla/config_files/config.json
213 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
215 NovaComputeContainersDeploymentNetconfig:
216 type: OS::Heat::SoftwareDeployments
217 depends_on: NovaComputeContainersDeploymentOVS
219 config: {get_resource: NovaComputeContainersConfigNetconfig}
220 servers: {get_param: servers}
222 # We run os-net-config here because we depend on the ovs containers to be up
223 # and running before we configure the network. This allows explicit timing
224 # of the network configuration.
225 NovaComputeContainersConfigNetconfig:
226 type: OS::Heat::SoftwareConfig
233 /usr/local/bin/run-os-net-config
235 LibvirtContainersDeployment:
236 type: OS::Heat::StructuredDeployments
237 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
239 config: {get_resource: LibvirtContainersConfig}
240 servers: {get_param: servers}
242 LibvirtContainersConfig:
243 type: OS::Heat::StructuredConfig
245 group: docker-compose
251 - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
252 container_name: computedata
254 - /var/lib/nova/instances
261 - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
262 container_name: libvirt
269 - /lib/modules:/lib/modules:ro
270 - /sys/fs/cgroup:/sys/fs/cgroup
271 - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
272 - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
274 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
278 NovaComputeContainersDeployment:
279 type: OS::Heat::StructuredDeployments
280 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
282 config: {get_resource: NovaComputeContainersConfig}
283 servers: {get_param: servers}
285 NovaComputeContainersConfig:
286 type: OS::Heat::StructuredConfig
288 group: docker-compose
294 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
295 container_name: openvswitch
301 - /lib/modules:/lib/modules:ro
302 - /var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json
303 - /var/lib/etc-data/neutron/neutron.conf:/etc/kolla/neutron-openvswitch-agent/:ro
304 - /var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro
305 - /var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro
307 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
315 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
316 container_name: neutronagent
326 - [ "/run:/run", "/lib/modules:/lib/modules:ro",
327 "/var/lib/etc-data/json-config/neutron-agent.json:/var/lib/kolla/config_files/config.json",
328 "/var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro",
329 {get_param: NeutronAgentPluginVolume},
330 {get_param: NeutronAgentOvsVolume} ]
332 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
340 - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
341 container_name: novacompute
347 - /lib/modules:/lib/modules:ro
348 - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
349 - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
351 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
356 depends_on: NovaComputeContainersDeployment
357 type: OS::TripleO::NodeExtraConfigPost
359 servers: {get_param: servers}