Browse Source

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)
Muhammad Shahzeb 2 years ago
parent
commit
aa417e80fd

+ 9
- 5
deployment_scripts/cleanup_os.sh View File

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

+ 0
- 36
deployment_scripts/pg_os_version.sh View File

@@ -1,36 +0,0 @@
1
-#
2
-# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-#!/bin/bash
17
-
18
-mkdir -p /var/log/plumgrid
19
-exec > /var/log/plumgrid/pg_os_version.log
20
-exec 2>&1
21
-
22
-set -x
23
-
24
-. /tmp/plumgrid_config
25
-
26
-curl -Lks http://$pg_repo:81/files/lvm-installer.sh  -o /tmp/lvm-installer.sh
27
-
28
-curl -Lks http://$pg_repo:81/files/pg_os_version.yaml  -o /tmp/pg_os_version.yaml
29
-
30
-pg_version=$(cat /tmp/lvm-installer.sh | grep pg_ver= | awk 'NR==1 {print}'| cut -c9-| sed 's/-.*//')
31
-
32
-os_version=$(cat /tmp/pg_os_version.yaml | grep $pg_version-k | cut -d ' ' -f2)
33
-
34
-if [ -n "$os_version" ]; then
35
-  grep -q -F "networking_pg_version: $os_version" /etc/astute.yaml || echo "networking_pg_version: $os_version" >> /etc/astute.yaml
36
-fi

+ 0
- 68
deployment_scripts/plumgrid_fabric.sh View File

