1 heat_template_version: pike
4 All configurations which require reboot should be initiated via PreNetworkConfig. After
5 this configuration is completed, the corresponding node will be rebooted.
12 description: Role Specific parameters
15 type: comma_delimited_list
19 description: Whether or not to configure enable DPDK in OVS
23 List of cores to be used for DPDK lcore threads. Note, these threads
24 are used by the OVS control path for validator and handling functions.
27 - allowed_pattern: "[0-9,-]*"
29 OvsDpdkMemoryChannels:
30 description: Number of memory channels per socket to be used for DPDK
33 - allowed_pattern: "[0-9]*"
38 Sets the amount of hugepage memory to assign per NUMA node. It is
39 recommended to use the socket closest to the PCIe slot used for the
40 desired DPDK NIC. The format should be in "<socket 0 mem>, <socket 1
41 mem>, <socket n mem>", where the value is specified in MB. For example:
46 A list or range of CPU cores for PMD threads to be pinned to. Note, NIC
47 location to cores on socket, number of hyper-threaded logical cores, and
48 desired number of PMD threads can all play a role in configuring this
49 setting. These cores should be on the same socket where
50 OvsDpdkSocketMemory is assigned. If using hyperthreading then specify
51 both logical cores that would equal the physical core. Also, specifying
52 more than one core will trigger multiple PMD threads to be spawned which
53 may improve dataplane performance.
55 - allowed_pattern: "[0-9,-]*"
58 # DEPRECATED: the following options are deprecated and are currently maintained
59 # for backwards compatibility. They will be removed in the Queens cycle.
61 description: List of cores to be used for host process
64 - allowed_pattern: "[0-9,-]+"
67 description: List of cores to be used for DPDK Poll Mode Driver
70 - allowed_pattern: "[0-9,-]*"
72 NeutronDpdkMemoryChannels:
73 description: Number of memory channels to be used for DPDK
76 - allowed_pattern: "[0-9]*"
78 NeutronDpdkSocketMemory:
80 description: Memory allocated for each socket
83 default: ['CREATE', 'UPDATE']
84 type: comma_delimited_list
86 List of stack actions that will trigger any deployments in this
87 templates. The actions will be an empty list of the server is in the
88 toplevel DeploymentServerBlacklist parameter's value.
91 is_host_config_required: {not: {equals: [{get_param: [RoleParameters, KernelArgs]}, ""]}}
92 is_dpdk_config_required:
95 expression: $.data.service_names.contains('neutron_ovs_dpdk_agent')
97 service_names: {get_param: ServiceNames}
98 - {equals: [{get_param: [RoleParameters, OvsEnableDpdk]}, true]}
99 is_reboot_config_required:
101 - is_host_config_required
102 - is_dpdk_config_required
103 l_cores_empty: {equals: [{get_param: OvsDpdkCoreList}, '']}
104 pmd_cores_empty: {equals: [{get_param: OvsPmdCoreList}, '']}
105 mem_channels_empty: {equals: [{get_param: OvsDpdkMemoryChannels}, '']}
106 socket_mem_empty: {equals: [{get_param: OvsDpdkSocketMemory}, '']}
107 deployment_actions_empty:
109 - {get_param: deployment_actions}
114 type: OS::Heat::Value
120 - OvsDpdkCoreList: OvsDpdkCoreList
121 OvsDpdkMemoryChannels: OvsDpdkMemoryChannels
122 OvsDpdkSocketMemory: OvsDpdkSocketMemory
123 OvsPmdCoreList: OvsPmdCoreList
124 - values: {get_param: [RoleParameters]}
126 OvsDpdkCoreList: {if: [l_cores_empty, {get_param: HostCpusList}, {get_param: OvsDpdkCoreList}]}
127 OvsDpdkMemoryChannels: {if: [mem_channels_empty, {get_param: NeutronDpdkMemoryChannels}, {get_param: OvsDpdkMemoryChannels}]}
128 OvsDpdkSocketMemory: {if: [socket_mem_empty, {get_param: NeutronDpdkSocketMemory}, {get_param: OvsDpdkSocketMemory}]}
129 OvsPmdCoreList: {if: [pmd_cores_empty, {get_param: NeutronDpdkCoreList}, {get_param: OvsPmdCoreList}]}
131 HostParametersConfig:
132 type: OS::Heat::SoftwareConfig
133 condition: is_host_config_required
137 - name: _KERNEL_ARGS_
138 - name: _TUNED_PROFILE_NAME_
139 - name: _TUNED_CORES_
143 get_file: ansible_host_config.yaml
145 HostParametersDeployment:
146 type: OS::Heat::SoftwareDeployment
147 condition: is_host_config_required
149 name: HostParametersDeployment
150 server: {get_param: server}
151 config: {get_resource: HostParametersConfig}
154 - deployment_actions_empty
156 - ['CREATE'] # Only do this on CREATE
158 _KERNEL_ARGS_: {get_param: [RoleParameters, KernelArgs]}
159 _TUNED_PROFILE_NAME_: {get_param: [RoleParameters, TunedProfileName]}
160 _TUNED_CORES_: {get_param: [RoleParameters, IsolCpusList]}
163 type: OS::Heat::SoftwareConfig
164 condition: is_dpdk_config_required
173 # OvS Permission issue temporary workaround
174 # https://bugzilla.redhat.com/show_bug.cgi?id=1459436
175 # Actual solution from openvswitch - https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/333423.html
176 ovs_service_path="/usr/lib/systemd/system/ovs-vswitchd.service"
178 if grep -q 'RuntimeDirectoryMode' $ovs_service_path; then
179 sed -i 's/RuntimeDirectoryMode=.*/RuntimeDirectoryMode=0775/' $ovs_service_path
181 echo "RuntimeDirectoryMode=0775" >> $ovs_service_path
184 if ! grep -Fxq "Group=qemu" $ovs_service_path ; then
185 echo "Group=qemu" >> $ovs_service_path
188 if ! grep -Fxq "UMask=0002" $ovs_service_path ; then
189 echo "UMask=0002" >> $ovs_service_path
192 ovs_ctl_path='/usr/share/openvswitch/scripts/ovs-ctl'
193 if ! grep -q "umask 0002 \&\& start_daemon \"\$OVS_VSWITCHD_PRIORITY\"" $ovs_ctl_path ; then
194 sed -i 's/start_daemon \"\$OVS_VSWITCHD_PRIORITY\"/umask 0002 \&\& start_daemon \"$OVS_VSWITCHD_PRIORITY\"/' $ovs_ctl_path
198 # DO NOT use --detailed-exitcodes
199 puppet apply --logdest console \
200 --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules \
202 class {"vswitch::dpdk":
203 host_core_list => "$HOST_CORES",
204 pmd_core_list => "$PMD_CORES",
205 memory_channels => "$MEMORY_CHANNELS",
206 socket_mem => "$SOCKET_MEMORY",
210 $HOST_CORES: {get_attr: [RoleParametersValue, value, OvsDpdkCoreList]}
211 $PMD_CORES: {get_attr: [RoleParametersValue, value, OvsPmdCoreList]}
212 $MEMORY_CHANNELS: {get_attr: [RoleParametersValue, value, OvsDpdkMemoryChannels]}
213 $SOCKET_MEMORY: {get_attr: [RoleParametersValue, value, OvsDpdkSocketMemory]}
215 EnableDpdkDeployment:
216 type: OS::Heat::SoftwareDeployment
217 condition: is_dpdk_config_required
219 name: EnableDpdkDeployment
220 server: {get_param: server}
221 config: {get_resource: EnableDpdkConfig}
224 - deployment_actions_empty
226 - ['CREATE'] # Only do this on CREATE
229 type: OS::Heat::SoftwareConfig
230 condition: is_reboot_config_required
235 # Stop os-collect-config to avoid any race collecting another
236 # deployment before reboot happens
237 systemctl stop os-collect-config.service
241 type: OS::Heat::SoftwareDeployment
242 depends_on: HostParametersDeployment
243 condition: is_reboot_config_required
245 name: RebootDeployment
246 server: {get_param: server}
247 config: {get_resource: RebootConfig}
250 - deployment_actions_empty
252 - ['CREATE'] # Only do this on CREATE
253 signal_transport: NO_SIGNAL
257 condition: is_host_config_required
259 get_attr: [HostParametersDeployment, result]
261 condition: is_host_config_required
263 get_attr: [HostParametersDeployment, deploy_stdout]
265 condition: is_host_config_required
267 get_attr: [HostParametersDeployment, deploy_stderr]
269 condition: is_host_config_required
271 get_attr: [HostParametersDeployment, deploy_status_code]