Merge "Make Rabbit parameters consistent"
[apex-tripleo-heat-templates.git] / puppet / services / openvswitch.yaml
1 heat_template_version: pike
2
3 description: >
4   Open vSwitch Configuration
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   OvsDpdkCoreList:
30     description: >
31       List of cores to be used for DPDK lcore threads.  Note, these threads
32       are used by the OVS control path for validator and handling functions.
33     type: string
34     constraints:
35       - allowed_pattern: "[0-9,-]*"
36     default: ""
37   OvsDpdkMemoryChannels:
38     description: Number of memory channels per socket to be used for DPDK
39     type: string
40     constraints:
41       - allowed_pattern: "[0-9]*"
42     default: ""
43   OvsDpdkSocketMemory:
44     default: ""
45     description: >
46       Sets the amount of hugepage memory to assign per NUMA node. It is
47       recommended to use the socket closest to the PCIe slot used for the
48       desired DPDK NIC.  The format should be in "<socket 0 mem>, <socket 1
49       mem>, <socket n mem>", where the value is specified in MB.  For example:
50       "1024,0".
51     type: string
52   OvsDpdkDriverType:
53     default: "vfio-pci"
54     description: >
55       DPDK Driver type. Ensure the Overcloud NIC to be used for DPDK supports
56       this UIO/PMD driver.
57     type: string
58   OvsPmdCoreList:
59     description: >
60       A list or range of CPU cores for PMD threads to be pinned to.  Note, NIC
61       location to cores on socket, number of hyper-threaded logical cores, and
62       desired number of PMD threads can all play a role in configuring this
63       setting.  These cores should be on the same socket where
64       OvsDpdkSocketMemory is assigned.  If using hyperthreading then specify
65       both logical cores that would equal the physical core. Also, specifying
66       more than one core will trigger multiple PMD threads to be spawned which
67       may improve dataplane performance.
68     constraints:
69       - allowed_pattern: "[0-9,-]*"
70     type: string
71     default: ""
72   # DEPRECATED: the following options are deprecated and are currently maintained
73   # for backwards compatibility. They will be removed in the Queens cycle.
74   HostCpusList:
75     description: List of cores to be used for host process
76     type: string
77     constraints:
78       - allowed_pattern: "[0-9,-]*"
79     default: ''
80   NeutronDpdkCoreList:
81     description: List of cores to be used for DPDK Poll Mode Driver
82     type: string
83     constraints:
84       - allowed_pattern: "[0-9,-]*"
85     default: ''
86   NeutronDpdkMemoryChannels:
87     description: Number of memory channels to be used for DPDK
88     type: string
89     constraints:
90       - allowed_pattern: "[0-9]*"
91     default: ''
92   NeutronDpdkSocketMemory:
93     default: ''
94     description: Memory allocated for each socket
95     type: string
96   NeutronDpdkDriverType:
97     default: "vfio-pci"
98     description: DPDK Driver type
99     type: string
100
101 parameter_groups:
102 - label: deprecated
103   description: Do not use deprecated params, they will be removed.
104   parameters:
105     - HostCpusList
106     - NeutronDpdkCoreList
107     - NeutronDpdkMemoryChannels
108     - NeutronDpdkSocketMemory
109     - NeutronDpdkDriverType
110
111 conditions:
112   l_cores_empty: {equals: [{get_param: OvsDpdkCoreList}, '']}
113   pmd_cores_empty: {equals: [{get_param: OvsPmdCoreList}, '']}
114   mem_channels_empty: {equals: [{get_param: OvsDpdkMemoryChannels}, '']}
115   socket_mem_empty: {equals: [{get_param: OvsDpdkSocketMemory}, '']}
116   driver_not_set: {equals: [{get_param: OvsDpdkDriverType}, 'vfio-pci']}
117
118 outputs:
119   role_data:
120     description: Role data for the Open vSwitch service.
121     value:
122       service_name: openvswitch
123       config_settings:
124         map_replace:
125           - map_replace:
126             - vswitch::dpdk::driver_type: OvsDpdkDriverType
127               vswitch::dpdk::host_core_list: OvsDpdkCoreList
128               vswitch::dpdk::pmd_core_list: OvsPmdCoreList
129               vswitch::dpdk::memory_channels: OvsDpdkMemoryChannels
130               vswitch::dpdk::socket_mem: OvsDpdkSocketMemory
131             - values: {get_param: [RoleParameters]}
132           - values:
133               OvsDpdkCoreList: {if: [l_cores_empty, {get_param: HostCpusList}, {get_param: OvsDpdkCoreList}]}
134               OvsDpdkMemoryChannels: {if: [mem_channels_empty, {get_param: NeutronDpdkMemoryChannels}, {get_param: OvsDpdkMemoryChannels}]}
135               OvsDpdkSocketMemory: {if: [socket_mem_empty, {get_param: NeutronDpdkSocketMemory}, {get_param: OvsDpdkSocketMemory}]}
136               OvsDpdkDriverType: {if: [driver_not_set, {get_param: NeutronDpdkDriverType}, {get_param: OvsDpdkDriverType}]}
137               OvsPmdCoreList: {if: [pmd_cores_empty, {get_param: NeutronDpdkCoreList}, {get_param: OvsPmdCoreList}]}
138
139       upgrade_tasks:
140         - name: Check openvswitch version.
141           tags: step2
142           register: ovs_version
143           ignore_errors: true
144           shell: rpm -qa | awk -F- '/^openvswitch-2/{print $2 "-" $3}'
145         - name: Check openvswitch packaging.
146           tags: step2
147           shell: rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep -q "systemctl.*try-restart"
148           register: ovs_packaging_issue
149           ignore_errors: true
150         - block:
151             - name: "Ensure empty directory: emptying."
152               file:
153                 state: absent
154                 path: /root/OVS_UPGRADE
155             - name: "Ensure empty directory: creating."
156               file:
157                 state: directory
158                 path: /root/OVS_UPGRADE
159                 owner: root
160                 group: root
161                 mode: 0750
162             - name: Download OVS packages.
163               command: yumdownloader --destdir /root/OVS_UPGRADE --resolve openvswitch
164             - name: Get rpm list for manual upgrade of OVS.
165               shell: ls -1 /root/OVS_UPGRADE/*.rpm
166               register: ovs_list_of_rpms
167             - name: Manual upgrade of OVS
168               shell: |
169                 rpm -U --test {{item}} 2>&1 | grep "already installed" || \
170                 rpm -U --replacepkgs --notriggerun --nopostun {{item}};
171               args:
172                 chdir: /root/OVS_UPGRADE
173               with_items:
174                 - "{{ovs_list_of_rpms.stdout_lines}}"
175           tags: step2
176           when: "'2.5.0-14' in '{{ovs_version.stdout}}'
177                 or
178                 ovs_packaging_issue|succeeded"