44ebb86b1319cb333f32299d8a95022de7fdc226
[fuel.git] / mcp / reclass / classes / cluster / mcp-odl-noha / openstack / compute.yml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- import 'net_map.j2' as nm with context %}
9 {%- import 'net_macros.j2' as ma with context %}
10 {%- set vlan_private_start = (nm.vlan_private | string).rsplit('-')[0] %}
11 ---
12 classes:
13   - service.neutron.compute.single
14   - service.neutron.compute.opendaylight.single
15 {%- if '-ovs-' in conf.MCP_DEPLOY_SCENARIO %}
16   - system.nova.compute.nfv.hugepages
17   - system.neutron.compute.nfv.dpdk
18 {%- endif %}
19   - cluster.mcp-common-noha.openstack_compute
20   - cluster.mcp-odl-noha
21 parameters:
22   nova:
23     compute:
24       vif_plugging_is_fatal: false
25       vif_plugging_timeout: 60
26   neutron:
27     compute:
28       opendaylight:
29         ovsdb_server_iface: ptcp:6640:127.0.0.1
30   linux:
31     network:
32       ovs_nowait: false
33       interface:
34 {%- if '-ovs-' in conf.MCP_DEPLOY_SCENARIO %}
35         dpdk0:
36           name: ${_param:dpdk0_name}
37           pci: ${_param:dpdk0_pci}
38           driver: ${_param:dpdk0_driver}
39           enabled: true
40           bridge: br-prv
41           type: dpdk_ovs_port
42           n_rxq: ${_param:dpdk0_n_rxq}
43           mtu: ${_param:interface_mtu}
44         br-prv:
45           enabled: true
46           type: dpdk_ovs_bridge
47           proto: static
48           address: ${_param:tenant_address}
49           netmask: ${_param:opnfv_net_private_mask}
50         {{ nm.cmp001.nic_private }}:
51           type: dpdk  # Not a meaningful type, just match 'dpdk' for filtering
52
53 {%- set nics = { nm.cmp001.nic_public: True } %}
54 {%- set vlans = { nm.vlan_public: nm.cmp001.nic_public } %}
55
56 {{ ma.linux_network_interfaces_nic(nics) }}
57
58 {{ ma.linux_network_interfaces_vlan(vlans) }}
59
60         br-floating:
61           enabled: true
62           type: ovs_bridge
63           datapath_type: netdev
64           use_interfaces:
65             - float-to-ex
66         float-to-ex:
67           enabled: true
68           type: ovs_port
69           mtu: ${_param:interface_mtu}
70           bridge: br-floating
71           ovs_bridge: br-floating
72           noifupdown: true
73         br-ex:
74           enabled: true
75           type: bridge
76           address: ${_param:external_address}
77           netmask: ${_param:opnfv_net_public_mask}
78           use_interfaces:
79             - {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }}
80           use_ovs_ports:
81             - float-to-ex
82           gateway: ${_param:opnfv_net_public_gw}
83           name_servers: {{ nm.dns_public }}
84           noifupdown: true
85 {%- else %}
86         br-mesh:
87           enabled: true
88           type: bridge
89           proto: static
90           address: ${_param:tenant_address}
91           netmask: ${_param:opnfv_net_private_mask}
92           use_interfaces:
93             - {{ ma.interface_str(nm.cmp001.nic_private, vlan_private_start) }}
94         {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }}:
95           enabled: true
96           mtu: ${_param:interface_mtu}
97           proto: manual
98           ovs_port_type: OVSPort
99           type: ovs_port
100           ovs_bridge: br-floating
101           bridge: br-floating
102         br-floating:
103           enabled: true
104           type: ovs_bridge
105           proto: static
106           address: ${_param:external_address}
107           netmask: ${_param:opnfv_net_public_mask}
108           use_interfaces:
109             - {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }}
110           gateway: ${_param:opnfv_net_public_gw}
111           name_servers: {{ nm.dns_public }}
112           noifupdown: true
113 {%- endif %}
114     system:
115       file:
116         /var/tmp/odl_hostconfig.patch:
117           contents: |
118             420c420
119             <                 if datapath_types.find(datapath_type) >= 0)
120             ---
121             >                 if datapath_type in datapath_types)
122             460c460
123             <         return subprocess.check_output(command_line).strip()  # nosec
124             ---
125             >         return subprocess.check_output(command_line).strip().decode()  # nosec