Skip to content

Commit 5d0b3ad

Browse files
Varadhan Veerapurammmnelemane
authored andcommitted
[neutron][Cisco ACI] Multi-VMM domain support (SOC - 10471)
A Single ACI fabric can support multiple VMM domains. Each VMM domain can be governed by a different controller (Eg: VMWare vCenter or OpenStack or MicroSoft SCVMM). Several production data centers tend to use multiple VMM domains and expect to be able to monitor and control network policies from a single ACI fabric. Integration of OpenStack with such a setup requires crowbar to provide parameters specific to each VMM domain. This commit adds the additional parameters and logic to validate and send these to the correct config location. The changes now allow to provide "Vmware" or "OpenStack" as the VMM type. Multiple entries of either types are possible. (cherry picked from commit 303d986)
1 parent 914b93c commit 5d0b3ad

File tree

5 files changed

+64
-7
lines changed

5 files changed

+64
-7
lines changed

chef/cookbooks/neutron/recipes/cisco_apic_support.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@
2121
end
2222

2323
aciswitches = node[:neutron][:apic][:apic_switches].to_hash
24-
template "/etc/neutron/neutron-server.conf.d/100-ml2_conf_cisco_apic.ini.conf" do
24+
acivmms = node[:neutron][:apic][:apic_vmms]
25+
26+
# If using VMWare vcenter as one of the compute hosts.
27+
# distributed dhcp and metadata cannot work since these
28+
# functions conflict with vcenter functionality.
29+
if acivmms.find { |vmm| vmm[:vmm_type].downcase == "vmware"}
30+
apic_optimized_dhcp = false
31+
apic_optimized_metadata = false
32+
else
33+
apic_optimized_dhcp = node[:neutron][:apic][:optimized_dhcp]
34+
apic_optimized_metadata = node[:neutron][:apic][:optimized_metadata]
35+
end
36+
37+
template node[:neutron][:ml2_cisco_apic_config_file] do
2538
cookbook "neutron"
2639
source "ml2_conf_cisco_apic.ini.erb"
2740
mode "0640"
@@ -30,6 +43,9 @@
3043
variables(
3144
vpc_pairs: node[:neutron][:apic][:vpc_pairs],
3245
apic_switches: aciswitches,
46+
optimized_dhcp: apic_optimized_dhcp,
47+
optimized_metadata: apic_optimized_metadata,
48+
apic_vmms: acivmms,
3349
ml2_mechanism_drivers: node[:neutron][:ml2_mechanism_drivers],
3450
policy_drivers: "implicit_policy,apic",
3551
default_ip_pool: "192.168.0.0/16"

chef/cookbooks/neutron/templates/default/ml2_conf_cisco_apic.ini.erb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apic_system_id=<%= node[:neutron][:apic][:system_id] %>
33
[opflex]
44
networks = *
5-
[ml2_cisco_apic]
5+
[apic]
66
apic_hosts=<%= node[:neutron][:apic][:hosts] %>
77
apic_username=<%= node[:neutron][:apic][:username] %>
88
apic_password=<%= node[:neutron][:apic][:password] %>
@@ -11,8 +11,8 @@ apic_name_mapping = use_name
1111
apic_clear_node_profiles = True
1212
enable_aci_routing = True
1313
apic_arp_flooding = True
14-
enable_optimized_metadata = <%= node[:neutron][:apic][:optimized_metadata] %>
15-
enable_optimized_dhcp = <%= node[:neutron][:apic][:optimized_dhcp] %>
14+
enable_optimized_metadata = <%= @optimized_metadata %>
15+
enable_optimized_dhcp = <%= @optimized_dhcp] %>
1616
apic_provision_infra = True
1717
apic_provision_hostlinks = True
1818
<% unless @vpc_pairs.nil? -%>
@@ -41,3 +41,12 @@ enable_nat = <%= node[:neutron][:apic][:ext_net][:nat_enabled] %>
4141
<% end -%>
4242
external_epg = <%= node[:neutron][:apic][:ext_net][:ext_epg] %>
4343
host_pool_cidr = <%= node[:neutron][:apic][:ext_net][:host_pool_cidr] %>
44+
45+
<% @apic_vmms.each do |vmm_domain| -%>
46+
[apic_vmdom:<%= vmm_domain[:vmm_name]%>]
47+
vmm_type = <%= vmm_domain[:vmm_type]%>
48+
<% if vmm_domain[:vlan_ranges] -%>
49+
vlan_ranges = <%= vmm_domain[:vlan_ranges] %>
50+
<% end -%>
51+
<% end -%>
52+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def upgrade(tattr, tdep, attr, dep)
2+
unless attr["apic"].key?("apic_vmms")
3+
attr["apic"]["apic_vmms"] = tattr["apic"]["apic_vmms"]
4+
end
5+
6+
return attr, dep
7+
end
8+
9+
def downgrade(tattr, tdep, attr, dep)
10+
unless tattr["apic"].key?("apic_vmms")
11+
attr["apic"].delete("apic_vmms") if attr.key?("apic_vmms")
12+
end
13+
14+
return attr, dep
15+
end

chef/data_bags/crowbar/template-neutron.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@
9999
}
100100
}
101101
}
102-
}
102+
},
103+
"apic_vmms": [{
104+
"vmm_name": "soc_kvm_domain",
105+
"vmm_type": "openstack",
106+
"vlan_ranges": ""
107+
},
108+
{
109+
"vmm_name": "soc_vm_domain",
110+
"vmm_type": "vmware",
111+
"vlan_ranges": ""
112+
}]
103113
},
104114
"allow_overlapping_ips": true,
105115
"use_syslog": false,
@@ -197,7 +207,7 @@
197207
"neutron": {
198208
"crowbar-revision": 0,
199209
"crowbar-applied": false,
200-
"schema-revision": 125,
210+
"schema-revision": 126,
201211
"element_states": {
202212
"neutron-server": [ "readying", "ready", "applying" ],
203213
"neutron-network": [ "readying", "ready", "applying" ],

chef/data_bags/crowbar/template-neutron.schema

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@
9595
}}
9696
}}
9797
}}
98-
}
98+
},
99+
"apic_vmms": { "type" : "seq", "required" : true, "sequence" : [ {
100+
"type" : "map", "required" : true, "mapping" : {
101+
"vmm_name": { "type": "str", "required": true },
102+
"vmm_type": { "type": "str", "required": true },
103+
"vlan_ranges": { "type": "str", "required": true }
104+
}
105+
} ] }
99106
}},
100107
"allow_overlapping_ips": { "type": "bool", "required": true },
101108
"cisco_switches": {

0 commit comments

Comments
 (0)