Browse Source

Disable OVS related task to support scale in/out in MOS8

  - Override hiera files to disable ovs
  - Replace compute task
  - Skip OVS related tasks

Change-Id: I6ed8b7a56f3512dfae9321058970d211269e1a6f
Signed-off-by: Muhammad Shahzeb <mshahzeb@plumgrid.com>
(cherry picked from commit 7ae49381f3)
changes/64/357164/9
Muhammad Shahzeb 2 years ago
parent
commit
49c87408db

+ 0
- 45
deployment_scripts/cleanup_os.sh View File

@@ -1,45 +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/cleanup_os.log
20
-exec 2>&1
21
-
22
-set -x
23
-
24
-if [[ ! -f "/root/cleanup_os" ]];then
25
-  source /root/openrc
26
-  router_id=`neutron router-list | grep "network_id" | awk '{print $2}'`
27
-  neutron router-gateway-clear $router_id
28
-  subnet_id=`neutron router-port-list $router_id | grep "subnet_id" | awk '{print $8}' | awk -F '\"' '{print $2}'`
29
-  neutron router-interface-delete $router_id $subnet_id
30
-  neutron router-delete $router_id
31
-  neutron subnet-delete $subnet_id
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
41
-  touch /root/cleanup_os
42
-
43
-else
44
-  echo "Cleanup already preformed before, skipping."
45
-fi

+ 36
- 0
deployment_scripts/puppet/manifests/disable_openvswitch.pp View File

@@ -0,0 +1,36 @@
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
+notice('MODULAR: plumgrid/disable_ovs.pp')
17
+
18
+file_line { 'Disable ovs in globals.yaml':
19
+  path     => '/etc/hiera/globals.yaml',
20
+  line     => '  use_ovs: false',
21
+  match    => 'use_ovs',
22
+}
23
+
24
+file_line { 'Replace provider ovs with lnx':
25
+  path     => '/etc/astute.yaml',
26
+  line     => '    provider: lnx',
27
+  match    => '    provider: ovs',
28
+  multiple => true,
29
+}
30
+
31
+file_line { 'Replace provider ovs with lnx in globals.yaml':
32
+  path     => '/etc/hiera/globals.yaml',
33
+  line     => '        provider: lnx',
34
+  match    => '        provider: ovs',
35
+  multiple => true,
36
+}

+ 0
- 16
deployment_scripts/puppet/manifests/pg_common.pp View File

@@ -67,22 +67,6 @@ file { '/tmp/plumgrid_config':
67 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",
68 68
 }
69 69
 
