From d28a0b75def94237656380f00ece7c24110df0e2 Mon Sep 17 00:00:00 2001 From: Muhammad Shahzeb Date: Thu, 9 Jun 2016 03:37:41 -0400 Subject: [PATCH] [WIP] Add support for MOS8 in fuel plumgrid plugin - Changed parameters in environment config file - Changed values in metadata file - Changed director.pp manifest - Remove neutron-plugin package - Add support for deb based networking-plumgrid package - Changed core plugin value - Disable plugin guess function in neutron server upstart job Ticket: [SOL-1022] [SOL-975] [SOL-782] Change-Id: I4fdf75de95d367c9ae197d384ebc2eb1e4df738a Signed-off-by: Muhammad Shahzeb --- deployment_scripts/pg_os_version.sh | 36 ------------------ .../puppet/manifests/director.pp | 37 +++++++------------ .../puppet/manifests/pg_common.pp | 6 +++ .../puppet/manifests/pre_deployment.pp | 10 ++++- deployment_tasks.yaml | 13 +------ environment_config.yaml | 1 + metadata.yaml | 4 +- 7 files changed, 34 insertions(+), 73 deletions(-) delete mode 100644 deployment_scripts/pg_os_version.sh diff --git a/deployment_scripts/pg_os_version.sh b/deployment_scripts/pg_os_version.sh deleted file mode 100644 index 5fa80d4..0000000 --- a/deployment_scripts/pg_os_version.sh +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#!/bin/bash - -mkdir -p /var/log/plumgrid -exec > /var/log/plumgrid/pg_os_version.log -exec 2>&1 - -set -x - -. /tmp/plumgrid_config - -curl -Lks http://$pg_repo:81/files/lvm-installer.sh -o /tmp/lvm-installer.sh - -curl -Lks http://$pg_repo:81/files/pg_os_version.yaml -o /tmp/pg_os_version.yaml - -pg_version=$(cat /tmp/lvm-installer.sh | grep pg_ver= | awk 'NR==1 {print}'| cut -c9-| sed 's/-.*//') - -os_version=$(cat /tmp/pg_os_version.yaml | grep $pg_version-k | cut -d ' ' -f2) - -if [ -n "$os_version" ]; then - grep -q -F "networking_pg_version: $os_version" /etc/astute.yaml || echo "networking_pg_version: $os_version" >> /etc/astute.yaml -fi diff --git a/deployment_scripts/puppet/manifests/director.pp b/deployment_scripts/puppet/manifests/director.pp index 6536fcc..14720ab 100644 --- a/deployment_scripts/puppet/manifests/director.pp +++ b/deployment_scripts/puppet/manifests/director.pp @@ -27,7 +27,6 @@ $plumgrid_vip = pick($plumgrid_hash['plumgrid_virtual_ip']) $plumgrid_zone = pick($plumgrid_hash['plumgrid_zone']) $plumgrid_username = pick($plumgrid_hash['plumgrid_username']) $plumgrid_password = pick($plumgrid_hash['plumgrid_password']) -$networking_pg_version = hiera('networking_pg_version', '2015.1.1.1') # PLUMgrid Zone settings $network_metadata = hiera_hash('network_metadata') @@ -101,7 +100,7 @@ file { '/etc/neutron/neutron.conf': file_line { 'Enable PLUMgrid core plugin': path => '/etc/neutron/neutron.conf', - line => 'core_plugin=neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2', + line => 'core_plugin=networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2', match => '^core_plugin.*$', require => File['/etc/neutron/neutron.conf'], } @@ -132,6 +131,15 @@ file_line { 'Set libvirt cpu mode': require => File['/etc/nova/nova.conf'] } +# MOS8 uses the outdated PLUMgrid plugin string in the plugin guess function + +file_line { 'Replace plugin name in guess function': + path => '/usr/share/neutron-common/plugin_guess_func', + match => '"neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2"', + line => "\t\"networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2\")", + multiple => true +} + # Setting PLUMgrid Config Files class { '::neutron::plugins::plumgrid': @@ -145,29 +153,12 @@ class { '::neutron::plugins::plumgrid': nova_metadata_port => '8775', metadata_proxy_shared_secret => $metadata_secret, package_ensure => 'latest', -}-> -package { 'networking-plumgrid': - ensure => $networking_pg_version, - provider => 'pip', - notify => Service["$::neutron::params::server_service"], } -if ($networking_pg_version != '2015.1.1.1'){ - exec { "plumgrid-db-manage upgrade heads": - command => "/usr/local/bin/plumgrid-db-manage upgrade heads", - notify => Service["$::neutron::params::server_service"], - require => Package['networking-plumgrid'] - } -} - -# Update PLUMgrid plugin file - -file { 'plumgrid_plugin.py': - path => '/usr/lib/python2.7/dist-packages/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py', - ensure => present, - mode => '0644', - source => 'puppet:///modules/plumgrid/plumgrid_plugin.py', - notify => Service["$::neutron::params::server_service"] +exec { "neutron-db-manage upgrade heads": + command => "/usr/bin/neutron-db-manage upgrade heads", + notify => Service["$::neutron::params::server_service"], + require => Package['networking-plumgrid'] } # Update PLUMgrid pgrc file diff --git a/deployment_scripts/puppet/manifests/pg_common.pp b/deployment_scripts/puppet/manifests/pg_common.pp index 1f2a6f9..c92e68c 100644 --- a/deployment_scripts/puppet/manifests/pg_common.pp +++ b/deployment_scripts/puppet/manifests/pg_common.pp @@ -63,6 +63,12 @@ exec { 'ovs_rmmod': onlyif => 'lsmod | /bin/grep openvswitch' } +exec { 'openvswitch-switch_forceremove': + command => 'dpkg -r --force-all openvswitch-switch', + path => '/usr/bin', + onlyif => 'dpkg -l | /bin/grep openvswitch-switch' +} + package { 'openvswitch-*': ensure => absent } diff --git a/deployment_scripts/puppet/manifests/pre_deployment.pp b/deployment_scripts/puppet/manifests/pre_deployment.pp index 4658c91..24057b2 100644 --- a/deployment_scripts/puppet/manifests/pre_deployment.pp +++ b/deployment_scripts/puppet/manifests/pre_deployment.pp @@ -23,5 +23,13 @@ package { 'libvirt-bin' : } package { 'networking-plumgrid': ensure => 'absent', - provider => 'pip', +} + +# MOS8 was tagged with the older version of puppet neutron which contains outdated PLUMgrid plugin name + +file_line { 'Replace outdated plugin package name in puppet neutron': + path => '/etc/puppet/modules/neutron/manifests/params.pp', + line => " \$plumgrid_plugin_package = \'networking-plumgrid\'", + match => '\$plumgrid_plugin_package = \'openstack-neutron-plumgrid\'', + multiple => true } diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index df1b9fa..3e1fb5e 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -31,22 +31,13 @@ - id: pg_common role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller'] required_for: [post_deployment_end, pg_fabric] - requires: [post_deployment_start, check-pgzone] + requires: [post_deployment_start, check-pgzone, configure_default_route] type: puppet parameters: puppet_manifest: puppet/manifests/pg_common.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 3000 -- id: pg_os_version - role: ['controller', 'primary-controller'] - required_for: [post_deployment_end, setup-director] - requires: [post_deployment_start, pg_common] - type: shell - parameters: - cmd: bash pg_os_version.sh - timeout: 3000 - - id: pg_fabric role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller'] required_for: [post_deployment_end, setup-director] @@ -59,7 +50,7 @@ - id: setup-director role: ['controller', 'primary-controller'] required_for: [post_deployment_end, director-fixes] - requires: [post_deployment_start, pg_os_version, pg_fabric] + requires: [post_deployment_start, pg_fabric] type: puppet parameters: puppet_manifest: puppet/manifests/director.pp diff --git a/environment_config.yaml b/environment_config.yaml index a5e82f3..b3ba1d5 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -3,6 +3,7 @@ attributes: restrictions: - condition: "not (cluster:net_provider == 'neutron' and networking_parameters:segmentation_type == 'vlan')" message: "Please use Neutron with VLAN segmentation, the only network type supported with PLUMgrid plugin." + group: 'other' plumgrid_username: value: "plumgrid" label: "Enter the username for PLUMgrid" diff --git a/metadata.yaml b/metadata.yaml index 4c8eb28..8bbc5f5 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -7,7 +7,7 @@ version: '1.1.0' # Description description: This plugin enables the usage of PLUMgrid ONS as the network backend. # Required fuel version -fuel_version: ['7.0'] +fuel_version: ['8.0'] # Specify license of your plugin licenses: ['Apache License Version 2.0'] authors: ['javeriak@plumgrid.com', 'abdullah.khan@plumgrid.com'] @@ -17,7 +17,7 @@ groups: ['network'] # The plugin is compatible with releases in the list releases: - os: ubuntu - version: 2015.1.0-7.0 + version: liberty-8.0 mode: ['ha', 'multinode'] deployment_scripts_path: deployment_scripts/ repository_path: repositories/ubuntu