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
 - Replace plugin name in guess function
 - Add iptables rule for metadata
 - Add support for solutions api (license, ips, zoneinfo)
 - Fixed cleanup script
 - Delete all neutron agents at deployment
 - Place nova sql url in nova.conf of compute
 - Add fabric network support in modules
 - Made username and password variable in post license
 - Setup plumgrid sigmund service
 - Indentation fixes

Ticket: [SOL-1022] [SOL-975] [SOL-782] [SOL-1147] [SOL-1144] [SOL-1101]
Change-Id: I4fdf75de95d367c9ae197d384ebc2eb1e4df738a
Signed-off-by: Muhammad Shahzeb <mshahzeb@plumgrid.com>
(cherry picked from commit d28a0b75de)
(cherry picked from commit 2bfe4490a7)
This commit is contained in:
Muhammad Shahzeb 2016-06-09 03:37:41 -04:00
parent 41f19ebf86
commit aa417e80fd
15 changed files with 211 additions and 218 deletions

View File

@ -29,11 +29,15 @@ if [[ ! -f "/root/cleanup_os" ]];then
neutron router-interface-delete $router_id $subnet_id
neutron router-delete $router_id
neutron subnet-delete $subnet_id
neutron net-delete net04
neutron net-delete net04_ext
admin_id=`keystone tenant-list|grep admin|awk -F '|' '{ print $2 }'`
neutron security-group-delete --tenant-id $admin_id
neutron security-group-delete default
neutron net-delete admin_floating_net
neutron net-delete admin_internal_net
admin_id=`openstack project list|grep admin|awk -F '|' '{ print $2 }'`
group_id=`neutron security-group-list --tenant-id $admin_id |grep default|awk -F '|' '{ print $2 }'`
neutron security-group-delete $group_id
for i in `neutron agent-list | cut -d "|" -f 2`
do
neutron agent-delete $i
done
touch /root/cleanup_os
else

View File

@ -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

View File

@ -1,68 +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/plumgrid_fabric.log
exec 2>&1
set -x
. /tmp/plumgrid_config
function check_and_replace() {
local check_line=$1
local replace_line=$2
local file=$3
grep -q "$check_line" $file
if [[ $? -ne 0 ]]; then
sed -i "$ a\\$replace_line" $file
else
sed -i "s/$check_line.*/$replace_line/g" $file
fi
return 0
}
fabric_ip=$(ip addr show br-mgmt | awk '$1=="inet" {print $2}' | awk -F '/' '{print $1}' | awk -F '.' '{print $4}' | head -1)
fabric_dev=$(brctl show br-mgmt | awk -F ' ' '{print $4}' | awk 'FNR == 2 {print}' | awk -F '.' '{print $1}')
# remove the default bridge, if it exists
BRIDGE_AUX=$(brctl show | grep br-aux || true)
if [[ ! -z "${BRIDGE_AUX}" ]];then
brctl delif br-aux $fabric_dev
ifconfig br-aux down
brctl delbr br-aux
rm -f /etc/network/interfaces.d/ifcfg-br-aux
fi
fabric_netmask=$(ifconfig br-mgmt | grep Mask | sed s/^.*Mask://)
fabric_net=$(echo $fabric_network | cut -f2 -d: | cut -f1-3 -d.)
ifconfig $fabric_dev $fabric_net.$fabric_ip netmask $fabric_netmask
ifconfig $fabric_dev mtu 1580
check_and_replace "iface " "iface $fabric_dev inet static" /etc/network/interfaces.d/ifcfg-$fabric_dev
check_and_replace "address " "address $fabric_net.$fabric_ip" /etc/network/interfaces.d/ifcfg-$fabric_dev
check_and_replace "netmask " "netmask $fabric_netmask" /etc/network/interfaces.d/ifcfg-$fabric_dev
check_and_replace "mtu " "mtu 1580" /etc/network/interfaces.d/ifcfg-$fabric_dev
sed -i "/bridge_port.*/d" /etc/network/interfaces.d/ifcfg-$fabric_dev
grep -q -F "fabric_dev: $fabric_dev" /etc/astute.yaml || echo "fabric_dev: $fabric_dev" >> /etc/astute.yaml

View File

@ -38,7 +38,7 @@ if [[ ! -f "/root/post_director" ]];then
#Login to PLUMgrid
http_status=$(curl -H "Accept: application/json" -H "Content-Type: application/json" -k -X \
POST https://$vip/0/login -d '{"userName":"plumgrid","password":"plumgrid"}' \
POST https://$vip/0/login -d '{"userName":"'$plumgrid_username'","password":"'$plumgrid_password'"}' \
-c /tmp/cookie -i | grep HTTP | awk '{print $2}')
echo $http_status
@ -48,13 +48,13 @@ if [[ ! -f "/root/post_director" ]];then
done
#Install License
install_status=$(curl -H "Accept: application/json" -H "Content-Type: application/json" \
https://$vip/0/tenant_manager/license_key/key1 -k -X PUT -d '{"license": '\"$license\"'}' \
-i -b /tmp/cookie -k| grep HTTP | awk '{print $2}')
install_status=$(curl -H "Accept: application/json" -H "Content-Type: application/json" -X PUT \
-d '{"user_name":"'$plumgrid_username'","password":"'$plumgrid_password'","license":"'$license'"}' \
http://$pg_repo:8099/v1/zones/$zone_name/pgLicense)
echo $install_status
if [[ $install_status -ne 200 ]]; then
if [[ $install_status != "{\"status\": \"success\",\"message\":\"Successfully installed PLUMgrid license\",\"data\":}" ]]; then
echo "Error installing license, exiting..."
exit 1
fi

View File

@ -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')
@ -36,7 +35,7 @@ $controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-c
$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
$mgmt_net = hiera('management_network_range')
$fabric_dev = hiera('fabric_dev')
$fabric_dev = 'br-100000'
$md_ip = pick($plumgrid_hash['plumgrid_opsvm'])
# Neutron settings
@ -72,13 +71,17 @@ class { 'plumgrid':
md_ip => $md_ip,
source_net => $mgmt_net,
dest_net => $mgmt_net,
}->
exec { 'Setup plumgrid-sigmund service':
command => "/opt/local/bin/nsenter -t \$(ps ho pid --ppid \$(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/sigmund-configure --ip $md_ip --start --autoboot",
returns => [0, 1],
}
class { 'sal':
plumgrid_ip => $controller_ipaddresses,
virtual_ip => $plumgrid_vip,
md_ip => $md_ip,
source_net => $mgmt_net,
source_net => $mgmt_net,
}
# Setup Neutron PLUMgrid Configurations
@ -89,9 +92,9 @@ package { 'neutron-server':
}
service { 'neutron-server':
ensure => 'running',
name => 'neutron-server',
enable => true,
ensure => 'running',
name => 'neutron-server',
enable => true,
}
file { '/etc/neutron/neutron.conf':
@ -100,16 +103,16 @@ 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',
match => '^core_plugin.*$',
path => '/etc/neutron/neutron.conf',
line => 'core_plugin=networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2',
match => '^core_plugin.*$',
require => File['/etc/neutron/neutron.conf'],
}
file_line { 'Disable service plugins':
path => '/etc/neutron/neutron.conf',
line => 'service_plugins = ""',
match => '^service_plugins.*$',
path => '/etc/neutron/neutron.conf',
line => 'service_plugins = ""',
match => '^service_plugins.*$',
require => File['/etc/neutron/neutron.conf'],
}
@ -119,19 +122,28 @@ file { '/etc/nova/nova.conf':
}
file_line { 'Set libvirt vif':
path => '/etc/nova/nova.conf',
line => 'libvirt_vif_type=ethernet',
match => '^libvirt_vif_type.*$',
path => '/etc/nova/nova.conf',
line => 'libvirt_vif_type=ethernet',
match => '^libvirt_vif_type.*$',
require => File['/etc/nova/nova.conf']
}
file_line { 'Set libvirt cpu mode':
path => '/etc/nova/nova.conf',
line => 'libvirt_cpu_mode=none',
match => '^libvirt_cpu_mode.*$',
path => '/etc/nova/nova.conf',
line => 'libvirt_cpu_mode=none',
match => '^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,35 +157,32 @@ 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
file { 'pgrc':
ensure => present,
path => '/etc/neutron/plugins/plumgrid/pgrc',
ensure => present,
path => '/etc/neutron/plugins/plumgrid/pgrc',
content => "export os_auth_url=http://$service_endpoint:35357/v2.0\nexport os_admin_user=$admin_username\nexport os_admin_tenant=$admin_tenant\nexport os_admin_password=$admin_password\nexport pg_virtual_ip=$plumgrid_vip\nexport pg_username=$plumgrid_username\nexport pg_password=$plumgrid_password",
}
firewall { '990 Add iptables rule for metadata':
chain => 'INPUT',
port => '8775',
proto => 'tcp',
action => 'accept',
}->
firewall { '991 Add iptables rule for solutions API':
chain => 'INPUT',
port => '8099',
state => ['NEW','ESTABLISHED'],
proto => 'tcp',
action => 'accept',
}

View File

@ -21,14 +21,14 @@ file { '/etc/apache2/ports.conf':
file_line { 'ensure no port conflict between apache and keystone':
path => '/etc/apache2/ports.conf',
line => 'NameVirtualHost *:35357',
line => 'NameVirtualHost *:35357',
ensure => 'absent',
require => File['/etc/apache2/ports.conf']
}
file_line { 'ensure no port conflict between apache-keystone':
path => '/etc/apache2/ports.conf',
line => 'NameVirtualHost *:5000',
line => 'NameVirtualHost *:5000',
ensure => 'absent',
require => File['/etc/apache2/ports.conf']
}

View File

@ -18,6 +18,9 @@ notice('MODULAR: plumgrid/edge.pp')
# Metadata settings
$metadata_hash = hiera_hash('quantum_settings', {})
$metadata_secret = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
$nova_hash = hiera_hash('nova', {})
$nova_sql_password = pick($nova_hash['db_password'])
$mgmt_vip = hiera('management_vip')
# PLUMgrid settings
$plumgrid_hash = hiera_hash('plumgrid', {})
@ -30,7 +33,7 @@ $controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-c
$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
$mgmt_net = hiera('management_network_range')
$fabric_dev = hiera('fabric_dev')
$fabric_dev = 'br-100000'
$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
$md_ip = pick($plumgrid_hash['plumgrid_opsvm'])
@ -42,6 +45,10 @@ class { 'plumgrid':
md_ip => $md_ip,
source_net => $mgmt_net,
dest_net => $mgmt_net,
}->
exec { 'Setup plumgrid-sigmund service':
command => "/opt/local/bin/nsenter -t \$(ps ho pid --ppid \$(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/sigmund-configure --ip $md_ip --start --autoboot",
returns => [0, 1],
}
package { 'nova-api':
@ -60,31 +67,38 @@ file { '/etc/nova/nova.conf':
}
file_line { 'Set libvirt vif':
path => '/etc/nova/nova.conf',
line => 'libvirt_vif_type=ethernet',
match => '^libvirt_vif_type.*$',
path => '/etc/nova/nova.conf',
line => 'libvirt_vif_type=ethernet',
match => '^libvirt_vif_type.*$',
require => File['/etc/nova/nova.conf']
}
file_line { 'Set libvirt cpu mode':
path => '/etc/nova/nova.conf',
line => 'libvirt_cpu_mode=none',
match => '^libvirt_cpu_mode.*$',
path => '/etc/nova/nova.conf',
line => 'libvirt_cpu_mode=none',
match => '^libvirt_cpu_mode.*$',
require => File['/etc/nova/nova.conf']
}
# Enabling Metadata on Computes
file_line { 'Enable Metadata Proxy':
path => '/etc/nova/nova.conf',
line => 'service_metadata_proxy=True',
match => '^#service_metadata_proxy=false',
path => '/etc/nova/nova.conf',
line => 'service_metadata_proxy=True',
match => '^#service_metadata_proxy=false',
require => File['/etc/nova/nova.conf']
}
file_line { 'Set Metadata Shared Secret':
path => '/etc/nova/nova.conf',
line => "metadata_proxy_shared_secret=$metadata_secret",
match => '^#metadata_proxy_shared_secret=',
path => '/etc/nova/nova.conf',
line => "metadata_proxy_shared_secret=$metadata_secret",
match => '^#metadata_proxy_shared_secret=',
require => File['/etc/nova/nova.conf']
}
file_line { 'Copy nova sql url on computes':
path => '/etc/nova/nova.conf',
line => "connection = mysql://nova:$nova_sql_password@$mgmt_vip/nova?read_timeout=60",
after => '^#connection = <None>',
require => File['/etc/nova/nova.conf']
}
@ -98,14 +112,14 @@ service { 'nova-api':
ensure => running,
name => 'nova-api',
require => Package['nova-api'],
enable => true,
enable => true,
}
service { 'nova-compute':
ensure => running,
name => 'nova-compute',
ensure => running,
name => 'nova-compute',
require => Package['nova-compute'],
enable => true,
enable => true,
}
file { '/etc/libvirt/qemu.conf':
@ -114,8 +128,8 @@ file { '/etc/libvirt/qemu.conf':
}
file_line { 'Libvirt QEMU settings':
path => '/etc/libvirt/qemu.conf',
line => 'cgroup_device_acl = ["/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/net/tun"]',
path => '/etc/libvirt/qemu.conf',
line => 'cgroup_device_acl = ["/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/net/tun"]',
require => File['/etc/libvirt/qemu.conf'],
}
@ -156,3 +170,10 @@ file_line { 'unmount plumgrid.fuse pre-start':
after => '/opt/pg/scripts/systemd_pre_start.sh',
require => Package[$plumgrid::params::plumgrid_package]
}
firewall { '990 Add iptables rule for metadata':
chain => 'INPUT',
port => '8775',
proto => 'tcp',
action => 'accept',
}

View File

@ -25,7 +25,7 @@ $controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-c
$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
$mgmt_net = hiera('management_network_range')
$fabric_dev = hiera('fabric_dev')
$fabric_dev = 'br-100000'
$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
$md_ip = pick($plumgrid_hash['plumgrid_opsvm'])
@ -38,6 +38,10 @@ class { 'plumgrid':
md_ip => $md_ip,
source_net => $mgmt_net,
dest_net => $mgmt_net,
}->
exec { 'Setup plumgrid-sigmund service':
command => "/opt/local/bin/nsenter -t \$(ps ho pid --ppid \$(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/sigmund-configure --ip $md_ip --start --autoboot",
returns => [0, 1],
}
package { 'iptables-persistent':

View File

@ -15,24 +15,34 @@
notice('MODULAR: plumgrid/pre_node.pp')
$fuel_hash = hiera_hash('public_ssl', {})
$fuel_hostname = pick($fuel_hash['hostname'])
$fuel_hash = hiera_hash('public_ssl', {})
$fuel_hostname = pick($fuel_hash['hostname'])
$metadata_hash = hiera_hash('quantum_settings', {})
$metadata = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
$metadata_hash = hiera_hash('quantum_settings', {})
$metadata = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
$plumgrid_hash = hiera_hash('plumgrid', {})
$plumgrid_pkg_repo = pick($plumgrid_hash['plumgrid_package_repo'])
$plumgrid_lic = pick($plumgrid_hash['plumgrid_license'])
$plumgrid_vip = pick($plumgrid_hash['plumgrid_virtual_ip'])
$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
$fabric_network = pick($plumgrid_hash['plumgrid_fabric_network'])
$plumgrid_username = pick($plumgrid_hash['plumgrid_username'])
$plumgrid_password = pick($plumgrid_hash['plumgrid_password'])
$plumgrid_pkg_repo = pick($plumgrid_hash['plumgrid_package_repo'])
$plumgrid_lic = pick($plumgrid_hash['plumgrid_license'])
$plumgrid_vip = pick($plumgrid_hash['plumgrid_virtual_ip'])
$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
$fabric_network = pick($plumgrid_hash['plumgrid_fabric_network'])
$opsvm_ip = pick($plumgrid_hash['plumgrid_opsvm'])
$fuel_version = hiera('fuel_version')
$network_metadata = hiera_hash('network_metadata')
$haproxy_vip = pick($network_metadata['vips']['public']['ipaddr'])
$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
$network_metadata = hiera_hash('network_metadata')
$haproxy_vip = pick($network_metadata['vips']['public']['ipaddr'])
$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
$compute_nodes = get_nodes_hash_by_roles($network_metadata, ['compute'])
$compute_address_map = get_node_to_ipaddr_map_by_network_role($compute_nodes, 'mgmt/vip')
$compute_ipaddresses = join(hiera_array('compute_ipaddresses', values($compute_address_map)), ',')
$gateway_nodes = get_nodes_hash_by_roles($network_metadata, ['PLUMgrid-Gateway'])
$gateway_address_map = get_node_to_ipaddr_map_by_network_role($gateway_nodes, 'mgmt/vip')
$gateway_ipaddresses = join(hiera_array('gateway_ipaddresses', values($gateway_address_map)), ',')
$pg_packages = [ 'python-pip', 'apparmor-utils' ]
@ -54,7 +64,7 @@ exec { "apt-get update":
file { '/tmp/plumgrid_config':
ensure => file,
content => "fuel_hostname=$fuel_hostname\nhaproxy_vip=$haproxy_vip\ndirector_ip=$controller_ipaddresses\nedge_ip=$compute_ipaddresses\nmetadata_secret=$metadata\nlicense=$plumgrid_lic\nvip=$plumgrid_vip\npg_repo=$plumgrid_pkg_repo\nzone_name=$plumgrid_zone\nfabric_network=$fabric_network",
content => "fuel_hostname=$fuel_hostname\nplumgrid_username=$plumgrid_username\nplumgrid_password=$plumgrid_password\nhaproxy_vip=$haproxy_vip\ndirector_ip=$controller_ipaddresses\nedge_ip=$compute_ipaddresses\ngateway_ip=$gateway_ipaddresses\nmetadata_secret=$metadata\nvip=$plumgrid_vip\nopsvm_ip=$opsvm_ip\npg_repo=$plumgrid_pkg_repo\nzone_name=$plumgrid_zone\nfabric_network=$fabric_network\nfuel_version=$fuel_version\nlicense=$plumgrid_lic",
}
exec { 'ovs_rmmod':
@ -63,6 +73,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
}

View File

@ -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",
multiple => true
}

View File

@ -0,0 +1,43 @@
#
# 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/solution_api.log
exec 2>&1
set -x
. /tmp/plumgrid_config
# Get required additional parameters
kernel_version=$(uname -r)
hypervisor_type=$(echo $(lsb_release -i) | cut -d' ' -f3)
hypervisor_version=$(echo $(lsb_release -r) | cut -d' ' -f2)
plumgrid_version=$(dpkg -l | awk '$2=="plumgrid-lxc" { print $3 }' | cut -d'-' -f1 )
# Get version of cloudApex
if [ -d /var/lib/libvirt/filesystems/plumgrid/opt/pg/web/cloudApex/modules/appCloudApex/ ]; then
cloudapex_version=$(cat /var/lib/libvirt/filesystems/plumgrid/opt/pg/web/cloudApex/modules/appCloudApex/appCloudApex.js | grep -i appVersion | awk '{print $2; exit}' | cut -d ',' -f 1 | cut -d "'" -f 2)
else
cloudapex_version="0.0"
fi
# Push all IPs info to Solution API server
curl -H 'Content-Type: application/json' -X PUT -d '{"director_ips":"'$director_ip'","edge_ips":"'$edge_ip'","gateway_ips":"'$gateway_ip'","virtual_ip":"'$vip'","opsvm_ip":"'$opsvm_ip'"}' http://$pg_repo:8099/v1/zones/$zone_name/ALLIPS
# Push zone info to Solution API server
curl -H "Content-Type: application/json" -X PUT -d '{"solution_name":"Mirantis","solution_version":"'$fuel_version'","pg_ons_version":"'$plumgrid_version'","hypervisor":"'$hypervisor_type'","hypervisor_version":"'$hypervisor_version'", "kernel_version":"'$kernel_version'","pg_cloudapex_version":"'$cloudapex_version'"}' http://$pg_repo:8099/v1/zones/$zone_name/zoneInfo

View File

@ -30,36 +30,18 @@
- id: pg_common
role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
required_for: [post_deployment_end, pg_fabric]
requires: [post_deployment_start, check-pgzone]
required_for: [post_deployment_end, setup-director]
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]
requires: [post_deployment_start, pg_common]
type: shell
parameters:
cmd: bash plumgrid_fabric.sh
timeout: 3000
- 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_common]
type: puppet
parameters:
puppet_manifest: puppet/manifests/director.pp
@ -78,17 +60,26 @@
- id: post_pg_license
role: ['primary-controller']
required_for: [post_deployment_end, setup-edge]
required_for: [post_deployment_end, solution-api]
requires: [post_deployment_start, director-fixes]
type: shell
parameters:
cmd: bash post_pg_license.sh
timeout: 3000
- id: solution-api
role: ['primary-controller']
required_for: [post_deployment_end, setup-edge]
requires: [post_deployment_start, post_pg_license]
type: shell
parameters:
cmd: bash solution_api.sh
timeout: 3000
- id: setup-edge
role: ['compute']
required_for: [post_deployment_end, setup-gateway]
requires: [post_deployment_start, post_pg_license]
requires: [post_deployment_start, solution-api]
type: puppet
parameters:
puppet_manifest: puppet/manifests/edge.pp

View File

@ -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"

View File

@ -3,11 +3,11 @@ name: plumgrid
# Human-readable name for your plugin
title: PLUMgrid plugin
# Plugin version
version: '1.1.0'
version: '2.0.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

View File

@ -1,5 +1,5 @@
- id: "fabric"
default_mapping: "management"
default_mapping: "Fabric"
properties:
subnet: true
gateway: false