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} ]
199 - /lib/modules:/lib/modules:ro
200 - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
202 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
208 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
213 - /var/lib/etc-data/json-config/ovsdb-server.json:/var/lib/kolla/config_files/config.json
215 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
217 NovaComputeContainersDeploymentNetconfig:
218 type: OS::Heat::SoftwareDeployments
219 depends_on: NovaComputeContainersDeploymentOVS
221 name: NovaComputeContainersDeploymentNetconfig
222 config: {get_resource: NovaComputeContainersConfigNetconfig}
223 servers: {get_param: servers}
225 # We run os-net-config here because we depend on the ovs containers to be up
226 # and running before we configure the network. This allows explicit timing
227 # of the network configuration.
228 NovaComputeContainersConfigNetconfig:
229 type: OS::Heat::SoftwareConfig
236 /usr/local/bin/run-os-net-config
238 LibvirtContainersDeployment:
239 type: OS::Heat::StructuredDeployments
240 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
242 name: LibvirtContainersDeployment
243 config: {get_resource: LibvirtContainersConfig}
244 servers: {get_param: servers}
246 LibvirtContainersConfig:
247 type: OS::Heat::StructuredConfig
249 group: docker-compose
255 - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
256 container_name: computedata
258 - /var/lib/nova/instances
265 - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
272 - /lib/modules:/lib/modules:ro
273 - /sys/fs/cgroup:/sys/fs/cgroup
274 - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
275 - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
277 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
281 NovaComputeContainersDeployment:
282 type: OS::Heat::StructuredDeployments
283 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
285 name: NovaComputeContainersDeployment
286 config: {get_resource: NovaComputeContainersConfig}
287 servers: {get_param: servers}
289 NovaComputeContainersConfig:
290 type: OS::Heat::StructuredConfig
292 group: docker-compose
298 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
304 - /lib/modules:/lib/modules:ro
305 - /var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json
306 - /var/lib/etc-data/neutron/neutron.conf:/etc/kolla/neutron-openvswitch-agent/:ro
307 - /var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro
308 - /var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro
310 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
318 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
328 - [ "/run:/run", "/lib/modules:/lib/modules:ro",
329 "/var/lib/etc-data/json-config/neutron-agent.json:/var/lib/kolla/config_files/config.json",
330 "/var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro",
331 {get_param: NeutronAgentPluginVolume},
332 {get_param: NeutronAgentOvsVolume} ]
334 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
342 - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
348 - /lib/modules:/lib/modules:ro
349 - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
350 - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
352 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
357 depends_on: NovaComputeContainersDeployment
358 type: OS::TripleO::NodeExtraConfigPost
360 servers: {get_param: servers}