-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial commit for Contrail5 integration with SOC #2113
base: stable/5.0-pike
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,27 +81,38 @@ | |
nova_config = Barclamp::Config.load("openstack", "nova") | ||
nova_insecure = CrowbarOpenStackHelper.insecure(nova_config) || keystone_settings["insecure"] | ||
|
||
service_plugins = ["neutron.services.metering.metering_plugin.MeteringPlugin", | ||
"neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin"] | ||
if neutron[:neutron][:use_lbaas] | ||
service_plugins.push("neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2") | ||
if neutron[:neutron][:networking_plugin] == "ml2" && | ||
neutron[:neutron][:ml2_mechanism_drivers].include?("contrail") | ||
service_plugins = "neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [110/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) |
||
core_plugin = "neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [106/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) |
||
api_extensions_path = "/usr/lib/python2.7/site-packages/neutron_plugin_contrail/extensions:/usr/lib/python2.7/site-packages/neutron_lbaas/extensions" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [151/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) |
||
else | ||
service_plugins = ["neutron.services.metering.metering_plugin.MeteringPlugin", | ||
"neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin"] | ||
if neutron[:neutron][:use_lbaas] | ||
service_plugins.push("neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2") | ||
end | ||
core_plugin = neutron[:neutron][:networking_plugin] | ||
api_extensions_path = nil | ||
end | ||
|
||
if neutron[:neutron][:networking_plugin] == "ml2" | ||
service_plugins.unshift("neutron.services.l3_router.l3_router_plugin.L3RouterPlugin") | ||
unless neutron[:neutron][:ml2_mechanism_drivers].include?("contrail") | ||
service_plugins.unshift("neutron.services.l3_router.l3_router_plugin.L3RouterPlugin") | ||
|
||
if neutron[:neutron][:ml2_mechanism_drivers].include?("linuxbridge") || | ||
neutron[:neutron][:ml2_mechanism_drivers].include?("openvswitch") | ||
service_plugins.push("neutron.services.trunk.plugin.TrunkPlugin") | ||
end | ||
if neutron[:neutron][:ml2_mechanism_drivers].include?("linuxbridge") || | ||
neutron[:neutron][:ml2_mechanism_drivers].include?("openvswitch") | ||
service_plugins.push("neutron.services.trunk.plugin.TrunkPlugin") | ||
end | ||
|
||
if neutron[:neutron][:ml2_mechanism_drivers].include?("cisco_apic_ml2") | ||
service_plugins = ["cisco_apic_l3"] | ||
elsif neutron[:neutron][:ml2_mechanism_drivers].include?("apic_gbp") | ||
service_plugins = ["group_policy", "servicechain", "apic_gbp_l3"] | ||
if neutron[:neutron][:ml2_mechanism_drivers].include?("cisco_apic_ml2") | ||
service_plugins = ["cisco_apic_l3"] | ||
elsif neutron[:neutron][:ml2_mechanism_drivers].include?("apic_gbp") | ||
service_plugins = ["group_policy", "servicechain", "apic_gbp_l3"] | ||
end | ||
service_plugins = service_plugins.join(", ") | ||
end | ||
end | ||
service_plugins = service_plugins.join(", ") | ||
|
||
network_nodes_count = neutron[:neutron][:elements]["neutron-network"].count | ||
if neutron[:neutron][:elements_expanded] | ||
|
@@ -147,7 +158,7 @@ | |
ssl_cert_required: neutron[:neutron][:ssl][:cert_required], | ||
ssl_ca_file: neutron[:neutron][:ssl][:ca_certs], | ||
nova_insecure: nova_insecure, | ||
core_plugin: neutron[:neutron][:networking_plugin], | ||
core_plugin: core_plugin, | ||
service_plugins: service_plugins, | ||
allow_overlapping_ips: neutron[:neutron][:allow_overlapping_ips], | ||
dvr_enabled: neutron[:neutron][:use_dvr], | ||
|
@@ -158,7 +169,8 @@ | |
ipam_driver: ipam_driver, | ||
rpc_workers: neutron[:neutron][:rpc_workers], | ||
use_apic_gbp: use_apic_gbp, | ||
default_log_levels: neutron[:neutron][:default_log_levels] | ||
default_log_levels: neutron[:neutron][:default_log_levels], | ||
api_extensions_path: api_extensions_path | ||
) | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
neutron = node | ||
ml2_mech_drivers = neutron[:neutron][:ml2_mechanism_drivers] | ||
|
||
return unless ml2_mech_drivers.include?("contrail") | ||
|
||
if node.roles.include?("neutron-network") | ||
# Explicitly stop and disable dhcp and lbaas agents | ||
service node[:neutron][:platform][:dhcp_agent_name] do | ||
action [:disable, :stop] | ||
end | ||
|
||
service node[:neutron][:platform][:lbaas_agent_name] do | ||
action [:disable, :stop] | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,16 +261,19 @@ | |
end | ||
end | ||
|
||
service node[:neutron][:platform][:dhcp_agent_name] do | ||
supports status: true, restart: true | ||
action [:enable, :start] | ||
subscribes :restart, resources(template: node[:neutron][:config_file]) | ||
subscribes :restart, resources(template: node[:neutron][:dhcp_agent_config_file]) | ||
subscribes :restart, resources(file: "/etc/neutron/dhcp_agent.ini") | ||
provider Chef::Provider::CrowbarPacemakerService if use_crowbar_pacemaker_service | ||
end | ||
utils_systemd_service_restart node[:neutron][:platform][:dhcp_agent_name] do | ||
action use_crowbar_pacemaker_service ? :disable : :enable | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/EmptyLines: Extra blank line detected. (https://github.com/bbatsov/ruby-style-guide#two-or-more-empty-lines) |
||
unless node[:neutron][:ml2_mechanism_drivers].include?("contrail") | ||
service node[:neutron][:platform][:dhcp_agent_name] do | ||
supports status: true, restart: true | ||
action [:enable, :start] | ||
subscribes :restart, resources(template: node[:neutron][:config_file]) | ||
subscribes :restart, resources(template: node[:neutron][:dhcp_agent_config_file]) | ||
subscribes :restart, resources(file: "/etc/neutron/dhcp_agent.ini") | ||
provider Chef::Provider::CrowbarPacemakerService if use_crowbar_pacemaker_service | ||
end | ||
utils_systemd_service_restart node[:neutron][:platform][:dhcp_agent_name] do | ||
action use_crowbar_pacemaker_service ? :disable : :enable | ||
end | ||
end | ||
|
||
if ha_enabled | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,29 +170,46 @@ | |
"# See /etc/neutron/README.config for more details.\n" | ||
end | ||
|
||
template node[:neutron][:ml2_config_file] do | ||
source "ml2_conf.ini.erb" | ||
owner "root" | ||
group node[:neutron][:platform][:group] | ||
mode "0640" | ||
variables( | ||
ml2_mechanism_drivers: ml2_mechanism_drivers, | ||
ml2_extension_drivers: ml2_extension_drivers, | ||
ml2_type_drivers: ml2_type_drivers, | ||
tenant_network_types: tenant_network_types, | ||
vlan_start: vlan_start, | ||
vlan_end: vlan_end, | ||
gre_start: gre_start, | ||
gre_end: gre_end, | ||
vxlan_start: vni_start, | ||
vxlan_end: vni_end, | ||
vxlan_mcast_group: node[:neutron][:vxlan][:multicast_group], | ||
external_networks: physnets, | ||
mtu_value: mtu_value, | ||
l2pop_agent_boot_time: node[:neutron][:l2pop][:agent_boot_time], | ||
vmware_dvs_config: node[:neutron][:vmware_dvs] | ||
) | ||
notifies :restart, "service[#{node[:neutron][:platform][:service_name]}]" | ||
if ml2_mech_drivers.include?("contrail") | ||
template node[:neutron][:ml2_config_file] do | ||
source "ml2_conf.ini.erb" | ||
owner "root" | ||
group node[:neutron][:platform][:group] | ||
mode "0640" | ||
variables( | ||
ml2_mechanism_drivers: ml2_mechanism_drivers, | ||
api_server_ip: node[:neutron][:contrail][:api_server_ip], | ||
api_server_port: node[:neutron][:contrail][:api_server_port], | ||
analytics_server_ip: node[:neutron][:contrail][:analytics_server_ip], | ||
analytics_server_port: node[:neutron][:contrail][:analytics_server_port] | ||
) | ||
notifies :restart, "service[#{node[:neutron][:platform][:service_name]}]" | ||
end | ||
else | ||
template node[:neutron][:ml2_config_file] do | ||
source "ml2_conf.ini.erb" | ||
owner "root" | ||
group node[:neutron][:platform][:group] | ||
mode "0640" | ||
variables( | ||
ml2_mechanism_drivers: ml2_mechanism_drivers, | ||
ml2_extension_drivers: ml2_extension_drivers, | ||
ml2_type_drivers: ml2_type_drivers, | ||
tenant_network_types: tenant_network_types, | ||
vlan_start: vlan_start, | ||
vlan_end: vlan_end, | ||
gre_start: gre_start, | ||
gre_end: gre_end, | ||
vxlan_start: vni_start, | ||
vxlan_end: vni_end, | ||
vxlan_mcast_group: node[:neutron][:vxlan][:multicast_group], | ||
external_networks: physnets, | ||
mtu_value: mtu_value, | ||
l2pop_agent_boot_time: node[:neutron][:l2pop][:agent_boot_time], | ||
vmware_dvs_config: node[:neutron][:vmware_dvs] | ||
) | ||
notifies :restart, "service[#{node[:neutron][:platform][:service_name]}]" | ||
end | ||
end | ||
when "vmware" | ||
directory "/etc/neutron/plugins/vmware/" do | ||
|
@@ -372,6 +389,13 @@ | |
end | ||
end | ||
|
||
if node[:neutron][:networking_plugin] == "ml2" | ||
if node[:neutron][:ml2_mechanism_drivers].include?("contrail") | ||
include_recipe "neutron::contrail_agents" | ||
end | ||
end | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/EmptyLines: Extra blank line detected. (https://github.com/bbatsov/ruby-style-guide#two-or-more-empty-lines) |
||
crowbar_pacemaker_sync_mark "create-neutron_db_sync" if ha_enabled | ||
|
||
use_crowbar_pacemaker_service = ha_enabled && node[:pacemaker][:clone_stateless_services] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def upgrade ta, td, a, d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long. |
||
a["contrail"] = {} | ||
a["contrail"]["api_server_ip"] = ta["contrail"]["api_server_ip"] | ||
a["contrail"]["api_server_port"] = ta["contrail"]["api_server_port"] | ||
a["contrail"]["analytics_server_ip"] = ta["contrail"]["analytics_server_ip"] | ||
a["contrail"]["analytics_server_port"] = ta["contrail"]["analytics_server_port"] | ||
return a, d | ||
end | ||
|
||
def downgrade ta, td, a, d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long. |
||
a.delete("contrail") | ||
return a, d | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ def self.networking_ml2_type_drivers_valid | |
end | ||
|
||
def self.networking_ml2_mechanism_drivers_valid | ||
["linuxbridge", "openvswitch", "cisco_nexus", "vmware_dvs", "cisco_apic_ml2", "apic_gbp"] | ||
["linuxbridge", "openvswitch", "cisco_nexus", "vmware_dvs", "cisco_apic_ml2", "apic_gbp", "contrail"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [105/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) |
||
end | ||
|
||
class << self | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineOperationIndentation: Use 4 (not 2) spaces for indenting a condition in an if statement spanning multiple lines. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylemultilineoperationindentation)