Fuel 8.0 Nuage Neutron Plugin

Change-Id: I101c552d3d2b4b7be192d5e1976e541b3a3bd2e1
This commit is contained in:
Rohan Parulekar 2016-08-25 11:24:18 -04:00
parent 62c2723b85
commit e1d59e79c7
24 changed files with 211 additions and 86 deletions

View File

@ -1,13 +1,14 @@
Mirantis Fuel Nuage plugin
fuel-plugin-nuage
============
Compatible versions:
Mirantis Fuel 7.0
Nuage VSP 3.2
Mirantis Fuel 8.0 Nuage VSP 4.0
How to build plugin:
Install fuel plugin builder (fpb)
Clone plugin repo and run fpb there:
git clone https://github.com/openstack/fuel-plugin-nuage
@ -16,4 +17,4 @@ cd fuel-plugin-nuage
fpb --build .
Check if file nuage-openstack-fuel-plugin-1.0-1.0.0-1.noarch.rpm was created.
Check if file nuage-openstack-fuel-plugin-2.0-2.0.0-1.noarch.rpm was created.

View File

@ -51,7 +51,7 @@ def init_arg_parser():
parser.add_argument('--serverssl', action='store', required=True,
help='VSD Server SSL')
parser.add_argument('--base_uri', action='store', required=True,
help='Nuage Base URI')
help='Nuage Base URI')
parser.add_argument('--name', action='store',
default=DEFAULT_CMS_NAME,
help='The name of the CMS to create on VSD')

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
service neutron-server start
server_restart_count=0
while [ $server_restart_count -lt 10 ]
do
source ~/openrc
neutron net-list
if [ "$?" = "0" ]; then
echo "Neutron successfully started with Nuage Plugin"
break
fi
echo "Restarting neutron-server service"
service neutron-server restart
sleep 20
server_restart_count=`expr $server_restart_count + 1`
done

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
lineno=$(iptables -nvL INPUT --line-numbers | grep "state NEW,RELATED,ESTABLISHED" | awk '{print $1}')
iptables -I INPUT $lineno -s 0.0.0.0/0 -p tcp -m multiport --dports 8775 -m comment --comment "Nuage Metadata Agent listen port on the controller" -j ACCEPT

View File

