Skip to content

Commit eb23fb3

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.
1 parent e18adc6 commit eb23fb3

File tree

6 files changed

+65
-9
lines changed

6 files changed

+65
-9
lines changed

chef/cookbooks/neutron/recipes/cisco_apic_agents.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
end
133133
utils_systemd_service_restart "neutron-opflex-agent"
134134

135-
service "agent-ovs" do
135+
service "opflex-agent" do
136136
action [:enable, :start]
137-
subscribes :restart, resources("template[#{opflex_agent_conf}]")
137+
subscribes :restart, resources("template[#{node[:neutron][:opflex_config_file]}]")
138138
end
139-
utils_systemd_service_restart "agent-ovs"
139+
utils_systemd_service_restart "opflex-agent"

chef/cookbooks/neutron/recipes/cisco_apic_support.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@
4141
end
4242

4343
aciswitches = node[:neutron][:apic][:apic_switches].to_hash
44+
acivmms = node[:neutron][:apic][:apic_vmms]
45+
46+
# If using VMWare vcenter as one of the compute hosts.
47+
# distributed dhcp and metadata cannot work since these
48+
# functions conflict with vcenter functionality.
49+
if acivmms.find { |vmm| vmm[:vmm_type].downcase == "vmware"}
50+
apic_optimized_dhcp = false
51+
apic_optimized_metadata = false
52+
else
53+
apic_optimized_dhcp = node[:neutron][:apic][:optimized_dhcp]
54+
apic_optimized_metadata = node[:neutron][:apic][:optimized_metadata]
55+
end
4456

4557
template node[:neutron][:ml2_cisco_apic_config_file] do
4658
cookbook "neutron"
@@ -51,6 +63,9 @@
5163
variables(
5264
vpc_pairs: node[:neutron][:apic][:vpc_pairs],
5365
apic_switches: aciswitches,
66+
optimized_dhcp: apic_optimized_dhcp,
67+
optimized_metadata: apic_optimized_metadata,
68+
apic_vmms: acivmms,
5469
ml2_mechanism_drivers: node[:neutron][:ml2_mechanism_drivers],
5570
policy_drivers: "implicit_policy,apic",
5671
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
@@ -98,7 +98,17 @@
9898
}
9999
}
100100
}
101-
}
101+
},
102+
"apic_vmms": [{
103+
"vmm_name": "soc_kvm_domain",
104+
"vmm_type": "openstack",
105+
"vlan_ranges": ""
106+
},
107+
{
108+
"vmm_name": "soc_vm_domain",
109+
"vmm_type": "vmware",
110+
"vlan_ranges": ""
111+
}]
102112
},
103113
"allow_overlapping_ips": true,
104114
"use_syslog": false,
@@ -195,7 +205,7 @@
195205
"neutron": {
196206
"crowbar-revision": 0,
197207
"crowbar-applied": false,
198-
"schema-revision": 308,
208+
"schema-revision": 309,
199209
"element_states": {
200210
"neutron-server": [ "readying", "ready", "applying" ],
201211
"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
@@ -94,7 +94,14 @@
9494
}}
9595
}}
9696
}}
97-
}
97+
},
98+
"apic_vmms": { "type" : "seq", "required" : true, "sequence" : [ {
99+
"type" : "map", "required" : true, "mapping" : {
100+
"vmm_name": { "type": "str", "required": true },
101+
"vmm_type": { "type": "str", "required": true },
102+
"vlan_ranges": { "type": "str", "required": true }
103+
}
104+
} ] }
98105
}},
99106
"allow_overlapping_ips": { "type": "bool", "required": true },
100107
"cisco_switches": {

0 commit comments

Comments
 (0)