diff --git a/README.md b/README.md index c0284278..ff1bc6c7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ Cinder has multi-backend support: * NetAPP * iSCSI * 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. [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. diff --git a/manifests/network.pp b/manifests/network.pp index 168641ab..c9c9df79 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -86,32 +86,43 @@ # Defaults to ['gre', 'vlan', 'flat'] # Possible value ['local', 'flat', 'vlan', 'gre', 'vxlan'] # -# [*ml2_enabled*] -# (optional) Enable or not ML2 plugin -# Defaults to true +# [*plugin*] +# (optional) Neutron plugin name +# Supported values: 'ml2', 'n1kv'. +# Defaults to 'ml2' # class cloud::network( - $verbose = true, - $debug = true, - $rabbit_hosts = ['127.0.0.1:5672'], - $rabbit_password = 'rabbitpassword', - $api_eth = '127.0.0.1', - $provider_vlan_ranges = ['physnet1:1000:2999'], - $use_syslog = true, - $log_facility = 'LOG_LOCAL0', - $dhcp_lease_duration = '120', - $flat_networks = ['public'], - $tenant_network_types = ['gre'], - $type_drivers = ['gre', 'vlan', 'flat'], - $ml2_enabled = true, + $verbose = true, + $debug = true, + $rabbit_hosts = ['127.0.0.1:5672'], + $rabbit_password = 'rabbitpassword', + $api_eth = '127.0.0.1', + $provider_vlan_ranges = ['physnet1:1000:2999'], + $use_syslog = true, + $log_facility = 'LOG_LOCAL0', + $dhcp_lease_duration = '120', + $flat_networks = ['public'], + $tenant_network_types = ['gre'], + $type_drivers = ['gre', 'vlan', 'flat'], + $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 - $tunnel_eth = false, - $tunnel_types = false, - $provider_bridge_mappings = false, - $external_int = false, - $external_bridge = false, - $manage_ext_network = false, + $tunnel_eth = false, + $tunnel_types = false, + $provider_bridge_mappings = false, + $external_int = false, + $external_bridge = false, + $manage_ext_network = false, ) { # Deprecated parameters warning @@ -132,16 +143,41 @@ class cloud::network( $log_dir = '/var/log/neutron' } - if $ml2_enabled { - $core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin' - class { 'neutron::plugins::ml2': - type_drivers => $type_drivers, - tenant_network_types => $tenant_network_types, - network_vlan_ranges => $provider_vlan_ranges, - tunnel_id_ranges => ['1:10000'], - flat_networks => $flat_networks, - mechanism_drivers => ['openvswitch','l2population'], - enable_security_group => true + case $plugin { + 'ml2': { + $core_plugin = 'neutron.plugins.ml2.plugin.Ml2Plugin' + class { 'neutron::plugins::ml2': + type_drivers => $type_drivers, + tenant_network_types => $tenant_network_types, + network_vlan_ranges => $provider_vlan_ranges, + tunnel_id_ranges => ['1:10000'], + flat_networks => $flat_networks, + 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." } } diff --git a/manifests/network/vswitch.pp b/manifests/network/vswitch.pp index 9fc339c4..e0163f53 100644 --- a/manifests/network/vswitch.pp +++ b/manifests/network/vswitch.pp @@ -144,34 +144,43 @@ class cloud::network::vswitch( include 'cloud::network' - if $driver == 'ml2_ovs' { - class { 'neutron::agents::ml2::ovs': - enable_tunneling => true, - l2_population => true, - polling_interval => '15', - tunnel_types => $tunnel_types, - bridge_mappings => $provider_bridge_mappings, - local_ip => $tunnel_eth + case $driver { + 'ml2_ovs': { + class { 'neutron::agents::ml2::ovs': + enable_tunneling => true, + l2_population => true, + polling_interval => '15', + tunnel_types => $tunnel_types, + bridge_mappings => $provider_bridge_mappings, + local_ip => $tunnel_eth + } + + if $::osfamily == 'RedHat' { + kmod::load { 'ip_gre': } + } } - if $::osfamily == 'RedHat' { - kmod::load { 'ip_gre': } + 'n1kv_vem': { + # 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' { - # 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, + default: { + err "${driver} driver is not supported." } } diff --git a/spec/classes/cloud_network_vswitch_spec.rb b/spec/classes/cloud_network_vswitch_spec.rb index 519b12ab..98966ca4 100644 --- a/spec/classes/cloud_network_vswitch_spec.rb +++ b/spec/classes/cloud_network_vswitch_spec.rb @@ -99,6 +99,11 @@ describe 'cloud::network::vswitch' do :node_type => 'compute' ) end + it 'ensure cisco VEM package is present' do + should contain_package('nexus1000v').with( + :ensure => 'present' + ) + end end context 'when using provider external network' do @@ -119,6 +124,13 @@ describe 'cloud::network::vswitch' do 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 context 'on Debian platforms' do