N1KV support to Virtual Networking

Plugin Side: cloud::network
===========
- Add a flexibility to modify default ML2 plugin.
- Add non-ML2 Cisco plugin support.

Note: The configuration is for Cisco Nexus with
neutron.plugins.cisco.network_plugin.PluginV2 core plugin &
neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2
vswitch plugin.

Agent Side: cloud::network::vswitch
==========
- Bring n1kv_vem driver support to vSwitch configuration in Neutron
Compute & Network agent.
It use the n1kv_vem agent from puppet-neutron using default parameters
that could be replaced by custom datas.
- ensure nexus1000v package is installed
- Also add an unit test with a new context when running n1kv_vem agent.

Also update the README.
This commit is contained in:
Emilien Macchi
2014-09-23 10:07:58 -04:00
parent 7eb73d913c
commit 17ac1b5613
4 changed files with 117 additions and 56 deletions

View File

@@ -40,6 +40,10 @@ Cinder has multi-backend support:
* NetAPP * NetAPP
* iSCSI * iSCSI
* EMC VNX direct * EMC VNX direct
* NFS
Neutron supports:
* ML2 plugin with OVS agent (GRE + VXLAN supported)
* Cisco plugin with N1KV agent (non-ML2)
Trove support is now experimental. Trove support is now experimental.
[Puppet Modules](http://docs.puppetlabs.com/learning/modules1.html#modules) are a collection of related contents that can be used to model the configuration of a discrete service. [Puppet Modules](http://docs.puppetlabs.com/learning/modules1.html#modules) are a collection of related contents that can be used to model the configuration of a discrete service.

View File

@@ -86,32 +86,43 @@
# Defaults to ['gre', 'vlan', 'flat'] # Defaults to ['gre', 'vlan', 'flat']
# Possible value ['local', 'flat', 'vlan', 'gre', 'vxlan'] # Possible value ['local', 'flat', 'vlan', 'gre', 'vxlan']
# #
# [*ml2_enabled*] # [*plugin*]
# (optional) Enable or not ML2 plugin # (optional) Neutron plugin name
# Defaults to true # Supported values: 'ml2', 'n1kv'.
# Defaults to 'ml2'
# #
class cloud::network( class cloud::network(
$verbose = true, $verbose = true,
$debug = true, $debug = true,
$rabbit_hosts = ['127.0.0.1:5672'], $rabbit_hosts = ['127.0.0.1:5672'],
$rabbit_password = 'rabbitpassword', $rabbit_password = 'rabbitpassword',
$api_eth = '127.0.0.1', $api_eth = '127.0.0.1',
$provider_vlan_ranges = ['physnet1:1000:2999'], $provider_vlan_ranges = ['physnet1:1000:2999'],
$use_syslog = true, $use_syslog = true,
$log_facility = 'LOG_LOCAL0', $log_facility = 'LOG_LOCAL0',
$dhcp_lease_duration = '120', $dhcp_lease_duration = '120',
$flat_networks = ['public'], $flat_networks = ['public'],
$tenant_network_types = ['gre'], $tenant_network_types = ['gre'],
$type_drivers = ['gre', 'vlan', 'flat'], $type_drivers = ['gre', 'vlan', 'flat'],
$ml2_enabled = true, $plugin = 'ml2',
# only needed by cisco n1kv plugin
$n1kv_vsm_ip = '127.0.0.1',
$n1kv_vsm_password = 'secrete',
$neutron_db_host = '127.0.0.1',
$neutron_db_user = 'neutron',
$neutron_db_password = 'neutronpassword',
$ks_keystone_admin_host = '127.0.0.1',
$ks_keystone_admin_proto = 'http',
$ks_keystone_admin_port = 35357,
$ks_keystone_admin_password = 'secrete',
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$tunnel_eth = false, $tunnel_eth = false,
$tunnel_types = false, $tunnel_types = false,
$provider_bridge_mappings = false, $provider_bridge_mappings = false,
$external_int = false, $external_int = false,
$external_bridge = false, $external_bridge = false,
$manage_ext_network = false, $manage_ext_network = false,
) { ) {
# Deprecated parameters warning # Deprecated parameters warning
@@ -132,16 +143,41 @@ class cloud::network(
$log_dir = '/var/log/neutron' $log_dir = '/var/log/neutron'
} }
if $ml2_enabled { case $plugin {
$core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin' 'ml2': {
class { 'neutron::plugins::ml2': $core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin'
type_drivers => $type_drivers, class { 'neutron::plugins::ml2':
tenant_network_types => $tenant_network_types, type_drivers => $type_drivers,
network_vlan_ranges => $provider_vlan_ranges, tenant_network_types => $tenant_network_types,
tunnel_id_ranges => ['1:10000'], network_vlan_ranges => $provider_vlan_ranges,
flat_networks => $flat_networks, tunnel_id_ranges => ['1:10000'],
mechanism_drivers => ['openvswitch','l2population'], flat_networks => $flat_networks,
enable_security_group => true mechanism_drivers => ['openvswitch','l2population'],
enable_security_group => true
}
}
'n1kv': {
$core_plugin = 'neutron.plugins.cisco.network_plugin.PluginV2'
class { 'neuton::plugins::cisco':
database_user => $neutron_db_user,
database_password => $neutron_db_password,
database_host => $neutron_db_host,
keystone_auth_url => "${ks_keystone_admin_proto}://${ks_keystone_admin_host}:${ks_keystone_admin_port}/v2.0/",
keystone_password => $ks_keystone_admin_password,
vswitch_plugin => 'neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2',
}
neutron_plugin_cisco {
'securitygroup/firewall_driver': value => 'neutron.agent.firewall.NoopFirewallDriver';
"N1KV:${n1kv_vsm_ip}/username": value => 'admin';
"N1KV:${n1kv_vsm_ip}/password": value => $n1kv_vsm_password;
# TODO (EmilienM) not sure about this one:
'database/connection': value => "mysql://${neutron_db_user}:${neutron_db_password}@${neutron_db_host}/neutron";
}
}
default: {
err "${plugin} plugin is not supported."
} }
} }

View File

@@ -144,34 +144,43 @@ class cloud::network::vswitch(
include 'cloud::network' include 'cloud::network'
if $driver == 'ml2_ovs' { case $driver {
class { 'neutron::agents::ml2::ovs': 'ml2_ovs': {
enable_tunneling => true, class { 'neutron::agents::ml2::ovs':
l2_population => true, enable_tunneling => true,
polling_interval => '15', l2_population => true,
tunnel_types => $tunnel_types, polling_interval => '15',
bridge_mappings => $provider_bridge_mappings, tunnel_types => $tunnel_types,
local_ip => $tunnel_eth bridge_mappings => $provider_bridge_mappings,
local_ip => $tunnel_eth
}
if $::osfamily == 'RedHat' {
kmod::load { 'ip_gre': }
}
} }
if $::osfamily == 'RedHat' { 'n1kv_vem': {
kmod::load { 'ip_gre': } # We don't check if we are on Red Hat system
# (already done by puppet-neutron)
class { 'neutron::agents::n1kv_vem':
n1kv_vsm_ip => $n1kv_vsm_ip,
n1kv_vsm_domain_id => $n1kv_vsm_domain_id,
host_mgmt_intf => $host_mgmt_intf,
uplink_profile => $uplink_profile,
vtep_config => $vtep_config,
node_type => $node_type,
vteps_in_same_subnet => $vteps_in_same_subnet,
n1kv_source => $n1kv_source,
n1kv_version => $n1kv_version,
}
ensure_resource('package', 'nexus1000v', {
ensure => present
})
} }
}
if $driver == 'n1kv_vem' { default: {
# We don't check if we are on Red Hat system err "${driver} driver is not supported."
# (already done by puppet-neutron)
class { 'neutron::agents::n1kv_vem':
n1kv_vsm_ip => $n1kv_vsm_ip,
n1kv_vsm_domain_id => $n1kv_vsm_domain_id,
host_mgmt_intf => $host_mgmt_intf,
uplink_profile => $uplink_profile,
vtep_config => $vtep_config,
node_type => $node_type,
vteps_in_same_subnet => $vteps_in_same_subnet,
n1kv_source => $n1kv_source,
n1kv_version => $n1kv_version,
} }
} }

View File

@@ -99,6 +99,11 @@ describe 'cloud::network::vswitch' do
:node_type => 'compute' :node_type => 'compute'
) )
end end
it 'ensure cisco VEM package is present' do
should contain_package('nexus1000v').with(
:ensure => 'present'
)
end
end end
context 'when using provider external network' do context 'when using provider external network' do
@@ -119,6 +124,13 @@ describe 'cloud::network::vswitch' do
end end
end end
context 'with unsupported Neutron driver' do
before :each do
params.merge!(:driver => 'Something')
end
it { should compile.and_raise_error(/Something plugin is not supported./) }
end
end end
context 'on Debian platforms' do context 'on Debian platforms' do