diff options
Diffstat (limited to 'build/opendaylight.patch')
-rw-r--r-- | build/opendaylight.patch | 446 |
1 files changed, 446 insertions, 0 deletions
diff --git a/build/opendaylight.patch b/build/opendaylight.patch new file mode 100644 index 00000000..5376665c --- /dev/null +++ b/build/opendaylight.patch @@ -0,0 +1,446 @@ +From bdaa77b2b92f470fe0bc6b18bff5f2af1f7b65cf Mon Sep 17 00:00:00 2001 +From: Tim Rozet <tdrozet@gmail.com> +Date: Tue, 23 Jun 2015 17:46:00 -0400 +Subject: [PATCH] Adds OpenDaylight support + +To enable set neturon Mechanism Drivers to opendaylight via ExtraConfig: + - EnableOpenDaylight (used to enable ODL, defaults to false) + - OpenDaylightPort (used to define ODL REST Port, default 8081) + +Change-Id: I2a4c5b69ee0ad70d2372cad23b9af0890715c85f +Signed-off-by: Dan Radez <dradez@redhat.com> +--- + environments/opendaylight.yaml | 4 + + puppet/compute.yaml | 6 + + puppet/controller.yaml | 8 + + puppet/manifests/overcloud_compute.pp | 31 +++- + puppet/manifests/overcloud_controller.pp | 49 +++++- + puppet/manifests/overcloud_controller_pacemaker.pp | 183 +++++++++++++-------- + 6 files changed, 201 insertions(+), 80 deletions(-) + create mode 100644 environments/opendaylight.yaml + +diff --git a/environments/opendaylight.yaml b/environments/opendaylight.yaml +new file mode 100644 +index 0000000..39e4aa3 +--- /dev/null ++++ b/environments/opendaylight.yaml +@@ -0,0 +1,4 @@ ++parameters: ++ ExtraConfig: ++ neutron_mechanism_drivers: ['opendaylight'] ++ neutron_tenant_network_type: vxlan +diff --git a/puppet/compute.yaml b/puppet/compute.yaml +index 2b63535..3f20d48 100644 +--- a/puppet/compute.yaml ++++ b/puppet/compute.yaml +@@ -221,6 +221,10 @@ parameters: + NtpServer: + type: string + default: '' ++ OpenDaylightPort: ++ default: 8081 ++ description: Set opendaylight service port ++ type: number + RabbitHost: + type: string + default: '' # Has to be here because of the ignored empty value bug +@@ -409,6 +413,7 @@ resources: + neutron::rabbit_user: {get_input: rabbit_user} + neutron::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} + neutron::rabbit_port: {get_input: rabbit_client_port} ++ opendaylight_port: {get_input: opendaylight_port} + neutron_flat_networks: {get_input: neutron_flat_networks} + neutron_host: {get_input: neutron_host} + neutron::agents::ml2::ovs::local_ip: {get_input: neutron_local_ip} +@@ -474,6 +479,7 @@ resources: + - {get_param: GlanceHost} + - ':' + - {get_param: GlancePort} ++ opendaylight_port: {get_param: OpenDaylightPort} + neutron_flat_networks: {get_param: NeutronFlatNetworks} + neutron_host: {get_param: NeutronHost} + neutron_local_ip: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NeutronTenantNetwork]}]} +diff --git a/puppet/controller.yaml b/puppet/controller.yaml +index 0bb8035..fa0dc3e 100644 +--- a/puppet/controller.yaml ++++ b/puppet/controller.yaml +@@ -427,6 +427,10 @@ parameters: + NtpServer: + type: string + default: '' ++ OpenDaylightPort: ++ default: 8081 ++ description: Set opendaylight service port ++ type: number + PcsdPassword: + type: string + description: The password for the 'pcsd' user. +@@ -794,6 +798,7 @@ resources: + template: tripleo-CLUSTER + params: + CLUSTER: {get_param: MysqlClusterUniquePart} ++ opendaylight_port: {get_param: OpenDaylightPort} + neutron_flat_networks: {get_param: NeutronFlatNetworks} + neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret} + neutron_agent_mode: {get_param: NeutronAgentMode} +@@ -1136,6 +1141,9 @@ resources: + mysql_bind_host: {get_input: mysql_network} + mysql_virtual_ip: {get_input: mysql_virtual_ip} + ++ # OpenDaylight ++ opendaylight_port: {get_input: opendaylight_port} ++ + # Neutron + neutron::bind_host: {get_input: neutron_api_network} + neutron::rabbit_password: {get_input: rabbit_password} +diff --git a/puppet/manifests/overcloud_compute.pp b/puppet/manifests/overcloud_compute.pp +index 2150bab..9846636 100644 +--- a/puppet/manifests/overcloud_compute.pp ++++ b/puppet/manifests/overcloud_compute.pp +@@ -21,6 +21,8 @@ if count(hiera('ntp::servers')) > 0 { + include ::ntp + } + ++$controller_node_ips = split(hiera('controller_node_ips'), ',') ++ + file { ['/etc/libvirt/qemu/networks/autostart/default.xml', + '/etc/libvirt/qemu/networks/default.xml']: + ensure => absent, +@@ -74,9 +76,32 @@ class { 'neutron::plugins::ml2': + tenant_network_types => [hiera('neutron_tenant_network_type')], + } + +-class { 'neutron::agents::ml2::ovs': +- bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), +- tunnel_types => split(hiera('neutron_tunnel_types'), ','), ++if 'opendaylight' in hiera('neutron_mechanism_drivers') { ++ $opendaylight_port = hiera('opendaylight_port') ++ $private_ip = hiera('neutron::agents::ml2::ovs::local_ip') ++ ++ exec { 'Wait for NetVirt OVS to come up': ++ command => "/bin/curl -o /dev/null --fail --silent --head -u admin:admin \ ++ http://${controller_node_ips[0]}:${opendaylight_port}/restconf/operational/network-topology:network-topology", ++ tries => 20, ++ try_sleep => 60, ++ } -> ++ # OVS manager ++ exec { 'Set OVS Manager to OpenDaylight': ++ command => "/usr/bin/ovs-vsctl set-manager tcp:${controller_node_ips[0]}:6640", ++ unless => "/usr/bin/ovs-vsctl show | /usr/bin/grep 'Manager \"tcp:${controller_node_ips[0]}:6640\"'", ++ } -> ++ # local ip ++ exec { 'Set local_ip Other Option': ++ command => "/usr/bin/ovs-vsctl set Open_vSwitch $(ovs-vsctl get Open_vSwitch . _uuid) other_config:local_ip=$private_ip", ++ unless => "/usr/bin/ovs-vsctl list Open_vSwitch | /usr/bin/grep 'local_ip=\"$private_ip\"'", ++ } ++ ++} else { ++ class { 'neutron::agents::ml2::ovs': ++ bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), ++ tunnel_types => split(hiera('neutron_tunnel_types'), ','), ++ } + } + + if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') { +diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp +index c330236..68739a6 100644 +--- a/puppet/manifests/overcloud_controller.pp ++++ b/puppet/manifests/overcloud_controller.pp +@@ -30,6 +30,13 @@ if hiera('step') >= 1 { + + if hiera('step') >= 2 { + ++ if 'opendaylight' in hiera('neutron_mechanism_drivers') { ++ class {"opendaylight": ++ extra_features => ['odl-ovsdb-openstack', 'odl-dlux-core', 'odl-sfc-core', 'odl-sfc-ui', 'odl-sfc-sb-rest', 'odl-sfc-ovs', 'odl-sfc-netconf', 'odl-sfclisp', 'odl-sfcofl2'], ++ odl_rest_port => hiera('opendaylight_port'), ++ } ++ } ++ + if count(hiera('ntp::servers')) > 0 { + include ::ntp + } +@@ -242,10 +249,45 @@ if hiera('step') >= 3 { + tenant_network_types => [hiera('neutron_tenant_network_type')], + mechanism_drivers => [hiera('neutron_mechanism_drivers')], + } +- class { 'neutron::agents::ml2::ovs': +- bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), +- tunnel_types => split(hiera('neutron_tunnel_types'), ','), ++ ++ if 'opendaylight' in hiera('neutron_mechanism_drivers') { ++ ++ $opendaylight_port = hiera('opendaylight_port') ++ $private_ip = hiera('neutron::agents::ml2::ovs::local_ip') ++ ++ neutron_plugin_ml2 { ++ 'ml2_odl/username': value => 'admin'; ++ 'ml2_odl/password': value => 'admin'; ++ 'ml2_odl/url': value => "http://${controller_node_ips[0]}:${opendaylight_port}/controller/nb/v2/neutron"; ++ } ++ ++ exec { 'Wait for NetVirt OVSDB to come up': ++ command => "/bin/curl -o /dev/null --fail --silent --head -u admin:admin \ ++ http://${controller_node_ips[0]}:${opendaylight_port}/restconf/operational/network-topology:network-topology", ++ tries => 20, ++ try_sleep => 60, ++ } -> ++ # OVS manager ++ exec { 'Set OVS Manager to OpenDaylight': ++ command => "/usr/bin/ovs-vsctl set-manager tcp:${controller_node_ips[0]}:6640", ++ unless => "/usr/bin/ovs-vsctl show | /usr/bin/grep 'Manager \"tcp:${controller_node_ips[0]}:6640\"'", ++ } -> ++ # local ip ++ exec { 'Set local_ip Other Option': ++ command => "/usr/bin/ovs-vsctl set Open_vSwitch $(ovs-vsctl get Open_vSwitch . _uuid) other_config:local_ip=$private_ip", ++ unless => "/usr/bin/ovs-vsctl list Open_vSwitch | /usr/bin/grep 'local_ip=\"$private_ip\"'", ++ } ++ ++ } else { ++ ++ class { 'neutron::agents::ml2::ovs': ++ bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), ++ tunnel_types => split(hiera('neutron_tunnel_types'), ','), ++ } ++ ++ Service['neutron-server'] -> Service['neutron-ovs-agent-service'] + } ++ + if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') { + include neutron::plugins::ml2::cisco::nexus1000v + +@@ -281,7 +323,6 @@ if hiera('step') >= 3 { + + Service['neutron-server'] -> Service['neutron-dhcp-service'] + Service['neutron-server'] -> Service['neutron-l3'] +- Service['neutron-server'] -> Service['neutron-ovs-agent-service'] + Service['neutron-server'] -> Service['neutron-metadata'] + + include ::cinder +diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp +index b8fa89f..9911285 100644 +--- a/puppet/manifests/overcloud_controller_pacemaker.pp ++++ b/puppet/manifests/overcloud_controller_pacemaker.pp +@@ -380,6 +380,13 @@ if hiera('step') >= 2 { + + } + ++ if 'opendaylight' in hiera('neutron_mechanism_drivers') { ++ class {"opendaylight": ++ extra_features => ['odl-ovsdb-openstack', 'odl-dlux-core', 'odl-sfc-core', 'odl-sfc-ui', 'odl-sfc-sb-rest', 'odl-sfc-ovs', 'odl-sfc-netconf', 'odl-sfclisp', 'odl-sfcofl2'], ++ odl_rest_port => hiera('opendaylight_port'), ++ } ++ } ++ + exec { 'galera-ready' : + command => '/usr/bin/clustercheck >/dev/null', + timeout => 30, +@@ -604,13 +611,42 @@ if hiera('step') >= 3 { + tenant_network_types => [hiera('neutron_tenant_network_type')], + mechanism_drivers => [hiera('neutron_mechanism_drivers')], + } +- class { 'neutron::agents::ml2::ovs': +- manage_service => false, +- enabled => false, +- bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), +- tunnel_types => split(hiera('neutron_tunnel_types'), ','), +- } ++ if 'opendaylight' in hiera('neutron_mechanism_drivers') { ++ ++ $opendaylight_port = hiera('opendaylight_port') ++ $private_ip = hiera('neutron::agents::ml2::ovs::local_ip') ++ ++ neutron_plugin_ml2 { ++ 'ml2_odl/username': value => 'admin'; ++ 'ml2_odl/password': value => 'admin'; ++ 'ml2_odl/url': value => "http://${controller_node_ips[0]}:${opendaylight_port}/controller/nb/v2/neutron"; ++ } + ++ exec { 'Wait for NetVirt OVSDB to come up': ++ command => "/bin/curl -o /dev/null --fail --silent --head -u admin:admin \ ++ http://${controller_node_ips[0]}:${opendaylight_port}/restconf/operational/network-topology:network-topology", ++ tries => 20, ++ try_sleep => 60, ++ } -> ++ # OVS manager ++ exec { 'Set OVS Manager to OpenDaylight': ++ command => "/usr/bin/ovs-vsctl set-manager tcp:${controller_node_ips[0]}:6640", ++ unless => "/usr/bin/ovs-vsctl show | /usr/bin/grep 'Manager \"tcp:${controller_node_ips[0]}:6640\"'", ++ } -> ++ # local ip ++ exec { 'Set local_ip Other Option': ++ command => "/usr/bin/ovs-vsctl set Open_vSwitch $(ovs-vsctl get Open_vSwitch . _uuid) other_config:local_ip=$private_ip", ++ unless => "/usr/bin/ovs-vsctl list Open_vSwitch | /usr/bin/grep 'local_ip=\"$private_ip\"'", ++ } ++ ++ } else { ++ class { 'neutron::agents::ml2::ovs': ++ manage_service => false, ++ enabled => false, ++ bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), ++ tunnel_types => split(hiera('neutron_tunnel_types'), ','), ++ } ++ } + if 'cisco_ucsm' in hiera('neutron_mechanism_drivers') { + include ::neutron::plugins::ml2::cisco::ucsm + } +@@ -1059,56 +1095,13 @@ if hiera('step') >= 4 { + pacemaker::resource::service { $::neutron::params::dhcp_agent_service: + clone_params => "interleave=true", + } +- pacemaker::resource::service { $::neutron::params::ovs_agent_service: +- clone_params => "interleave=true", +- } + pacemaker::resource::service { $::neutron::params::metadata_agent_service: + clone_params => "interleave=true", + } +- pacemaker::resource::ocf { $::neutron::params::ovs_cleanup_service: +- ocf_agent_name => "neutron:OVSCleanup", +- clone_params => "interleave=true", +- } + pacemaker::resource::ocf { 'neutron-netns-cleanup': + ocf_agent_name => "neutron:NetnsCleanup", + clone_params => "interleave=true", + } +- +- # neutron - one chain ovs-cleanup-->netns-cleanup-->ovs-agent +- pacemaker::constraint::base { 'neutron-ovs-cleanup-to-netns-cleanup-constraint': +- constraint_type => "order", +- first_resource => "${::neutron::params::ovs_cleanup_service}-clone", +- second_resource => "neutron-netns-cleanup-clone", +- first_action => "start", +- second_action => "start", +- require => [Pacemaker::Resource::Ocf["${::neutron::params::ovs_cleanup_service}"], +- Pacemaker::Resource::Ocf['neutron-netns-cleanup']], +- } +- pacemaker::constraint::colocation { 'neutron-ovs-cleanup-to-netns-cleanup-colocation': +- source => "neutron-netns-cleanup-clone", +- target => "${::neutron::params::ovs_cleanup_service}-clone", +- score => "INFINITY", +- require => [Pacemaker::Resource::Ocf["${::neutron::params::ovs_cleanup_service}"], +- Pacemaker::Resource::Ocf['neutron-netns-cleanup']], +- } +- pacemaker::constraint::base { 'neutron-netns-cleanup-to-openvswitch-agent-constraint': +- constraint_type => "order", +- first_resource => "neutron-netns-cleanup-clone", +- second_resource => "${::neutron::params::ovs_agent_service}-clone", +- first_action => "start", +- second_action => "start", +- require => [Pacemaker::Resource::Ocf["neutron-netns-cleanup"], +- Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"]], +- } +- pacemaker::constraint::colocation { 'neutron-netns-cleanup-to-openvswitch-agent-colocation': +- source => "${::neutron::params::ovs_agent_service}-clone", +- target => "neutron-netns-cleanup-clone", +- score => "INFINITY", +- require => [Pacemaker::Resource::Ocf["neutron-netns-cleanup"], +- Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"]], +- } +- +- #another chain keystone-->neutron-server-->ovs-agent-->dhcp-->l3 + pacemaker::constraint::base { 'keystone-to-neutron-server-constraint': + constraint_type => "order", + first_resource => "${::keystone::params::service_name}-clone", +@@ -1118,31 +1111,75 @@ if hiera('step') >= 4 { + require => [Pacemaker::Resource::Service[$::keystone::params::service_name], + Pacemaker::Resource::Service[$::neutron::params::server_service]], + } +- pacemaker::constraint::base { 'neutron-server-to-openvswitch-agent-constraint': +- constraint_type => "order", +- first_resource => "${::neutron::params::server_service}-clone", +- second_resource => "${::neutron::params::ovs_agent_service}-clone", +- first_action => "start", +- second_action => "start", +- require => [Pacemaker::Resource::Service[$::neutron::params::server_service], +- Pacemaker::Resource::Service[$::neutron::params::ovs_agent_service]], +- } +- pacemaker::constraint::base { 'neutron-openvswitch-agent-to-dhcp-agent-constraint': +- constraint_type => "order", +- first_resource => "${::neutron::params::ovs_agent_service}-clone", +- second_resource => "${::neutron::params::dhcp_agent_service}-clone", +- first_action => "start", +- second_action => "start", +- require => [Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"], +- Pacemaker::Resource::Service["${::neutron::params::dhcp_agent_service}"]], ++ if 'openvswitch' in hiera('neutron_mechanism_drivers') { ++ pacemaker::resource::service { $::neutron::params::ovs_agent_service: ++ clone_params => "interleave=true", ++ } ++ pacemaker::resource::ocf { $::neutron::params::ovs_cleanup_service: ++ ocf_agent_name => "neutron:OVSCleanup", ++ clone_params => "interleave=true", ++ } ++ # neutron - one chain ovs-cleanup-->netns-cleanup-->ovs-agent ++ pacemaker::constraint::base { 'neutron-ovs-cleanup-to-netns-cleanup-constraint': ++ constraint_type => "order", ++ first_resource => "${::neutron::params::ovs_cleanup_service}-clone", ++ second_resource => "neutron-netns-cleanup-clone", ++ first_action => "start", ++ second_action => "start", ++ require => [Pacemaker::Resource::Ocf["${::neutron::params::ovs_cleanup_service}"], ++ Pacemaker::Resource::Ocf['neutron-netns-cleanup']], ++ } ++ pacemaker::constraint::colocation { 'neutron-ovs-cleanup-to-netns-cleanup-colocation': ++ source => "neutron-netns-cleanup-clone", ++ target => "${::neutron::params::ovs_cleanup_service}-clone", ++ score => "INFINITY", ++ require => [Pacemaker::Resource::Ocf["${::neutron::params::ovs_cleanup_service}"], ++ Pacemaker::Resource::Ocf['neutron-netns-cleanup']], ++ } ++ pacemaker::constraint::base { 'neutron-netns-cleanup-to-openvswitch-agent-constraint': ++ constraint_type => "order", ++ first_resource => "neutron-netns-cleanup-clone", ++ second_resource => "${::neutron::params::ovs_agent_service}-clone", ++ first_action => "start", ++ second_action => "start", ++ require => [Pacemaker::Resource::Ocf["neutron-netns-cleanup"], ++ Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"]], ++ } ++ pacemaker::constraint::colocation { 'neutron-netns-cleanup-to-openvswitch-agent-colocation': ++ source => "${::neutron::params::ovs_agent_service}-clone", ++ target => "neutron-netns-cleanup-clone", ++ score => "INFINITY", ++ require => [Pacemaker::Resource::Ocf["neutron-netns-cleanup"], ++ Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"]], ++ } + +- } +- pacemaker::constraint::colocation { 'neutron-openvswitch-agent-to-dhcp-agent-colocation': +- source => "${::neutron::params::dhcp_agent_service}-clone", +- target => "${::neutron::params::ovs_agent_service}-clone", +- score => "INFINITY", +- require => [Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"], +- Pacemaker::Resource::Service["${::neutron::params::dhcp_agent_service}"]], ++ #another chain keystone-->neutron-server-->ovs-agent-->dhcp-->l3 ++ pacemaker::constraint::base { 'neutron-server-to-openvswitch-agent-constraint': ++ constraint_type => "order", ++ first_resource => "${::neutron::params::server_service}-clone", ++ second_resource => "${::neutron::params::ovs_agent_service}-clone", ++ first_action => "start", ++ second_action => "start", ++ require => [Pacemaker::Resource::Service[$::neutron::params::server_service], ++ Pacemaker::Resource::Service[$::neutron::params::ovs_agent_service]], ++ } ++ pacemaker::constraint::base { 'neutron-openvswitch-agent-to-dhcp-agent-constraint': ++ constraint_type => "order", ++ first_resource => "${::neutron::params::ovs_agent_service}-clone", ++ second_resource => "${::neutron::params::dhcp_agent_service}-clone", ++ first_action => "start", ++ second_action => "start", ++ require => [Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"], ++ Pacemaker::Resource::Service["${::neutron::params::dhcp_agent_service}"]], ++ ++ } ++ pacemaker::constraint::colocation { 'neutron-openvswitch-agent-to-dhcp-agent-colocation': ++ source => "${::neutron::params::dhcp_agent_service}-clone", ++ target => "${::neutron::params::ovs_agent_service}-clone", ++ score => "INFINITY", ++ require => [Pacemaker::Resource::Service["${::neutron::params::ovs_agent_service}"], ++ Pacemaker::Resource::Service["${::neutron::params::dhcp_agent_service}"]], ++ } + } + pacemaker::constraint::base { 'neutron-dhcp-agent-to-l3-agent-constraint': + constraint_type => "order", +-- +2.5.0 + |