@ -1,20 +1,12 @@
$hiera_dir = '/etc/hiera/override'
$hiera_dir = '/etc/hiera/plugins'
$plugin_name = 'nuage-openstack-fuel-plugin'
$plugin_yaml = "${plugin_name}.yaml"
file {'/etc/hiera/override':
file {'/etc/hiera/plugins':
ensure => directory,
} ->
file { "${hiera_dir}/${plugin_yaml}":
ensure => file,
content => "quantum_settings:
predefined_networks: ''",
require => File['/etc/hiera/override']
} ->
file_line {"${plugin_name}_hiera_override":
path => '/etc/hiera.yaml',
line => " - override/${plugin_name}",
after => ' - override/module/%{calling_module}',
ensure => file,
content => 'neutron_config: { predefined_networks: [] }',
}

View File

@ -1 +1 @@
include nuage::controller::disable_neutron_services
include nuage::controller::install_nuage_neutron

View File

@ -1 +1,6 @@
include nuage::controller::purge_neutron_packages
include nuage
class { 'nuage::controller::set_nuage_core_plugin':
core_plugin => 'neutron.plugins.nuage.plugin.NuagePlugin',
service_plugins => '',
}

View File

@ -1 +1,2 @@
include nuage::controller::install_nuage_neutron
include nuage
include nuage::controller::configure_nuage_plugin

View File

@ -1,6 +1,8 @@
include nuage
class { 'nuage::controller::set_nuage_core_plugin':
core_plugin => 'neutron.plugins.nuage.plugin.NuagePlugin',
service_plugins => '',
class { 'nuage::controller::nova':
firewall_driver => 'nova.virt.firewall.NoopFirewallDriver',
security_group_api => 'neutron',
libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver',
neutron_ovs_bridge => 'alubr0',
}

View File

@ -1,2 +1 @@
include nuage
include nuage::controller::configure_nuage_plugin
include nuage::controller::configure_nuage_horizon

View File

@ -1,8 +1 @@
include nuage
class { 'nuage::controller::nova':
firewall_driver => 'nova.virt.firewall.NoopFirewallDriver',
security_group_api => 'neutron',
libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver',
neutron_ovs_bridge => 'alubr0',
}
include nuage::controller::configure_nuage_heat

View File

@ -1 +1,2 @@
include nuage::controller::configure_nuage_horizon
include nuage
include nuage::controller::nuage_db_sync

View File

@ -1 +1,2 @@
include nuage::controller::configure_nuage_heat
include nuage
include nuage::controller::setup_neutron_networks

View File

@ -1,6 +1,6 @@
# Configure the VRS on compute
class nuage::compute::configure_vrs {
include ::nuage::params
package { $::nuage::params::openvswitch_switch:
@ -13,12 +13,12 @@ class nuage::compute::configure_vrs {
ensure => 'present',
require => Package[$::nuage::params::openvswitch_switch]
}
file { '/etc/default/openvswitch-switch':
require => Package[$::nuage::params::nuage_openvswitch_switch],
notify => Service[$::nuage::params::nuage_openvswitch_switch]
}
File_line<||> ~> Service[$::nuage::params::nuage_openvswitch_switch]
File['/etc/default/openvswitch-switch'] -> File_line<||>

View File

@ -1,9 +1,9 @@
# Install nuage metadata agent packages
class nuage::compute::install_nuage_metadata_agent {
include ::nuage::params
package { $::nuage::params::python_novaclient:
ensure => present,
}

View File

@ -19,6 +19,12 @@ class nuage::controller::configure_nuage_plugin {
group => 'neutron',
mode => '0640'
} ->
file_line {'add_neutron_defaults':
ensure => 'present',
line => '. /etc/default/neutron-server',
path => '/etc/init/neutron-server.conf',
after => 'neutron_plugin_ini_path',
} ->
file { '/etc/neutron/plugins/nuage/plugin.ini':
ensure => 'present',
require => File['/etc/neutron/plugins/nuage'],

View File

@ -0,0 +1,15 @@
# Perform Nuage DB sync
class nuage::controller::nuage_db_sync {
exec { 'nuage-neutron-stop':
command => 'service neutron-server stop',
path => '/usr/bin',
} ->
exec { 'nuage-neutron-db-sync':
command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
path => '/usr/bin',
logoutput => true,
}
}

View File

@ -6,7 +6,7 @@ class nuage::controller::set_nuage_core_plugin (
) {
#Setting core plugin to be Nuage and disabling service plugins
neutron_config {
'DEFAULT/core_plugin' : value => $core_plugin;
'DEFAULT/service_plugins': value => $service_plugins;

View File

@ -0,0 +1,61 @@
class nuage::controller::setup_neutron_networks {
include ::nuage::params
$neutron_settings = hiera('quantum_settings')
$external_net_name = $neutron_settings['default_floating_net']
$tenant_net_name = $neutron_settings['default_private_net']
$predefined_nets = $neutron_settings['predefined_networks']
$tenant_net = $predefined_nets[$tenant_net_name]
$external_net = $predefined_nets[$external_net_name]
service { 'neutron-server':
ensure => running,
}
neutron_network { $tenant_net_name:
ensure => present,
router_external => $tenant_net['L2']['router_ext'],
tenant_name => $tenant_net['tenant'],
shared => $tenant_net['shared']
} ->
neutron_subnet { "${tenant_net_name}__subnet":
ensure => present,
cidr => $tenant_net['L3']['subnet'],
network_name => $tenant_net_name,
tenant_name => $tenant_net['tenant'],
gateway_ip => $tenant_net['L3']['gateway'],
enable_dhcp => $tenant_net['L3']['enable_dhcp'],
dns_nameservers => $tenant_net['L3']['nameservers']
} ->
neutron_network { $external_net_name:
ensure => present,
router_external => $external_net['L2']['router_ext'],
tenant_name => $external_net['tenant'],
shared => $external_net['shared']
} ->
neutron_subnet { "${external_net_name}__subnet":
ensure => present,
cidr => $external_net['L3']['subnet'],
network_name => $external_net_name,
tenant_name => $external_net['tenant'],
gateway_ip => $external_net['L3']['gateway'],
enable_dhcp => $external_net['L3']['enable_dhcp'],
dns_nameservers => $external_net['L3']['nameservers']
# allocation_pools => $allocation_pools
} ->
neutron_router { 'nuage_router':
ensure => present,
tenant_name => $external_net['tenant'],
gateway_network_name => $external_net_name,
} ->
neutron_router_interface { "nuage_router:${tenant_net_name}__subnet":
ensure => present,
}
}

View File

@ -1,15 +1,15 @@
[RESTPROXY]
# Desired Name of VSD Organization/Enterprise to use when net-partition
# is not specified
default_net_partition_name = <%= scope.lookupvar('nuage::net_partition_name') %>
default_net_partition_name = <%= scope.lookupvar('nuage::net_partition_name') %>
# Hostname or IP address and port for connection to VSD server
server = <%= scope.lookupvar('nuage::vsd_ip') %>
# VSD Username and password for OpenStack plugin connection
# User must belong to CSP Root group and CSP CMS group
serverauth = <%= scope.lookupvar('nuage::vsd_username') %>:<%= scope.lookupvar('nuage::vsd_password') %>
serverauth = <%= scope.lookupvar('nuage::vsd_username') %>:<%= scope.lookupvar('nuage::vsd_password') %>
### Do not change the below options for standard installs
organization = <%= scope.lookupvar('nuage::vsd_organization') %>
organization = <%= scope.lookupvar('nuage::vsd_organization') %>
auth_resource = /me
serverssl = True
base_uri = /nuage/api/<%= scope.lookupvar('nuage::base_uri_version') %>

View File

@ -1,19 +1,32 @@
- id: controller-hiera-override
type: puppet
groups: [primary-controller, controller]
required_for: [globals]
requires: [hiera]
required_for: [openstack-network-start]
requires: [deploy_start, globals]
parameters:
puppet_manifest: puppet/manifests/controller-hiera-override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
timeout: 120
- id: compute-hiera-override
type: puppet
groups: ['compute']
required_for: [globals]
requires: [hiera]
parameters:
puppet_manifest: puppet/manifests/compute-hiera-override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Skip L2, L3, DHCP and Metadata Neutron agents
- id: primary-openstack-network-agents-l3
type: skipped
- id: openstack-network-agents-l3
type: skipped
- id: primary-openstack-network-agents-dhcp
type: skipped
- id: openstack-network-agents-dhcp
type: skipped
- id: primary-openstack-network-agents-metadata
type: skipped
- id: openstack-network-agents-metadata
type: skipped
# Skip default fuel networks and routers
- id: openstack-network-networks
type: skipped
- id: openstack-network-routers
type: skipped
- id: primary-openstack-network-plugins-l2
type: skipped
- id: openstack-network-plugins-l2
type: skipped

View File

@ -10,6 +10,9 @@ attributes:
description: 'Nuage Net Partition name for VSD'
weight: 20
type: "text"
regex:
source: '^\S{1,}$'
error: "Nuage Net Partition name is required"
nuage_vsd_ip:
value: ''
label: 'VSD IP address'
@ -25,18 +28,27 @@ attributes:
description: 'VSD user'
weight: 40
type: "text"
regex:
source: '^\S{1,}$'
error: "VSD username is required"
nuage_vsd_password:
value: ''
label: 'VSD password'
description: 'VSD password'
weight: 50
type: "text"
regex:
source: '^\S{1,}$'
error: "VSD password is required"
nuage_vsd_organization:
value: ''
label: 'VSD organization name'
description: 'VSD organization'
weight: 60
type: "text"
regex:
source: '^\S{1,}$'
error: "VSD organization name is required"
nuage_base_uri_version:
value: ''
label: 'Nuage base uri version'
@ -88,6 +100,9 @@ attributes:
description: 'Nuage CMS ID'
weight: 130
type: "text"
regex:
source: '^\S{1,}$'
error: "CMS ID is required"
pat_to_underlay:
value: false
label: "PAT to Underlay"

View File

@ -3,28 +3,29 @@ name: nuage-openstack-fuel-plugin
# Human-readable name for your plugin
title: Fuel Nuage plugin
# Plugin version
version: '1.0.0'
version: '2.0.0'
# Description
description: Nuage plugin for Fuel provides the functionality to add Nuage SDN for Mirantis OpenStack
# Required fuel version
fuel_version: ['7.0']
fuel_version: ['8.0']
# Specify license of your plugin
licenses: ['Apache License Version 2.0']
# Specify author or company name
authors: ['Rohan Parulekar, Vishal Patil']
authors: ['Rohan Parulekar, Vishal Patil,Sneha Deshpande']
# A link to the plugin's page
homepage: 'https://github.com/stackforge/fuel-plugins'
# Specify a group which your plugin implements, possible options:
# network, storage, storage::cinder, storage::glance, hypervisor
groups: []
groups: ['network']
is_hotpluggable: false
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2015.1.0-7.0
mode: ['ha']
version: liberty-8.0
mode: ['ha', 'multinode']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
# Version of plugin package
package_version: '3.0.0'
package_version: '4.0.0'

View File

@ -1,11 +1,3 @@
- role: ['primary-controller']
stage: post_deployment/6001
type: shell
parameters:
cmd: sudo bash ./disable_pacemaker_neutron_services.sh
timeout: 720
fail_on_error: false
- role: ['primary-controller','controller']
stage: post_deployment/6002
type: shell
@ -13,7 +5,7 @@
cmd: sudo bash ./pre_controller_setup.sh
timeout: 720
fail_on_error: false
- role: ['compute']
stage: post_deployment/6003
type: shell
@ -70,7 +62,7 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- role: ['primary-controller','controller']
- role: ['primary-controller']
stage: post_deployment/6010
type: puppet
parameters:
@ -78,16 +70,8 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- role: ['primary-controller','controller']
stage: post_deployment/6011
type: puppet
parameters:
puppet_manifest: puppet/manifests/site-controller-post-8.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- role: ['compute']
stage: post_deployment/6012
stage: post_deployment/6011
type: puppet
parameters:
puppet_manifest: puppet/manifests/site-compute-post-1.pp
@ -95,7 +79,7 @@
timeout: 720
- role: ['compute']
stage: post_deployment/6013
stage: post_deployment/6012
type: puppet
parameters:
puppet_manifest: puppet/manifests/site-compute-post-2.pp
@ -103,13 +87,21 @@
timeout: 720
- role: ['compute']
stage: post_deployment/6014
stage: post_deployment/6013
type: puppet
parameters:
puppet_manifest: puppet/manifests/site-compute-post-3.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- role: ['primary-controller','controller']
stage: post_deployment/6014
type: shell
parameters:
cmd: sudo bash ./neutron_server_restart.sh
timeout: 720
fail_on_error: false
- role: ['primary-controller','controller']
stage: post_deployment/6015
type: shell
@ -117,3 +109,12 @@
cmd: sudo bash ./test_neutron_setup_with_nuage_plugin.sh
timeout: 720
fail_on_error: true
- role: ['primary-controller']
stage: post_deployment/6016
type: puppet
parameters:
puppet_manifest: puppet/manifests/site-controller-post-8.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 1440
fail_on_error: false