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 DockerOpenvswitchImage:
22 DockerOvsVswitchdImage:
24 DockerOpenvswitchDBImage:
28 default: "/etc/libvirt/libvirtd.conf"
31 default: "/etc/nova/nova.conf"
32 NeutronOpenvswitchAgentConfig:
34 default: "/etc/neutron/neutron.conf,/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
35 NeutronOpenvswitchAgentPluginVolume:
37 default: "/var/lib/etc-data/neutron/plugins/ml2/openvswitch_agent.ini:/var/lib/kolla/config_files/ovs_neutron_plugin.ini:ro"
38 NeutronOpenvswitchAgentOvsVolume:
45 type: OS::Heat::SoftwareConfig
51 tags: package,file,concat,file_line,nova_config,neutron_config,neutron_agent_ovs,neutron_plugin_ml2
53 - name: tripleo::packages::enable_install
59 get_file: ../puppet/manifests/overcloud_compute.pp
61 ComputePuppetDeployment:
62 type: OS::Heat::SoftwareDeployments
64 name: ComputePuppetDeployment
65 servers: {get_param: servers}
66 config: {get_resource: ComputePuppetConfig}
68 update_identifier: {get_param: NodeConfigIdentifiers}
69 tripleo::packages::enable_install: True
72 type: OS::Heat::SoftwareConfig
77 config: {get_file: ./copy-etc.sh}
80 type: OS::Heat::SoftwareDeployments
81 depends_on: ComputePuppetDeployment
83 name: CopyEtcDeployment
84 config: {get_resource: CopyEtcConfig}
85 servers: {get_param: servers}
88 type: OS::Heat::SoftwareConfig
92 - name: libvirt_config
94 - name: neutron_openvswitch_agent_config
102 libvirt_perms = '644'
104 libvirt_config = os.getenv('libvirt_config').split(',')
105 nova_config = os.getenv('nova_config').split(',')
106 neutron_openvswitch_agent_config = os.getenv('neutron_openvswitch_agent_config').split(',')
108 # Command, Config_files, Owner, Perms
109 services = {'nova-libvirt': ['/usr/sbin/libvirtd', libvirt_config, 'root', libvirt_perms],
110 'nova-compute': ['/usr/bin/nova-compute', nova_config, 'nova', file_perms],
111 'neutron-openvswitch-agent': ['/usr/bin/neutron-openvswitch-agent', neutron_openvswitch_agent_config, 'neutron', file_perms],
112 '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'],
113 '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']
117 def build_config_files(config, owner, perms):
118 config_source = '/var/lib/kolla/config_files/'
119 config_files_dict = {}
120 source = os.path.basename(config)
122 config_files_dict.update({'source': config_source + source,
126 return config_files_dict
129 for service in services:
130 if service != 'ovs-vswitchd' and service != 'ovsdb-server':
131 command = services.get(service)[0]
132 config_files = services.get(service)[1]
133 owner = services.get(service)[2]
134 perms = services.get(service)[3]
135 config_files_list = []
136 for config_file in config_files:
137 if service == 'nova-libvirt':
138 command = command + ' --config ' + config_file
140 command = command + ' --config-file ' + config_file
141 data['command'] = command
142 config_files_dict = build_config_files(config_file, owner, perms)
143 config_files_list.append(config_files_dict)
144 data['config_files'] = config_files_list
146 data['command'] = services.get(service)[0]
147 data['config_files'] = []
149 json_config_dir = '/var/lib/etc-data/json-config/'
150 with open(json_config_dir + service + '.json', 'w') as json_file:
151 json.dump(data, json_file, sort_keys=True, indent=4, separators=(',', ': '))
154 type: OS::Heat::SoftwareDeployments
155 depends_on: CopyEtcDeployment
157 name: CopyJsonDeployment
158 config: {get_resource: CopyJsonConfig}
159 servers: {get_param: servers}
161 libvirt_config: {get_param: LibvirtConfig}
162 nova_config: {get_param: NovaConfig}
163 neutron_openvswitch_agent_config: {get_param: NeutronOpenvswitchAgentConfig}
165 NovaComputeContainersDeploymentOVS:
166 type: OS::Heat::StructuredDeployments
167 depends_on: CopyJsonDeployment
169 name: NovaComputeContainersDeploymentOVS
170 config: {get_resource: NovaComputeContainersConfigOVS}
171 servers: {get_param: servers}
173 NovaComputeContainersConfigOVS:
174 type: OS::Heat::StructuredConfig
176 group: docker-compose
182 - [ {get_param: DockerNamespace}, {get_param: DockerOvsVswitchdImage} ]
188 - /lib/modules:/lib/modules:ro
189 - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
191 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
197 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
202 - /var/lib/etc-data/json-config/ovsdb-server.json:/var/lib/kolla/config_files/config.json
204 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
206 NovaComputeContainersDeploymentNetconfig:
207 type: OS::Heat::SoftwareDeployments
208 depends_on: NovaComputeContainersDeploymentOVS
210 name: NovaComputeContainersDeploymentNetconfig
211 config: {get_resource: NovaComputeContainersConfigNetconfig}
212 servers: {get_param: servers}
214 # We run os-net-config here because we depend on the ovs containers to be up
215 # and running before we configure the network. This allows explicit timing
216 # of the network configuration.
217 NovaComputeContainersConfigNetconfig:
218 type: OS::Heat::SoftwareConfig
225 /usr/local/bin/run-os-net-config
227 LibvirtContainersDeployment:
228 type: OS::Heat::StructuredDeployments
229 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
231 name: LibvirtContainersDeployment
232 config: {get_resource: LibvirtContainersConfig}
233 servers: {get_param: servers}
235 LibvirtContainersConfig:
236 type: OS::Heat::StructuredConfig
238 group: docker-compose
244 - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
245 container_name: computedata
247 - /var/lib/nova/instances
254 - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
261 - /lib/modules:/lib/modules:ro
262 - /sys/fs/cgroup:/sys/fs/cgroup
263 - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
264 - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
266 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
270 NovaComputeContainersDeployment:
271 type: OS::Heat::StructuredDeployments
272 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
274 name: NovaComputeContainersDeployment
275 config: {get_resource: NovaComputeContainersConfig}
276 servers: {get_param: servers}
278 NovaComputeContainersConfig:
279 type: OS::Heat::StructuredConfig
281 group: docker-compose
287 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
297 - [ "/run:/run", "/lib/modules:/lib/modules:ro",
298 "/var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json",
299 "/var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro",
300 "/var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro",
301 {get_param: NeutronOpenvswitchAgentPluginVolume},
302 {get_param: NeutronOpenvswitchAgentOvsVolume} ]
304 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
312 - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
318 - /lib/modules:/lib/modules:ro
319 - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
320 - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
322 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
327 depends_on: NovaComputeContainersDeployment
328 type: OS::TripleO::NodeExtraConfigPost
330 servers: {get_param: servers}