@@ -1,68 +0,0 @@
1
-#
2
-# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-#!/bin/bash
17
-
18
-mkdir -p /var/log/plumgrid
19
-exec > /var/log/plumgrid/plumgrid_fabric.log
20
-exec 2>&1
21
-
22
-set -x
23
-
24
-. /tmp/plumgrid_config
25
-
26
-function check_and_replace() {
27
-  local check_line=$1
28
-  local replace_line=$2
29
-  local file=$3
30
-  grep -q "$check_line" $file
31
-  if [[ $? -ne 0 ]]; then
32
-    sed -i "$ a\\$replace_line" $file
33
-  else
34
-    sed -i "s/$check_line.*/$replace_line/g" $file
35
-  fi
36
-  return 0
37
-}
38
-
39
-fabric_ip=$(ip addr show br-mgmt | awk '$1=="inet" {print $2}' | awk -F '/' '{print $1}' | awk -F '.' '{print $4}' | head -1)
40
-fabric_dev=$(brctl show br-mgmt | awk -F ' ' '{print $4}' | awk 'FNR == 2 {print}' | awk -F '.' '{print $1}')
41
-
42
-# remove the default bridge, if it exists
43
-BRIDGE_AUX=$(brctl show | grep br-aux || true)
44
-
45
-if [[ ! -z "${BRIDGE_AUX}" ]];then
46
-
47
-  brctl delif br-aux $fabric_dev
48
-  ifconfig br-aux down
49
-  brctl delbr br-aux
50
-  rm -f /etc/network/interfaces.d/ifcfg-br-aux
51
-
52
-fi
53
-
54
-fabric_netmask=$(ifconfig br-mgmt | grep Mask | sed s/^.*Mask://)
55
-fabric_net=$(echo $fabric_network | cut -f2 -d: | cut -f1-3 -d.)
56
-
57
-ifconfig $fabric_dev $fabric_net.$fabric_ip netmask $fabric_netmask
58
-ifconfig $fabric_dev mtu 1580
59
-
60
-check_and_replace "iface " "iface $fabric_dev inet static" /etc/network/interfaces.d/ifcfg-$fabric_dev
61
-check_and_replace "address " "address $fabric_net.$fabric_ip" /etc/network/interfaces.d/ifcfg-$fabric_dev
62
-check_and_replace "netmask " "netmask $fabric_netmask" /etc/network/interfaces.d/ifcfg-$fabric_dev
63
-check_and_replace "mtu " "mtu 1580" /etc/network/interfaces.d/ifcfg-$fabric_dev
64
-
65
-sed -i "/bridge_port.*/d" /etc/network/interfaces.d/ifcfg-$fabric_dev
66
-
67
-grep -q -F "fabric_dev: $fabric_dev" /etc/astute.yaml || echo "fabric_dev: $fabric_dev" >> /etc/astute.yaml
68
-

+ 5
- 5
deployment_scripts/post_pg_license.sh View File

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

+ 50
- 41
deployment_scripts/puppet/manifests/director.pp View File

@@ -27,7 +27,6 @@ $plumgrid_vip           = pick($plumgrid_hash['plumgrid_virtual_ip'])
27 27
 $plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
28 28
 $plumgrid_username      = pick($plumgrid_hash['plumgrid_username'])
29 29
 $plumgrid_password      = pick($plumgrid_hash['plumgrid_password'])
30
-$networking_pg_version  = hiera('networking_pg_version', '2015.1.1.1')
31 30
 
32 31
 # PLUMgrid Zone settings
33 32
 $network_metadata       = hiera_hash('network_metadata')
@@ -36,7 +35,7 @@ $controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-c
36 35
 $controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
37 36
 $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
38 37
 $mgmt_net               = hiera('management_network_range')
39
-$fabric_dev             = hiera('fabric_dev')
38
+$fabric_dev             = 'br-100000' 
40 39
 $md_ip                  = pick($plumgrid_hash['plumgrid_opsvm'])
41 40
 
42 41
 # Neutron settings
@@ -72,13 +71,17 @@ class { 'plumgrid':
72 71
   md_ip        => $md_ip,
73 72
   source_net   => $mgmt_net,
74 73
   dest_net     => $mgmt_net,
74
+}->
75
+exec { 'Setup plumgrid-sigmund service':
76
+  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",
77
+  returns => [0, 1],
75 78
 }
76 79
 
77 80
 class { 'sal':
78 81
   plumgrid_ip => $controller_ipaddresses,
79 82
   virtual_ip  => $plumgrid_vip,
80 83
   md_ip       => $md_ip,
81
-  source_net => $mgmt_net,
84
+  source_net  => $mgmt_net,
82 85
 }
83 86
 
84 87
 # Setup Neutron PLUMgrid Configurations
@@ -89,9 +92,9 @@ package { 'neutron-server':
89 92
 }
90 93
 
91 94
 service { 'neutron-server':
92
-  ensure     => 'running',
93
-  name       => 'neutron-server',
94
-  enable     => true,
95
+  ensure  => 'running',
96
+  name    => 'neutron-server',
97
+  enable  => true,
95 98
 }
96 99
 
97 100
 file { '/etc/neutron/neutron.conf':
@@ -100,16 +103,16 @@ file { '/etc/neutron/neutron.conf':
100 103
 }
101 104
 
102 105
 file_line { 'Enable PLUMgrid core plugin':
103
-  path => '/etc/neutron/neutron.conf',
104
-  line => 'core_plugin=neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2',
105
-  match => '^core_plugin.*$',
106
+  path    => '/etc/neutron/neutron.conf',
107
+  line    => 'core_plugin=networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2',
108
+  match   => '^core_plugin.*$',
106 109
   require => File['/etc/neutron/neutron.conf'],
107 110
 }
108 111
 
109 112
 file_line { 'Disable service plugins':
110
-  path => '/etc/neutron/neutron.conf',
111
-  line => 'service_plugins = ""',
112
-  match => '^service_plugins.*$',
113
+  path    => '/etc/neutron/neutron.conf',
114
+  line    => 'service_plugins = ""',
115
+  match   => '^service_plugins.*$',
113 116
   require => File['/etc/neutron/neutron.conf'],
114 117
 }
115 118
 
@@ -119,19 +122,28 @@ file { '/etc/nova/nova.conf':
119 122
 }
120 123
 
121 124
 file_line { 'Set libvirt vif':
122
-  path => '/etc/nova/nova.conf',
123
-  line => 'libvirt_vif_type=ethernet',
124
-  match => '^libvirt_vif_type.*$',
125
+  path    => '/etc/nova/nova.conf',
126
+  line    => 'libvirt_vif_type=ethernet',
127
+  match   => '^libvirt_vif_type.*$',
125 128
   require => File['/etc/nova/nova.conf']
126 129
 }
127 130
 
128 131
 file_line { 'Set libvirt cpu mode':
129
-  path => '/etc/nova/nova.conf',
130
-  line => 'libvirt_cpu_mode=none',
131
-  match => '^libvirt_cpu_mode.*$',
132
+  path    => '/etc/nova/nova.conf',
133
+  line    => 'libvirt_cpu_mode=none',
134
+  match   => '^libvirt_cpu_mode.*$',
132 135
   require => File['/etc/nova/nova.conf']
133 136
 }
134 137
 
138
+# MOS8 uses the outdated PLUMgrid plugin string in the plugin guess function
139
+
140
+file_line { 'Replace plugin name in guess function':
141
+   path     => '/usr/share/neutron-common/plugin_guess_func',
142
+   match    => '"neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2"',
143
+   line     => "\t\"networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2\")",
144
+   multiple => true
145
+}
146
+
135 147
 # Setting PLUMgrid Config Files
136 148
 
137 149
 class { '::neutron::plugins::plumgrid':
@@ -145,35 +157,32 @@ class { '::neutron::plugins::plumgrid':
145 157
   nova_metadata_port           => '8775',
146 158
   metadata_proxy_shared_secret => $metadata_secret,
147 159
   package_ensure               => 'latest',
148
-}->
149
-package { 'networking-plumgrid':
150
-  ensure   => $networking_pg_version,
151
-  provider => 'pip',
152
-  notify   => Service["$::neutron::params::server_service"],
153 160
 }
154 161
 
155
-if ($networking_pg_version != '2015.1.1.1'){
156
-  exec { "plumgrid-db-manage upgrade heads":
157
-    command => "/usr/local/bin/plumgrid-db-manage upgrade heads",
158
-    notify  => Service["$::neutron::params::server_service"],
159
-    require => Package['networking-plumgrid']
160
-  }
161
-}
162
-
163
-# Update PLUMgrid plugin file
164
-
165
-file { 'plumgrid_plugin.py':
166
-  path => '/usr/lib/python2.7/dist-packages/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py',
167
-  ensure => present,
168
-  mode   => '0644',
169
-  source => 'puppet:///modules/plumgrid/plumgrid_plugin.py',
170
-  notify   => Service["$::neutron::params::server_service"]
162
+exec { "neutron-db-manage upgrade heads":
163
+  command => "/usr/bin/neutron-db-manage upgrade heads",
164
+  notify  => Service["$::neutron::params::server_service"],
165
+  require => Package['networking-plumgrid']
171 166
 }
172 167
 
173 168
 # Update PLUMgrid pgrc file
174 169
 
175 170
 file { 'pgrc':
176
-  ensure => present,
177
-  path => '/etc/neutron/plugins/plumgrid/pgrc',
171
+  ensure  => present,
172
+  path    => '/etc/neutron/plugins/plumgrid/pgrc',
178 173
   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",
179 174
 }
175
+
176
+firewall { '990 Add iptables rule for metadata':
177
+  chain  => 'INPUT',
178
+  port   => '8775',
179
+  proto  => 'tcp',
180
+  action => 'accept',
181
+}->
182
+firewall { '991 Add iptables rule for solutions API':
183
+  chain  => 'INPUT',
184
+  port   => '8099',
185
+  state  => ['NEW','ESTABLISHED'],
186
+  proto  => 'tcp',
187
+  action => 'accept',
188
+}

+ 2
- 2
deployment_scripts/puppet/manifests/director_fixes.pp View File

@@ -21,14 +21,14 @@ file { '/etc/apache2/ports.conf':
21 21
 
22 22
 file_line { 'ensure no port conflict between apache and keystone':
23 23
   path    => '/etc/apache2/ports.conf',
24
-  line   => 'NameVirtualHost *:35357',
24
+  line    => 'NameVirtualHost *:35357',
25 25
   ensure  => 'absent',
26 26
   require => File['/etc/apache2/ports.conf']
27 27
 }
28 28
 
29 29
 file_line { 'ensure no port conflict between apache-keystone':
30 30
   path    => '/etc/apache2/ports.conf',
31
-  line   => 'NameVirtualHost *:5000',
31
+  line    => 'NameVirtualHost *:5000',
32 32
   ensure  => 'absent',
33 33
   require => File['/etc/apache2/ports.conf']
34 34
 }

+ 40
- 19
deployment_scripts/puppet/manifests/edge.pp View File

@@ -18,6 +18,9 @@ notice('MODULAR: plumgrid/edge.pp')
18 18
 # Metadata settings
19 19
 $metadata_hash     = hiera_hash('quantum_settings', {})
20 20
 $metadata_secret   = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
21
+$nova_hash         = hiera_hash('nova', {})
22
+$nova_sql_password = pick($nova_hash['db_password'])
23
+$mgmt_vip          = hiera('management_vip')
21 24
 
22 25
 # PLUMgrid settings
23 26
 $plumgrid_hash     = hiera_hash('plumgrid', {})
@@ -30,7 +33,7 @@ $controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-c
30 33
 $controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
31 34
 $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
32 35
 $mgmt_net               = hiera('management_network_range')
33
-$fabric_dev             = hiera('fabric_dev')
36
+$fabric_dev             = 'br-100000' 
34 37
 $plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
35 38
 $md_ip                  = pick($plumgrid_hash['plumgrid_opsvm'])
36 39
 
@@ -42,6 +45,10 @@ class { 'plumgrid':
42 45
   md_ip       => $md_ip,
43 46
   source_net  => $mgmt_net,
44 47
   dest_net    => $mgmt_net,
48
+}->
49
+exec { 'Setup plumgrid-sigmund service':
50
+  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",
51
+  returns => [0, 1],
45 52
 }
46 53
 
47 54
 package { 'nova-api':
@@ -60,31 +67,38 @@ file { '/etc/nova/nova.conf':
60 67
 }
61 68
 
62 69
 file_line { 'Set libvirt vif':
63
-  path => '/etc/nova/nova.conf',
64
-  line => 'libvirt_vif_type=ethernet',
65
-  match => '^libvirt_vif_type.*$',
70
+  path    => '/etc/nova/nova.conf',
71
+  line    => 'libvirt_vif_type=ethernet',
72
+  match   => '^libvirt_vif_type.*$',
66 73
   require => File['/etc/nova/nova.conf']
67 74
 }
68 75
 
69 76
 file_line { 'Set libvirt cpu mode':
70
-  path => '/etc/nova/nova.conf',
71
-  line => 'libvirt_cpu_mode=none',
72
-  match => '^libvirt_cpu_mode.*$',
77
+  path    => '/etc/nova/nova.conf',
78
+  line    => 'libvirt_cpu_mode=none',
79
+  match   => '^libvirt_cpu_mode.*$',
73 80
   require => File['/etc/nova/nova.conf']
74 81
 }
75 82
 
76 83
 # Enabling Metadata on Computes
77 84
 file_line { 'Enable Metadata Proxy':
78
-  path => '/etc/nova/nova.conf',
79
-  line => 'service_metadata_proxy=True',
80
-  match => '^#service_metadata_proxy=false',
85
+  path    => '/etc/nova/nova.conf',
86
+  line    => 'service_metadata_proxy=True',
87
+  match   => '^#service_metadata_proxy=false',
81 88
   require => File['/etc/nova/nova.conf']
82 89
 }
83 90
 
84 91
 file_line { 'Set Metadata Shared Secret':
85
-  path => '/etc/nova/nova.conf',
86
-  line => "metadata_proxy_shared_secret=$metadata_secret",
87
-  match => '^#metadata_proxy_shared_secret=',
92
+  path    => '/etc/nova/nova.conf',
93
+  line    => "metadata_proxy_shared_secret=$metadata_secret",
94
+  match   => '^#metadata_proxy_shared_secret=',
95
+  require => File['/etc/nova/nova.conf']
96
+}
97
+
98
+file_line { 'Copy nova sql url on computes':
99
+  path    => '/etc/nova/nova.conf',
100
+  line    => "connection = mysql://nova:$nova_sql_password@$mgmt_vip/nova?read_timeout=60",
101
+  after   => '^#connection = <None>',
88 102
   require => File['/etc/nova/nova.conf']
89 103
 }
90 104
 
@@ -98,14 +112,14 @@ service { 'nova-api':
98 112
   ensure  => running,
99 113
   name    => 'nova-api',
100 114
   require => Package['nova-api'],
101
-  enable => true,
115
+  enable  => true,
102 116
 }
103 117
 
104 118
 service { 'nova-compute':
105
-  ensure => running,
106
-  name   => 'nova-compute',
119
+  ensure  => running,
120
+  name    => 'nova-compute',
107 121
   require => Package['nova-compute'],
108
-  enable => true,
122
+  enable  => true,
109 123
 }
110 124
 
111 125
 file { '/etc/libvirt/qemu.conf':
@@ -114,8 +128,8 @@ file { '/etc/libvirt/qemu.conf':
114 128
 }
115 129
 
116 130
 file_line { 'Libvirt QEMU settings':
117
-  path => '/etc/libvirt/qemu.conf',
118
-  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"]',
131
+  path    => '/etc/libvirt/qemu.conf',
132
+  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"]',
119 133
   require => File['/etc/libvirt/qemu.conf'],
120 134
 }
121 135
 
@@ -156,3 +170,10 @@ file_line { 'unmount plumgrid.fuse pre-start':
156 170
   after   => '/opt/pg/scripts/systemd_pre_start.sh',
157 171
   require => Package[$plumgrid::params::plumgrid_package]
158 172
 }
173
+
174
+firewall { '990 Add iptables rule for metadata':
175
+  chain  => 'INPUT',
176
+  port   => '8775',
177
+  proto  => 'tcp',
178
+  action => 'accept',
179
+}

+ 5
- 1
deployment_scripts/puppet/manifests/gateway.pp View File

@@ -25,7 +25,7 @@ $controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-c
25 25
 $controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
26 26
 $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
27 27
 $mgmt_net               = hiera('management_network_range')
28
-$fabric_dev             = hiera('fabric_dev')
28
+$fabric_dev             = 'br-100000' 
29 29
 $plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
30 30
 $md_ip                  = pick($plumgrid_hash['plumgrid_opsvm'])
31 31
 
@@ -38,6 +38,10 @@ class { 'plumgrid':
38 38
   md_ip        => $md_ip,
39 39
   source_net   => $mgmt_net,
40 40
   dest_net     => $mgmt_net,
41
+}->
42
+exec { 'Setup plumgrid-sigmund service':
43
+  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",
44
+  returns => [0, 1],
41 45
 }
42 46
 
43 47
 package { 'iptables-persistent':

+ 29
- 13
deployment_scripts/puppet/manifests/pg_common.pp View File

@@ -15,24 +15,34 @@
15 15
 
16 16
 notice('MODULAR: plumgrid/pre_node.pp')
17 17
 
18
-$fuel_hash = hiera_hash('public_ssl', {})
19
-$fuel_hostname = pick($fuel_hash['hostname'])
18
+$fuel_hash              = hiera_hash('public_ssl', {})
19
+$fuel_hostname          = pick($fuel_hash['hostname'])
20 20
 
21
-$metadata_hash = hiera_hash('quantum_settings', {})
22
-$metadata = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
21
+$metadata_hash          = hiera_hash('quantum_settings', {})
22
+$metadata               = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
23 23
 
24 24
 $plumgrid_hash = hiera_hash('plumgrid', {})
25
-$plumgrid_pkg_repo = pick($plumgrid_hash['plumgrid_package_repo'])
26
-$plumgrid_lic = pick($plumgrid_hash['plumgrid_license'])
27
-$plumgrid_vip = pick($plumgrid_hash['plumgrid_virtual_ip'])
28
-$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
29
-$fabric_network = pick($plumgrid_hash['plumgrid_fabric_network'])
25
+$plumgrid_username      = pick($plumgrid_hash['plumgrid_username'])
26
+$plumgrid_password      = pick($plumgrid_hash['plumgrid_password'])
27
+$plumgrid_pkg_repo      = pick($plumgrid_hash['plumgrid_package_repo'])
28
+$plumgrid_lic           = pick($plumgrid_hash['plumgrid_license'])
29
+$plumgrid_vip           = pick($plumgrid_hash['plumgrid_virtual_ip'])
30
+$plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
31
+$fabric_network         = pick($plumgrid_hash['plumgrid_fabric_network'])
32
+$opsvm_ip               = pick($plumgrid_hash['plumgrid_opsvm'])
33
+$fuel_version           = hiera('fuel_version')
30 34
 
31
-$network_metadata = hiera_hash('network_metadata')
32
-$haproxy_vip = pick($network_metadata['vips']['public']['ipaddr'])
33
-$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
35
+$network_metadata       = hiera_hash('network_metadata')
36
+$haproxy_vip            = pick($network_metadata['vips']['public']['ipaddr'])
37
+$controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
34 38
 $controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
35 39
 $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
40
+$compute_nodes          = get_nodes_hash_by_roles($network_metadata, ['compute'])
41
+$compute_address_map    = get_node_to_ipaddr_map_by_network_role($compute_nodes, 'mgmt/vip')
42
+$compute_ipaddresses    = join(hiera_array('compute_ipaddresses', values($compute_address_map)), ',')
43
+$gateway_nodes          = get_nodes_hash_by_roles($network_metadata, ['PLUMgrid-Gateway'])
44
+$gateway_address_map    = get_node_to_ipaddr_map_by_network_role($gateway_nodes, 'mgmt/vip')
45
+$gateway_ipaddresses    = join(hiera_array('gateway_ipaddresses', values($gateway_address_map)), ',')
36 46
 
37 47
 $pg_packages = [ 'python-pip', 'apparmor-utils' ]
38 48
 
@@ -54,7 +64,7 @@ exec { "apt-get update":
54 64
 
55 65
 file { '/tmp/plumgrid_config':
56 66
   ensure  => file,
57
-  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",
67
+  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",
58 68
 }
59 69
 
60 70
 exec { 'ovs_rmmod':
@@ -63,6 +73,12 @@ exec { 'ovs_rmmod':
63 73
   onlyif  => 'lsmod | /bin/grep openvswitch'
64 74
 }
65 75
 
76
+exec { 'openvswitch-switch_forceremove':
77
+  command => 'dpkg -r --force-all openvswitch-switch',
78
+  path    => '/usr/bin',
79
+  onlyif  => 'dpkg -l | /bin/grep openvswitch-switch'
80
+}
81
+
66 82
 package { 'openvswitch-*':
67 83
   ensure => absent
68 84
 }

+ 9
- 1
deployment_scripts/puppet/manifests/pre_deployment.pp View File

@@ -23,5 +23,13 @@ package { 'libvirt-bin' :
23 23
 }
24 24
 package { 'networking-plumgrid':
25 25
   ensure   => 'absent',
26
-  provider => 'pip',
26
+}
27
+
28
+# MOS8 was tagged with the older version of puppet neutron which contains outdated PLUMgrid plugin name 
29
+
30
+file_line { 'Replace outdated plugin package name in puppet neutron':
31
+   path     => '/etc/puppet/modules/neutron/manifests/params.pp',
32
+   line     => "    \$plumgrid_plugin_package    = \'networking-plumgrid\'",
33
+   match    => "plumgrid_plugin_package",
34
+   multiple => true
27 35
 }

+ 43
- 0
deployment_scripts/solution_api.sh View File

@@ -0,0 +1,43 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+#!/bin/bash
17
+
18
+mkdir -p /var/log/plumgrid
19
+exec > /var/log/plumgrid/solution_api.log
20
+exec 2>&1
21
+
22
+set -x
23
+
24
+. /tmp/plumgrid_config
25
+
26
+# Get required additional parameters
27
+kernel_version=$(uname -r)
28
+hypervisor_type=$(echo $(lsb_release -i) | cut -d' ' -f3)
29
+hypervisor_version=$(echo $(lsb_release -r) | cut -d' ' -f2)
30
+plumgrid_version=$(dpkg -l | awk '$2=="plumgrid-lxc" { print $3 }' | cut -d'-' -f1 )
31
+
32
+# Get version of cloudApex
33
+if [ -d /var/lib/libvirt/filesystems/plumgrid/opt/pg/web/cloudApex/modules/appCloudApex/ ]; then
34
+  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)
35
+else
36
+  cloudapex_version="0.0"
37
+fi
38
+
39
+# Push all IPs info to Solution API server
40
+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
41
+
42
+# Push zone info to Solution API server
43
+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

+ 14
- 23
deployment_tasks.yaml View File

@@ -30,36 +30,18 @@
30 30
 
31 31
 - id: pg_common
32 32
   role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
33
-  required_for: [post_deployment_end, pg_fabric]
34
-  requires: [post_deployment_start, check-pgzone]
33
+  required_for: [post_deployment_end, setup-director]
34
+  requires: [post_deployment_start, check-pgzone, configure_default_route]
35 35
   type: puppet
36 36
   parameters:
37 37
     puppet_manifest: puppet/manifests/pg_common.pp
38 38
     puppet_modules: puppet/modules:/etc/puppet/modules
39 39
     timeout: 3000
40 40
 
41
-- id: pg_os_version
42
-  role: ['controller', 'primary-controller']
43
-  required_for: [post_deployment_end, setup-director]
44
-  requires: [post_deployment_start, pg_common]
45
-  type: shell
46
-  parameters:
47
-    cmd: bash pg_os_version.sh
48
-    timeout: 3000
49
-
50
-- id: pg_fabric
51
-  role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
52
-  required_for: [post_deployment_end, setup-director]
53
-  requires: [post_deployment_start, pg_common]
54
-  type: shell
55
-  parameters:
56
-    cmd: bash plumgrid_fabric.sh
57
-    timeout: 3000
58
-
59 41
 - id: setup-director
60 42
   role: ['controller', 'primary-controller']
61 43
   required_for: [post_deployment_end, director-fixes]
62
-  requires: [post_deployment_start, pg_os_version, pg_fabric]
44
+  requires: [post_deployment_start, pg_common]
63 45
   type: puppet
64 46
   parameters:
65 47
     puppet_manifest: puppet/manifests/director.pp
@@ -78,17 +60,26 @@
78 60
 
79 61
 - id: post_pg_license
80 62
   role: ['primary-controller']
81
-  required_for: [post_deployment_end, setup-edge]
63
+  required_for: [post_deployment_end, solution-api]
82 64
   requires: [post_deployment_start, director-fixes]
83 65
   type: shell
84 66
   parameters:
85 67
     cmd: bash post_pg_license.sh
86 68
     timeout: 3000
87 69
 
70
+- id: solution-api
71
+  role: ['primary-controller']
72
+  required_for: [post_deployment_end, setup-edge]
73
+  requires: [post_deployment_start, post_pg_license]
74
+  type: shell
75
+  parameters:
76
+    cmd: bash solution_api.sh
77
+    timeout: 3000
78
+
88 79
 - id: setup-edge
89 80
   role: ['compute']
90 81
   required_for: [post_deployment_end, setup-gateway]
91
-  requires: [post_deployment_start, post_pg_license]
82
+  requires: [post_deployment_start, solution-api]
92 83
   type: puppet
93 84
   parameters:
94 85
     puppet_manifest: puppet/manifests/edge.pp

+ 1
- 0
environment_config.yaml View File

@@ -3,6 +3,7 @@ attributes:
3 3
     restrictions:
4 4
       - condition: "not (cluster:net_provider == 'neutron' and networking_parameters:segmentation_type == 'vlan')"
5 5
         message: "Please use Neutron with VLAN segmentation, the only network type supported with PLUMgrid plugin."
6
+    group: 'other'
6 7
   plumgrid_username:
7 8
     value: "plumgrid"
8 9
     label: "Enter the username for PLUMgrid"

+ 3
- 3
metadata.yaml View File

@@ -3,11 +3,11 @@ name: plumgrid
3 3
 # Human-readable name for your plugin
4 4
 title: PLUMgrid plugin
5 5
 # Plugin version
6
-version: '1.1.0'
6
+version: '2.0.0'
7 7
 # Description
8 8
 description: This plugin enables the usage of PLUMgrid ONS as the network backend.
9 9
 # Required fuel version
10
-fuel_version: ['7.0']
10
+fuel_version: ['8.0']
11 11
 # Specify license of your plugin
12 12
 licenses: ['Apache License Version 2.0']
13 13
 authors: ['javeriak@plumgrid.com', 'abdullah.khan@plumgrid.com']
@@ -17,7 +17,7 @@ groups: ['network']
17 17
 # The plugin is compatible with releases in the list
18 18
 releases:
19 19
   - os: ubuntu
20
-    version: 2015.1.0-7.0
20
+    version: liberty-8.0
21 21
     mode: ['ha', 'multinode']
22 22
     deployment_scripts_path: deployment_scripts/
23 23
     repository_path: repositories/ubuntu

+ 1
- 1
network_roles.yaml View File

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

Loading…
Cancel
Save