From ee2c9ea45d705ad50fff991318342b06a8bbc721 Mon Sep 17 00:00:00 2001 From: Qasim Sarfraz Date: Tue, 15 Dec 2015 07:36:11 -0500 Subject: PLUMgrid Neutron integration Enable PLUMgrid neutron liberty plugin in a TripleO overcloud environment. Change-Id: I07025f67ec3f3399aac4dcd10cc37e857772548b Signed-off-by: Qasim Sarfraz --- environments/neutron-plumgrid.yaml | 29 ++++++ puppet/controller.yaml | 1 + .../pre_deploy/controller/neutron-plumgrid.yaml | 113 +++++++++++++++++++++ puppet/manifests/overcloud_compute.pp | 14 +++ puppet/manifests/overcloud_controller.pp | 14 ++- puppet/manifests/overcloud_controller_pacemaker.pp | 8 ++ 6 files changed, 176 insertions(+), 3 deletions(-) create mode 100755 environments/neutron-plumgrid.yaml create mode 100755 puppet/extraconfig/pre_deploy/controller/neutron-plumgrid.yaml diff --git a/environments/neutron-plumgrid.yaml b/environments/neutron-plumgrid.yaml new file mode 100755 index 00000000..b8d66015 --- /dev/null +++ b/environments/neutron-plumgrid.yaml @@ -0,0 +1,29 @@ +# A Heat environment file which can be used to enable PLUMgrid +# extensions, configured via puppet +resource_registry: + OS::TripleO::ControllerExtraConfigPre: ../puppet/extraconfig/pre_deploy/controller/neutron-plumgrid.yaml + +parameter_defaults: + NeutronCorePlugin: networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2 + PLUMgridDirectorServer: 127.0.0.1 + PLUMgridDirectorServerPort: 443 + PLUMgridUsername: username + PLUMgridPassword: password + PLUMgridServerTimeOut: 99 + PLUMgridNovaMetadataIP: 169.254.169.254 + PLUMgridNovaMetadataPort: 8775 + PLUMgridL2GatewayVendor: vendor + PLUMgridL2GatewayUsername: username + PLUMgridL2GatewayPassword: password + PLUMgridIdentityVersion: v2.0 + PLUMgridConnectorType: distributed + + #Optional Parameters + #PLUMgridNeutronPluginVersion: present + #PLUMgridPlumlibVersion: present + + # PLUMgrid doesn't require dhcp, l3, ovs and metadata agents + NeutronEnableDHCPAgent: false + NeutronEnableL3Agent: false + NeutronEnableMetadataAgent: false + NeutronEnableOVSAgent: false diff --git a/puppet/controller.yaml b/puppet/controller.yaml index a873ce8a..094102f5 100644 --- a/puppet/controller.yaml +++ b/puppet/controller.yaml @@ -1289,6 +1289,7 @@ resources: - neutron_nuage_data # Optionally provided by ControllerExtraConfigPre - midonet_data #Optionally provided by AllNodesExtraConfig - neutron_opencontrail_data # Optionally provided by ControllerExtraConfigPre + - neutron_plumgrid_data # Optionally provided by ControllerExtraConfigPre datafiles: controller_extraconfig: mapped_data: {get_param: ControllerExtraConfig} diff --git a/puppet/extraconfig/pre_deploy/controller/neutron-plumgrid.yaml b/puppet/extraconfig/pre_deploy/controller/neutron-plumgrid.yaml new file mode 100755 index 00000000..7c0a7ad2 --- /dev/null +++ b/puppet/extraconfig/pre_deploy/controller/neutron-plumgrid.yaml @@ -0,0 +1,113 @@ +heat_template_version: 2015-04-30 + +description: Controller hieradata for Neutron PLUMgrid configuration + +parameters: + server: + description: ID of the controller node to apply this config to + type: string + PLUMgridDirectorServer: + description: IP address of the PLUMgrid Director Server + type: string + default: 127.0.0.1 + PLUMgridDirectorServerPort: + description: Port of the PLUMgrid Director Server + type: string + default: 443 + PLUMgridUsername: + description: Username for PLUMgrid platform + type: string + PLUMgridPassword: + description: Password for PLUMgrid platform + type: string + hidden: true + PLUMgridServerTimeOut: + description: Request timeout duration (seconds) to PLUMgrid platform + type: string + default: 99 + PLUMgridNovaMetadataIP: + description: IP address of Nova Metadata + type: string + default: 169.254.169.254 + PLUMgridNovaMetadataPort: + description: Port of Nova Metadata + type: string + default: 8775 + PLUMgridL2GatewayVendor: + description: Vendor for L2 Gateway Switch + type: string + default: vendor + PLUMgridL2GatewayUsername: + description: Username for L2 Gateway Switch + type: string + default: username + PLUMgridL2GatewayPassword: + description: Password for L2 Gateway Switch + type: string + hidden: true + PLUMgridIdentityVersion: + description: Keystone Identity version + type: string + default: v2.0 + PLUMgridConnectorType: + description: Neutron Network Connector Type + type: string + default: distributed + PLUMgridNeutronPluginVersion: + description: PLUMgrid Neutron Plugin version + type: string + default: present + PLUMgridPlumlibVersion: + description: PLUMgrid Plumlib version + type: string + default: present + + +resources: + ControllerPLUMgridConfig: + type: OS::Heat::StructuredConfig + properties: + group: os-apply-config + config: + hiera: + datafiles: + neutron_plumgrid_data: + mapped_data: + neutron::plugins::plumgrid::director_server: {get_input: plumgrid_director_server} + neutron::plugins::plumgrid::director_server_port: {get_input: plumgrid_director_server_port} + neutron::plugins::plumgrid::username: {get_input: plumgrid_username} + neutron::plugins::plumgrid::password: {get_input: plumgrid_password} + neutron::plugins::plumgrid::nova_metadata_ip: {get_input: plumgrid_nova_metadata_ip} + neutron::plugins::plumgrid::nova_metadata_port: {get_input: plumgrid_nova_metadata_port} + neutron::plugins::plumgrid::l2gateway_vendor: {get_input: plumgrid_l2gateway_vendor} + neutron::plugins::plumgrid::l2gateway_sw_username: {get_input: plumgrid_l2gateway_sw_username} + neutron::plugins::plumgrid::l2gateway_sw_password: {get_input: plumgrid_l2gateway_sw_password} + neutron::plugins::plumgrid::connector_type: {get_input: plumgrid_connector_type} + neutron::plugins::plumgrid::identity_version: {get_input: plumgrid_identity_version} + neutron::plugins::plumgrid::package_ensure: {get_input: plumgrid_neutron_plugin_version} + neutron::plugins::plumgrid::plumlib_package_ensure: {get_input: plumgrid_plumlib_version} + + ControllerPLUMgridDeployment: + type: OS::Heat::StructuredDeployment + properties: + config: {get_resource: ControllerPLUMgridConfig} + server: {get_param: server} + input_values: + plumgrid_director_server: {get_param: PLUMgridDirectorServer} + plumgrid_director_server_port: {get_param: PLUMgridDirectorServerPort} + plumgrid_username: {get_param: PLUMgridUsername} + plumgrid_password: {get_param: PLUMgridPassword} + plumgrid_nova_metadata_ip: {get_param: PLUMgridNovaMetadataIP} + plumgrid_nova_metadata_port: {get_param: PLUMgridNovaMetadataPort} + plumgrid_l2gateway_vendor: {get_param: PLUMgridL2GatewayVendor} + plumgrid_l2gateway_sw_username: {get_param: PLUMgridL2GatewayUsername} + plumgrid_l2gateway_sw_password: {get_param: PLUMgridL2GatewayPassword} + plumgrid_identity_version: {get_param: PLUMgridIdentityVersion} + plumgrid_connector_type: {get_param: PLUMgridConnectorType} + plumgrid_neutron_plugin_version: {get_param: PLUMgridNeutronPluginVersion} + plumgrid_plumlib_version: {get_param: PLUMgridPlumlibVersion} + +outputs: + deploy_stdout: + description: Deployment reference, used to trigger puppet apply on changes + value: {get_attr: [ControllerPLUMgridDeployment, deploy_stdout]} diff --git a/puppet/manifests/overcloud_compute.pp b/puppet/manifests/overcloud_compute.pp index 13ae31c5..ee77518e 100644 --- a/puppet/manifests/overcloud_compute.pp +++ b/puppet/manifests/overcloud_compute.pp @@ -152,6 +152,20 @@ elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencont # require => Class['contrail::vrouter'], #} } +elsif hiera('neutron::core_plugin') == 'networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2' { + # forward all ipv4 traffic + # this is required for the vms to pass through the gateways public interface + sysctl::value { 'net.ipv4.ip_forward': value => '1' } + + # ifc_ctl_pp needs to be invoked by root as part of the vif.py when a VM is powered on + file { '/etc/sudoers.d/ifc_ctl_sudoers': + ensure => file, + owner => root, + group => root, + mode => '0440', + content => "nova ALL=(root) NOPASSWD: /opt/pg/bin/ifc_ctl_pp *\n", + } +} else { include ::neutron::plugins::ml2 diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp index 5556a40c..d786b29c 100644 --- a/puppet/manifests/overcloud_controller.pp +++ b/puppet/manifests/overcloud_controller.pp @@ -336,13 +336,21 @@ if hiera('step') >= 3 { include ::neutron::server include ::neutron::server::notifications - # If the value of core plugin is set to 'nuage' or 'opencontrail', - # include nuage or opencontrail core plugins, and it does not - # need the l3, dhcp and metadata agents + # If the value of core plugin is set to 'nuage' or'opencontrail' or 'plumgrid', + # include nuage or opencontrail or plumgrid core plugins + # else use the default value of 'ml2' if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' { include ::neutron::plugins::nuage } elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2' { include ::neutron::plugins::opencontrail + } + elsif hiera('neutron::core_plugin') == 'networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2' { + class { '::neutron::plugins::plumgrid' : + connection => hiera('neutron::server::database_connection'), + controller_priv_host => hiera('keystone_admin_api_vip'), + admin_password => hiera('admin_password'), + metadata_proxy_shared_secret => hiera('nova::api::neutron_metadata_proxy_shared_secret'), + } } else { include ::neutron::agents::l3 include ::neutron::agents::dhcp diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp index db3d8652..e3f31e91 100644 --- a/puppet/manifests/overcloud_controller_pacemaker.pp +++ b/puppet/manifests/overcloud_controller_pacemaker.pp @@ -777,6 +777,14 @@ if hiera('step') >= 3 { keystone_password => hiera('neutron::server::auth_password') } } + if hiera('neutron::core_plugin') == 'networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2' { + class { '::neutron::plugins::plumgrid' : + connection => hiera('neutron::server::database_connection'), + controller_priv_host => hiera('keystone_admin_api_vip'), + admin_password => hiera('admin_password'), + metadata_proxy_shared_secret => hiera('nova::api::neutron_metadata_proxy_shared_secret'), + } + } if hiera('neutron::enable_dhcp_agent',true) { class { '::neutron::agents::dhcp' : manage_service => false, -- cgit 1.2.3-korg