70
-exec { 'ovs_rmmod':
71
-  command => 'rmmod openvswitch',
72
-  path    => '/sbin',
73
-  onlyif  => 'lsmod | /bin/grep openvswitch'
74
-}
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
-
82
-package { 'openvswitch-*':
83
-  ensure => absent
84
-}
85
-
86 70
 file { ['/var/lib/plumgrid', '/var/lib/plumgrid/zones', "/var/lib/plumgrid/zones/$plumgrid_zone"]:
87 71
   ensure  =>  directory,
88 72
   mode    =>  0755,

+ 131
- 0
deployment_scripts/puppet/manifests/plumgrid_nova_compute.pp View File

@@ -0,0 +1,131 @@
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
+notice('MODULAR: neutron-compute-nova.pp')
17
+
18
+$network_scheme = hiera_hash('network_scheme', {})
19
+prepare_network_config($network_scheme)
20
+
21
+$use_neutron = hiera('use_neutron', false)
22
+
23
+include nova::params
24
+$neutron_config             = hiera_hash('neutron_config', {})
25
+$neutron_integration_bridge = 'br-int'
26
+$nova_hash                  = hiera_hash('nova', {})
27
+$libvirt_vif_driver         = pick($nova_hash['libvirt_vif_driver'], 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver')
28
+
29
+$management_vip             = hiera('management_vip')
30
+$service_endpoint           = hiera('service_endpoint', $management_vip)
31
+$admin_password             = try_get_value($neutron_config, 'keystone/admin_password')
32
+$admin_tenant_name          = try_get_value($neutron_config, 'keystone/admin_tenant', 'services')
33
+$admin_username             = try_get_value($neutron_config, 'keystone/admin_user', 'neutron')
34
+$region_name                = hiera('region', 'RegionOne')
35
+$auth_api_version           = 'v2.0'
36
+$ssl_hash                   = hiera_hash('use_ssl', {})
37
+
38
+$admin_identity_protocol    = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
39
+$admin_identity_address     = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [$service_endpoint, $management_vip])
40
+
41
+$neutron_internal_protocol  = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http')
42
+$neutron_endpoint           = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', [hiera('neutron_endpoint', ''), $management_vip])
43
+
44
+$admin_identity_uri         = "${admin_identity_protocol}://${admin_identity_address}:35357"
45
+$admin_auth_url             = "${admin_identity_uri}/${auth_api_version}"
46
+$neutron_url                = "${neutron_internal_protocol}://${neutron_endpoint}:9696"
47
+
48
+$nova_migration_ip          =  get_network_role_property('nova/migration', 'ipaddr')
49
+
50
+service { 'libvirt' :
51
+  ensure   => 'running',
52
+  enable   => true,
53
+  # Workaround for bug LP #1469308
54
+  # also service name for Ubuntu and Centos is the same.
55
+  name     => 'libvirtd',
56
+  provider => $nova::params::special_service_provider,
57
+}
58
+
59
+exec { 'destroy_libvirt_default_network':
60
+  command => 'virsh net-destroy default',
61
+  onlyif  => 'virsh net-info default | grep -qE "Active:.* yes"',
62
+  path    => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
63
+  tries   => 3,
64
+  require => Service['libvirt'],
65
+}
66
+
67
+exec { 'undefine_libvirt_default_network':
68
+  command => 'virsh net-undefine default',
69
+  onlyif  => 'virsh net-info default 2>&1 > /dev/null',
70
+  path    => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
71
+  tries   => 3,
72
+  require => Exec['destroy_libvirt_default_network'],
73
+}
74
+
75
+Service['libvirt'] ~> Exec['destroy_libvirt_default_network']
76
+
77
+# script called by qemu needs to manipulate the tap device
78
+file_line { 'clear_emulator_capabilities':
79
+  path    => '/etc/libvirt/qemu.conf',
80
+  line    => 'clear_emulator_capabilities = 0',
81
+  notify  => Service['libvirt']
82
+}
83
+
84
+class { 'nova::compute::neutron':
85
+  libvirt_vif_driver => $libvirt_vif_driver,
86
+}
87
+
88
+nova_config {
89
+  'DEFAULT/linuxnet_interface_driver':       value => 'nova.network.linux_net.LinuxOVSInterfaceDriver';
90
+  'DEFAULT/linuxnet_ovs_integration_bridge': value => $neutron_integration_bridge;
91
+  'DEFAULT/network_device_mtu':              value => '65000';
92
+  'DEFAULT/my_ip':                           value => $nova_migration_ip;
93
+}
94
+
95
+class { 'nova::network::neutron' :
96
+  neutron_admin_password    => $admin_password,
97
+  neutron_admin_tenant_name => $admin_tenant_name,
98
+  neutron_region_name       => $region_name,
99
+  neutron_admin_username    => $admin_username,
100
+  neutron_admin_auth_url    => $admin_auth_url,
101
+  neutron_url               => $neutron_url,
102
+  neutron_ovs_bridge        => $neutron_integration_bridge,
103
+}
104
+
105
+augeas { 'sysctl-net.bridge.bridge-nf-call-arptables':
106
+  context => '/files/etc/sysctl.conf',
107
+  changes => "set net.bridge.bridge-nf-call-arptables '1'",
108
+  before  => Service['libvirt'],
109
+}
110
+augeas { 'sysctl-net.bridge.bridge-nf-call-iptables':
111
+  context => '/files/etc/sysctl.conf',
112
+  changes => "set net.bridge.bridge-nf-call-iptables '1'",
113
+  before  => Service['libvirt'],
114
+}
115
+augeas { 'sysctl-net.bridge.bridge-nf-call-ip6tables':
116
+  context => '/files/etc/sysctl.conf',
117
+  changes => "set net.bridge.bridge-nf-call-ip6tables '1'",
118
+  before  => Service['libvirt'],
119
+}
120
+
121
+service { 'nova-compute':
122
+  ensure => 'running',
123
+  name   => $::nova::params::compute_service_name,
124
+}
125
+Nova_config<| |> ~> Service['nova-compute']
126
+
127
+if($::operatingsystem == 'Ubuntu') {
128
+  tweaks::ubuntu_service_override { 'nova-network':
129
+    package_name => 'nova-network',
130
+  }
131
+}

+ 53
- 10
deployment_tasks.yaml View File

@@ -8,6 +8,58 @@
8 8
     strategy:
9 9
       type: parallel
10 10
 
11
+# Skip default neutron plugins
12
+- id: primary-openstack-network-plugins-l2
13
+  type: skipped
14
+- id: openstack-network-plugins-l2
15
+  type: skipped
16
+- id: openstack-network-routers-ha
17
+  type: skipped
18
+- id: openstack-network-compute-nova
19
+  type: skipped
20
+# Skip Neutron agents
21
+- id: primary-openstack-network-agents-l3
22
+  type: skipped
23
+- id: openstack-network-agents-l3
24
+  type: skipped
25
+- id: primary-openstack-network-agents-dhcp
26
+  type: skipped
27
+- id: openstack-network-agents-dhcp
28
+  type: skipped
29
+- id: primary-openstack-network-agents-metadata
30
+  type: skipped
31
+- id: openstack-network-agents-metadata
32
+  type: skipped
33
+- id: openstack-network-agents-sriov
34
+  type: skipped
35
+# Skip default fuel networks and routers
36
+- id: openstack-network-networks
37
+  type: skipped
38
+- id: openstack-network-routers
39
+  type: skipped
40
+
41
+- id: disable-openvswitch
42
+  groups: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
43
+  required_for: [netconfig, deploy_end]
44
+  requires: [deploy_start, globals]
45
+  type: puppet
46
+  reexecute_on:
47
+  - deploy_changes
48
+  parameters:
49
+    puppet_manifest: puppet/manifests/disable_openvswitch.pp
50
+    puppet_modules: puppet/modules:/etc/puppet/modules
51
+    timeout: 120
52
+
53
+- id: openstack-network-plumgrid-compute-nova
54
+  groups: ['compute']
55
+  required_for: [openstack-network-end]
56
+  requires: [openstack-network-common-config]
57
+  type: puppet
58
+  parameters:
59
+    puppet_manifest: puppet/manifests/plumgrid_nova_compute.pp
60
+    puppet_modules: puppet/modules/:/etc/puppet/modules/
61
+    timeout: 1440
62
+
11 63
 - id: pgtools-support
12 64
   role: ['controller', 'primary-controller']
13 65
   required_for: [post_deployment_end]
@@ -88,19 +140,10 @@
88 140
 
89 141
 - id: setup-gateway
90 142
   role: ['PLUMgrid-Gateway']
91
-  required_for: [post_deployment_end, cleanup_os]
143
+  required_for: [post_deployment_end]
92 144
   requires: [post_deployment_start, setup-edge]
93 145
   type: puppet
94 146
   parameters:
95 147
     puppet_manifest: puppet/manifests/gateway.pp
96 148
     puppet_modules: puppet/modules:/etc/puppet/modules
97 149
     timeout: 3000
98
-
99
-- id: cleanup_os
100
-  role: ['primary-controller']
101
-  required_for: [post_deployment_end]
102
-  requires: [post_deployment_start, setup-gateway]
103
-  type: shell
104
-  parameters:
105
-    cmd: bash cleanup_os.sh
106
-    timeout: 3000

Loading…
Cancel
Save