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,9 +86,10 @@
# 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(
@@ -104,7 +105,17 @@ class cloud::network(
$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,
@@ -132,7 +143,8 @@ class cloud::network(
$log_dir = '/var/log/neutron' $log_dir = '/var/log/neutron'
} }
if $ml2_enabled { case $plugin {
'ml2': {
$core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin' $core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin'
class { 'neutron::plugins::ml2': class { 'neutron::plugins::ml2':
type_drivers => $type_drivers, type_drivers => $type_drivers,
@@ -145,6 +157,30 @@ class cloud::network(
} }
} }
'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."
}
}
class { 'neutron': class { 'neutron':
allow_overlapping_ips => true, allow_overlapping_ips => true,
verbose => $verbose, verbose => $verbose,

View File

@@ -144,7 +144,8 @@ class cloud::network::vswitch(
include 'cloud::network' include 'cloud::network'
if $driver == 'ml2_ovs' { case $driver {
'ml2_ovs': {
class { 'neutron::agents::ml2::ovs': class { 'neutron::agents::ml2::ovs':
enable_tunneling => true, enable_tunneling => true,
l2_population => true, l2_population => true,
@@ -159,7 +160,7 @@ class cloud::network::vswitch(
} }
} }
if $driver == 'n1kv_vem' { 'n1kv_vem': {
# We don't check if we are on Red Hat system # We don't check if we are on Red Hat system
# (already done by puppet-neutron) # (already done by puppet-neutron)
class { 'neutron::agents::n1kv_vem': class { 'neutron::agents::n1kv_vem':
@@ -173,6 +174,14 @@ class cloud::network::vswitch(
n1kv_source => $n1kv_source, n1kv_source => $n1kv_source,
n1kv_version => $n1kv_version, n1kv_version => $n1kv_version,
} }
ensure_resource('package', 'nexus1000v', {
ensure => present
})
}
default: {
err "${driver} driver is not supported."
}
} }
if $manage_ext_network { if $manage_ext_network {

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