Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / opendaylight-ovs.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenDaylight OVS Configuration.
5
6 parameters:
7   OpenDaylightPort:
8     default: 8081
9     description: Set opendaylight service port
10     type: number
11   OpenDaylightUsername:
12     default: 'admin'
13     description: The username for the opendaylight server.
14     type: string
15   OpenDaylightPassword:
16     default: 'admin'
17     type: string
18     description: The password for the opendaylight server.
19     hidden: true
20   OpenDaylightConnectionProtocol:
21     description: L7 protocol used for REST access
22     type: string
23     default: 'http'
24   OpenDaylightCheckURL:
25     description: URL postfix to verify ODL has finished starting up
26     type: string
27     default: 'restconf/operational/network-topology:network-topology/topology/netvirt:1'
28   OpenDaylightApiVirtualIP:
29     type: string
30     default: ''
31   OpenDaylightProviderMappings:
32     description: Mappings between logical networks and physical interfaces.
33                  Required for VLAN deployments.  For example physnet1 -> eth1.
34     type: comma_delimited_list
35     default: "datacentre:br-ex"
36   HostAllowedNetworkTypes:
37     description: Allowed tenant network types for this OVS host.  Note this can
38                  vary per host or role to constrain which hosts nova instances
39                  and networks are scheduled to.
40     type: comma_delimited_list
41     default: ['local', 'vlan', 'vxlan', 'gre']
42   OvsEnableDpdk:
43     description: Whether or not to configure enable DPDK in OVS
44     default:  false
45     type: boolean
46   OvsVhostuserMode:
47     description: Specify the mode for OVS with vhostuser port creation.  In
48                  client mode, the hypervisor will be responsible for creating
49                  vhostuser sockets.  In server mode, OVS will create them.
50     type: string
51     default: "client"
52     constraints:
53       - allowed_values: [ 'client', 'server' ]
54   VhostuserSocketDir:
55     description: Specify the directory to use for vhostuser sockets
56     type: string
57     default: "/var/run/openvswitch"
58   EndpointMap:
59     default: {}
60     description: Mapping of service endpoint -> protocol. Typically set
61                  via parameter_defaults in the resource registry.
62     type: json
63   ServiceData:
64     default: {}
65     description: Dictionary packing service data
66     type: json
67   ServiceNetMap:
68     default: {}
69     description: Mapping of service_name -> network name. Typically set
70                  via parameter_defaults in the resource registry.  This
71                  mapping overrides those in ServiceNetMapDefaults.
72     type: json
73   DefaultPasswords:
74     default: {}
75     type: json
76   RoleName:
77     default: ''
78     description: Role name on which the service is applied
79     type: string
80   RoleParameters:
81     default: {}
82     description: Parameters specific to the role
83     type: json
84
85 resources:
86   Ovs:
87     type: ./openvswitch.yaml
88     properties:
89       ServiceData: {get_param: ServiceData}
90       ServiceNetMap: {get_param: ServiceNetMap}
91       DefaultPasswords: {get_param: DefaultPasswords}
92       EndpointMap: {get_param: EndpointMap}
93       RoleName: {get_param: RoleName}
94       RoleParameters: {get_param: RoleParameters}
95
96   # Merging role-specific parameters (RoleParameters) with the default parameters.
97   # RoleParameters will have the precedence over the default parameters.
98   RoleParametersValue:
99     type: OS::Heat::Value
100     properties:
101       type: json
102       value:
103         map_replace:
104           - map_replace:
105             - neutron::plugins::ovs::opendaylight::allowed_network_types: HostAllowedNetworkTypes
106               neutron::plugins::ovs::opendaylight::enable_dpdk: OvsEnableDpdk
107               neutron::plugins::ovs::opendaylight::vhostuser_socket_dir: VhostuserSocketDir
108               neutron::plugins::ovs::opendaylight::vhostuser_mode: OvsVhostuserMode
109               neutron::plugins::ovs::opendaylight::provider_mappings: OpenDaylightProviderMappings
110             - values: {get_param: [RoleParameters]}
111           - values:
112               HostAllowedNetworkTypes: {get_param: HostAllowedNetworkTypes}
113               OvsEnableDpdk: {get_param: OvsEnableDpdk}
114               VhostuserSocketDir: {get_param: VhostuserSocketDir}
115               OvsVhostuserMode: {get_param: OvsVhostuserMode}
116               OpenDaylightProviderMappings: {get_param: OpenDaylightProviderMappings}
117
118 outputs:
119   role_data:
120     description: Role data for the OpenDaylight service.
121     value:
122       service_name: opendaylight_ovs
123       config_settings:
124         map_merge:
125           - opendaylight::odl_rest_port: {get_param: OpenDaylightPort}
126             opendaylight::username: {get_param: OpenDaylightUsername}
127             opendaylight::password: {get_param: OpenDaylightPassword}
128             neutron::plugins::ovs::opendaylight::odl_username: {get_param: OpenDaylightUsername}
129             neutron::plugins::ovs::opendaylight::odl_password: {get_param: OpenDaylightPassword}
130             opendaylight_check_url: {get_param: OpenDaylightCheckURL}
131             opendaylight::nb_connection_protocol: {get_param: OpenDaylightConnectionProtocol}
132             neutron::agents::ml2::ovs::local_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]}
133             tripleo.opendaylight_ovs.firewall_rules:
134               '118 neutron vxlan networks':
135                proto: 'udp'
136                dport: 4789
137               '136 neutron gre networks':
138                proto: 'gre'
139           - get_attr: [Ovs, role_data, config_settings]
140           - get_attr: [RoleParametersValue, value]
141       step_config: |
142         include tripleo::profile::base::neutron::plugins::ovs::opendaylight
143       upgrade_tasks:
144         list_concat:
145           - get_attr: [Ovs, role_data, upgrade_tasks]
146           -
147             - name: Check if openvswitch is deployed
148               command: systemctl is-enabled openvswitch
149               tags: common
150               ignore_errors: True
151               register: openvswitch_enabled
152             - name: "PreUpgrade step0,validation: Check service openvswitch is running"
153               shell: /usr/bin/systemctl show 'openvswitch' --property ActiveState | grep '\bactive\b'
154               when: openvswitch_enabled.rc == 0
155               tags: step0,validation
156             - name: Stop openvswitch service
157               tags: step1
158               when: openvswitch_enabled.rc == 0
159               service: name=openvswitch state=stopped