From 1ab59855a0e9dd3876be95ddf6636f91b4526f3c Mon Sep 17 00:00:00 2001 From: Varadhan Veerapuram Date: Fri, 2 Feb 2018 10:04:05 +0530 Subject: [PATCH] Cisco ACI - Allow multiple-vmm domain support --- .../cookbooks/neutron/recipes/cisco_apic_support.rb | 2 ++ .../templates/default/ml2_conf_cisco_apic.ini.erb | 8 +++++++- chef/data_bags/crowbar/template-neutron.json | 13 +++++++++++++ chef/data_bags/crowbar/template-neutron.schema | 6 +++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/chef/cookbooks/neutron/recipes/cisco_apic_support.rb b/chef/cookbooks/neutron/recipes/cisco_apic_support.rb index 3ae366a60f..bbba1de0f6 100644 --- a/chef/cookbooks/neutron/recipes/cisco_apic_support.rb +++ b/chef/cookbooks/neutron/recipes/cisco_apic_support.rb @@ -21,6 +21,7 @@ end aciswitches = node[:neutron][:apic][:apic_switches].to_hash +acivmms = node[:neutron][:apic][:apic_vmms].to_hash template "/etc/neutron/neutron-server.conf.d/100-ml2_conf_cisco_apic.ini.conf" do cookbook "neutron" source "ml2_conf_cisco_apic.ini.erb" @@ -29,6 +30,7 @@ group node[:neutron][:platform][:group] variables( apic_switches: aciswitches, + apic_vmms: acivmms, ml2_mechanism_drivers: node[:neutron][:ml2_mechanism_drivers], policy_drivers: "implicit_policy,apic", default_ip_pool: "192.168.0.0/16", diff --git a/chef/cookbooks/neutron/templates/default/ml2_conf_cisco_apic.ini.erb b/chef/cookbooks/neutron/templates/default/ml2_conf_cisco_apic.ini.erb index 90935dda63..4cd83b9cec 100644 --- a/chef/cookbooks/neutron/templates/default/ml2_conf_cisco_apic.ini.erb +++ b/chef/cookbooks/neutron/templates/default/ml2_conf_cisco_apic.ini.erb @@ -2,7 +2,7 @@ apic_system_id=<%= node[:neutron][:apic][:system_id] %> [opflex] networks = * -[ml2_cisco_apic] +[apic] apic_hosts=<%= node[:neutron][:apic][:hosts] %> apic_username=<%= node[:neutron][:apic][:username] %> apic_password=<%= node[:neutron][:apic][:password] %> @@ -28,3 +28,9 @@ policy_drivers = <%= @policy_drivers %> [group_policy_implicit_policy] default_ip_pool = <%= @default_ip_pool %> <% end -%> +<% @apic_vmms.keys.each do |ip| -%> +[apic_vmdom:<%=ip%>] +<% @apic_vmms[ip].each do |key, value| -%> +<%= key %> = <%= value %> +<% end -%> +<% end -%> diff --git a/chef/data_bags/crowbar/template-neutron.json b/chef/data_bags/crowbar/template-neutron.json index 86c46ccc7d..cd83a0a9d2 100644 --- a/chef/data_bags/crowbar/template-neutron.json +++ b/chef/data_bags/crowbar/template-neutron.json @@ -81,6 +81,19 @@ } } } + }, + "apic_vmms": { + "soc_kvm_domain": { + "apic_vmm_type": "openstack", + "enable_optimized_dhcp": "true", + "enable_optimized_metadata": "true", + "hosts" : "" + }, + "soc_vm_domain": { + "apic_vmm_type": "vmware", + "enable_optimized_dhcp": "false", + "enable_optimized_metadata": "false" + } } }, "allow_overlapping_ips": true, diff --git a/chef/data_bags/crowbar/template-neutron.schema b/chef/data_bags/crowbar/template-neutron.schema index 2736c43cf4..e7b5ea0c52 100644 --- a/chef/data_bags/crowbar/template-neutron.schema +++ b/chef/data_bags/crowbar/template-neutron.schema @@ -73,7 +73,11 @@ }} }} }} - } + }, + "apic_vmms": { "type" : "map", "required" : true, "mapping" : { + = : { "type" : "map", "required" : true, "mapping" : { + = : { "type": "str", "required": true }} + }} }}, "allow_overlapping_ips": { "type": "bool", "required": true }, "cisco_switches": {