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,/etc/nova/rootwrap.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:
43 description: Config manifests that will be used to step through the deployment.
50 type: OS::Heat::SoftwareConfig
56 tags: package,file,concat,file_line,nova_config,neutron_config,neutron_agent_ovs,neutron_plugin_ml2
58 - name: tripleo::packages::enable_install
66 - - get_file: ../puppet/manifests/overcloud_compute.pp
67 - {get_param: StepConfig}
70 ComputePuppetDeployment:
71 type: OS::Heat::SoftwareDeployments
73 name: ComputePuppetDeployment
74 servers: {get_param: servers}
75 config: {get_resource: ComputePuppetConfig}
77 update_identifier: {get_param: DeployIdentifier}
78 tripleo::packages::enable_install: True
81 type: OS::Heat::SoftwareConfig
86 config: {get_file: ./copy-etc.sh}
89 type: OS::Heat::SoftwareDeployments
90 depends_on: ComputePuppetDeployment
92 name: CopyEtcDeployment
93 config: {get_resource: CopyEtcConfig}
94 servers: {get_param: servers}
97 type: OS::Heat::SoftwareConfig
101 - name: libvirt_config
103 - name: neutron_openvswitch_agent_config
111 libvirt_perms = '644'
113 libvirt_config = os.getenv('libvirt_config').split(',')
114 nova_config = os.getenv('nova_config').split(',')
115 neutron_openvswitch_agent_config = os.getenv('neutron_openvswitch_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 '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'],
122 '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']
126 def build_config_files(config, owner, perms):
127 config_source = '/var/lib/kolla/config_files/'
128 config_files_dict = {}
129 source = os.path.basename(config)
131 config_files_dict.update({'source': config_source + source,
135 return config_files_dict
138 for service in services:
139 if service != 'ovs-vswitchd' and service != 'ovsdb-server':
140 command = services.get(service)[0]
141 config_files = services.get(service)[1]
142 owner = services.get(service)[2]
143 perms = services.get(service)[3]
144 config_files_list = []
145 for config_file in config_files:
146 if service == 'nova-libvirt':
147 command = command + ' --config ' + config_file
149 command = command + ' --config-file ' + config_file
150 data['command'] = command
151 config_files_dict = build_config_files(config_file, owner, perms)
152 config_files_list.append(config_files_dict)
153 data['config_files'] = config_files_list
155 data['command'] = services.get(service)[0]
156 data['config_files'] = []
158 json_config_dir = '/var/lib/etc-data/json-config/'
159 with open(json_config_dir + service + '.json', 'w') as json_file:
160 json.dump(data, json_file, sort_keys=True, indent=4, separators=(',', ': '))
163 type: OS::Heat::SoftwareDeployments
164 depends_on: CopyEtcDeployment
166 name: CopyJsonDeployment
167 config: {get_resource: CopyJsonConfig}
168 servers: {get_param: servers}
170 libvirt_config: {get_param: LibvirtConfig}
171 nova_config: {get_param: NovaConfig}
172 neutron_openvswitch_agent_config: {get_param: NeutronOpenvswitchAgentConfig}
174 NovaComputeContainersDeploymentOVS:
175 type: OS::Heat::StructuredDeployments
176 depends_on: CopyJsonDeployment
178 name: NovaComputeContainersDeploymentOVS
179 config: {get_resource: NovaComputeContainersConfigOVS}
180 servers: {get_param: servers}
182 NovaComputeContainersConfigOVS:
183 type: OS::Heat::StructuredConfig
191 - [ {get_param: DockerNamespace}, {get_param: DockerOvsVswitchdImage} ]
197 - /lib/modules:/lib/modules:ro
198 - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
200 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
206 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
211 - /var/lib/etc-data/json-config/ovsdb-server.json:/var/lib/kolla/config_files/config.json
212 - /etc/openvswitchd:/etc/openvswitchd
214 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
216 NovaComputeContainersDeploymentNetconfig:
217 type: OS::Heat::SoftwareDeployments
218 depends_on: NovaComputeContainersDeploymentOVS
220 name: NovaComputeContainersDeploymentNetconfig
221 config: {get_resource: NovaComputeContainersConfigNetconfig}
222 servers: {get_param: servers}
224 # We run os-net-config here because we depend on the ovs containers to be up
225 # and running before we configure the network. This allows explicit timing
226 # of the network configuration.
227 NovaComputeContainersConfigNetconfig:
228 type: OS::Heat::SoftwareConfig
235 /usr/local/bin/run-os-net-config
237 LibvirtContainersDeployment:
238 type: OS::Heat::StructuredDeployments
239 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
241 name: LibvirtContainersDeployment
242 config: {get_resource: LibvirtContainersConfig}
243 servers: {get_param: servers}
245 LibvirtContainersConfig:
246 type: OS::Heat::StructuredConfig
254 - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
255 container_name: computedata
257 - /var/lib/nova/instances
264 - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
271 - /lib/modules:/lib/modules:ro
273 - /lib/udev:/lib/udev
274 - /sys/fs/cgroup:/sys/fs/cgroup
275 - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
276 - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
278 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
282 NovaComputeContainersDeployment:
283 type: OS::Heat::StructuredDeployments
284 depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
286 name: NovaComputeContainersDeployment
287 config: {get_resource: NovaComputeContainersConfig}
288 servers: {get_param: servers}
290 NovaComputeContainersConfig:
291 type: OS::Heat::StructuredConfig
299 - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
309 - [ "/run:/run", "/lib/modules:/lib/modules:ro",
310 "/var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json",
311 "/var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro",
312 "/var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro",
313 {get_param: NeutronOpenvswitchAgentPluginVolume},
314 {get_param: NeutronOpenvswitchAgentOvsVolume} ]
316 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
324 - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
330 - /lib/modules:/lib/modules:ro
332 - /lib/udev:/lib/udev
333 - /etc/iscsi:/etc/iscsi
334 - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
335 - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
336 - /var/lib/etc-data/nova/rootwrap.conf:/var/lib/kolla/config_files/rootwrap.conf:ro
338 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
343 depends_on: NovaComputeContainersDeployment
344 type: OS::TripleO::NodeExtraConfigPost
346 servers: {get_param: servers}