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 name: ComputePuppetDeployment
72 servers: {get_param: servers}
73 config: {get_resource: ComputePuppetConfig}
75 update_identifier: {get_param: NodeConfigIdentifiers}
76 tripleo::packages::enable_install: True
79 type: OS::Heat::SoftwareConfig
84 config: {get_file: ./copy-etc.sh}
87 type: OS::Heat::SoftwareDeployments
88 depends_on: ComputePuppetDeployment
90 name: CopyEtcDeployment
91 config: {get_resource: CopyEtcConfig}
92 servers: {get_param: servers}
95 type: OS::Heat::SoftwareConfig
99 - name: libvirt_config
101 - name: neutron_openvswitch_agent_config
102 - name: neutron_agent_config
110 libvirt_perms = '644'
112 libvirt_config = os.getenv('libvirt_config').split(',')
113 nova_config = os.getenv('nova_config').split(',')
114 neutron_openvswitch_agent_config = os.getenv('neutron_openvswitch_agent_config').split(',')
115 neutron_agent_config = os.getenv('neutron_agent_config').split(',')
117 # Command, Config_files, Owner, Perms
118 services = {'nova-libvirt': ['/usr/sbin/libvirtd', libvirt_config, 'root', libvirt_perms],
119 'nova-compute': ['/usr/bin/nova-compute', nova_config, 'nova', file_perms],
120 'neutron-openvswitch-agent': ['/usr/bin/neutron-openvswitch-agent', neutron_openvswitch_agent_config, 'neutron', file_perms],
121 'neutron-agent': ['/usr/bin/neutron-openvswitch-agent', neutron_agent_config, 'neutron', file_perms],
122 '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'],
123 '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']
127 def build_config_files(config, owner, perms):
128 config_source = '/var/lib/kolla/config_files/'
129 config_files_dict = {}
130 source = os.path.basename(config)
132 config_files_dict.update({'source': config_source + source,
136 return config_files_dict
139 for service in services:
140 if service != 'ovs-vswitchd' and service != 'ovsdb-server':
141 command = services.get(service)[0]
142 config_files = services.get(service)[1]
143 owner = services.get(service)[2]
144 perms = services.get(service)[3]
145 config_files_list = []
146 for config_file in config_files:
147 if service == 'nova-libvirt':
148 command = command + ' --config ' + config_file
150 command = command + ' --config-file ' + config_file
151 data['command'] = command
152 config_files_dict = build_config_files(config_file, owner, perms)
153 config_files_list.append(config_files_dict)
154 data['config_files'] = config_files_list
156 data['command'] = services.get(service)[0]
157 data['config_files'] = []
159 json_config_dir = '/var/lib/etc-data/json-config/'
160 with open(json_config_dir + service + '.json', 'w') as json_file:
161 json.dump(data, json_file, sort_keys=True, indent=4, separators=(',', ': '))
164 type: OS::Heat::SoftwareDeployments
165 depends_on: CopyEtcDeployment
167 name: CopyJsonDeployment
168 config: {get_resource: CopyJsonConfig}
169 servers: {get_param: servers}
171 libvirt_config: {get_param: LibvirtConfig}
172 nova_config: {get_param: NovaConfig}
173 neutron_openvswitch_agent_config: {get_param: NeutronOpenvswitchAgentConfig}
174 neutron_agent_config: {get_param: NeutronAgentConfig}
176 NovaComputeContainersDeploymentOVS:
177 type: OS::Heat::StructuredDeployments
178 depends_on: CopyJsonDeployment
180 name: NovaComputeContainersDeploymentOVS
181 config: {get_resource: NovaComputeContainersConfigOVS}
182 servers: {get_param: servers}
184 NovaComputeContainersConfigOVS:
185 type: OS::Heat::StructuredConfig
187 group: docker-compose
193 - [ {get_param: DockerNamespace}, {get_param: DockerOvsVswitchdImage} ]
194 container_name: ovs-vswitchd
200 - /lib/modules:/lib/modules:ro
201 - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
203 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
209 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
210 container_name: ovsdb-server
215 - /var/lib/etc-data/json-config/ovsdb-server.json:/var/lib/kolla/config_files/config.json
217 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
219 NovaComputeContainersDeploymentNetconfig:
220 type: OS::Heat::SoftwareDeployments
221 depends_on: NovaComputeContainersDeploymentOVS
223 name: NovaComputeContainersDeploymentNetconfig
224 config: {get_resource: NovaComputeContainersConfigNetconfig}
225 servers: {get_param: servers}
227 # We run os-net-config here because we depend on the ovs containers to be up
228 # and running before we configure the network. This allows explicit timing
229 # of the network configuration.
230 NovaComputeContainersConfigNetconfig:
231 type: OS::Heat::SoftwareConfig
238 /usr/local/bin/run-os-net-config
240 LibvirtContainersDeployment:
241 type: OS::Heat::StructuredDeployments
242 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
244 name: LibvirtContainersDeployment
245 config: {get_resource: LibvirtContainersConfig}
246 servers: {get_param: servers}
248 LibvirtContainersConfig:
249 type: OS::Heat::StructuredConfig
251 group: docker-compose
257 - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
258 container_name: computedata
260 - /var/lib/nova/instances
267 - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
268 container_name: libvirt
275 - /lib/modules:/lib/modules:ro
276 - /sys/fs/cgroup:/sys/fs/cgroup
277 - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
278 - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
280 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
284 NovaComputeContainersDeployment:
285 type: OS::Heat::StructuredDeployments
286 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
288 name: NovaComputeContainersDeployment
289 config: {get_resource: NovaComputeContainersConfig}
290 servers: {get_param: servers}
292 NovaComputeContainersConfig:
293 type: OS::Heat::StructuredConfig
295 group: docker-compose
301 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
302 container_name: openvswitch
308 - /lib/modules:/lib/modules:ro
309 - /var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json
310 - /var/lib/etc-data/neutron/neutron.conf:/etc/kolla/neutron-openvswitch-agent/:ro
311 - /var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro
312 - /var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro
314 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
322 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
323 container_name: neutronagent
333 - [ "/run:/run", "/lib/modules:/lib/modules:ro",
334 "/var/lib/etc-data/json-config/neutron-agent.json:/var/lib/kolla/config_files/config.json",
335 "/var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro",
336 {get_param: NeutronAgentPluginVolume},
337 {get_param: NeutronAgentOvsVolume} ]
339 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
347 - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
348 container_name: novacompute
354 - /lib/modules:/lib/modules:ro
355 - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
356 - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
358 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
363 depends_on: NovaComputeContainersDeployment
364 type: OS::TripleO::NodeExtraConfigPost
366 servers: {get_param: servers}