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)
This commit is contained in:
Muhammad Shahzeb 2016-08-17 00:51:29 -07:00
parent aa417e80fd
commit 49c87408db
5 changed files with 220 additions and 71 deletions

View File

@ -1,45 +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/cleanup_os.log
exec 2>&1
set -x
if [[ ! -f "/root/cleanup_os" ]];then
source /root/openrc
router_id=`neutron router-list | grep "network_id" | awk '{print $2}'`
neutron router-gateway-clear $router_id
subnet_id=`neutron router-port-list $router_id | grep "subnet_id" | awk '{print $8}' | awk -F '\"' '{print $2}'`
neutron router-interface-delete $router_id $subnet_id
neutron router-delete $router_id
neutron subnet-delete $subnet_id
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
echo "Cleanup already preformed before, skipping."
fi

View File

@ -0,0 +1,36 @@
#
# 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.
notice('MODULAR: plumgrid/disable_ovs.pp')
file_line { 'Disable ovs in globals.yaml':
path => '/etc/hiera/globals.yaml',
line => ' use_ovs: false',
match => 'use_ovs',
}
file_line { 'Replace provider ovs with lnx':
path => '/etc/astute.yaml',
line => ' provider: lnx',
match => ' provider: ovs',
multiple => true,
}
file_line { 'Replace provider ovs with lnx in globals.yaml':
path => '/etc/hiera/globals.yaml',
line => ' provider: lnx',
match => ' provider: ovs',
multiple => true,
}

View File

@ -67,22 +67,6 @@ file { '/tmp/plumgrid_config':
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':
command => 'rmmod openvswitch',
path => '/sbin',
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
}
file { ['/var/lib/plumgrid', '/var/lib/plumgrid/zones', "/var/lib/plumgrid/zones/$plumgrid_zone"]:
ensure => directory,
mode => 0755,

View File

@ -0,0 +1,131 @@
#
# 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.
notice('MODULAR: neutron-compute-nova.pp')
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$use_neutron = hiera('use_neutron', false)
include nova::params
$neutron_config = hiera_hash('neutron_config', {})
$neutron_integration_bridge = 'br-int'
$nova_hash = hiera_hash('nova', {})
$libvirt_vif_driver = pick($nova_hash['libvirt_vif_driver'], 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver')
$management_vip = hiera('management_vip')
$service_endpoint = hiera('service_endpoint', $management_vip)
$admin_password = try_get_value($neutron_config, 'keystone/admin_password')
$admin_tenant_name = try_get_value($neutron_config, 'keystone/admin_tenant', 'services')
$admin_username = try_get_value($neutron_config, 'keystone/admin_user', 'neutron')
$region_name = hiera('region', 'RegionOne')
$auth_api_version = 'v2.0'
$ssl_hash = hiera_hash('use_ssl', {})
$admin_identity_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
$admin_identity_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [$service_endpoint, $management_vip])
$neutron_internal_protocol = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http')
$neutron_endpoint = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', [hiera('neutron_endpoint', ''), $management_vip])
$admin_identity_uri = "${admin_identity_protocol}://${admin_identity_address}:35357"
$admin_auth_url = "${admin_identity_uri}/${auth_api_version}"
$neutron_url = "${neutron_internal_protocol}://${neutron_endpoint}:9696"
$nova_migration_ip = get_network_role_property('nova/migration', 'ipaddr')
service { 'libvirt' :
ensure => 'running',
enable => true,
# Workaround for bug LP #1469308
# also service name for Ubuntu and Centos is the same.
name => 'libvirtd',
provider => $nova::params::special_service_provider,
}
exec { 'destroy_libvirt_default_network':
command => 'virsh net-destroy default',
onlyif => 'virsh net-info default | grep -qE "Active:.* yes"',
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
tries => 3,
require => Service['libvirt'],
}
exec { 'undefine_libvirt_default_network':
command => 'virsh net-undefine default',
onlyif => 'virsh net-info default 2>&1 > /dev/null',
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
tries => 3,
require => Exec['destroy_libvirt_default_network'],
}
Service['libvirt'] ~> Exec['destroy_libvirt_default_network']
# script called by qemu needs to manipulate the tap device
file_line { 'clear_emulator_capabilities':
path => '/etc/libvirt/qemu.conf',
line => 'clear_emulator_capabilities = 0',
notify => Service['libvirt']
}
class { 'nova::compute::neutron':
libvirt_vif_driver => $libvirt_vif_driver,
}
nova_config {
'DEFAULT/linuxnet_interface_driver': value => 'nova.network.linux_net.LinuxOVSInterfaceDriver';
'DEFAULT/linuxnet_ovs_integration_bridge': value => $neutron_integration_bridge;
'DEFAULT/network_device_mtu': value => '65000';
'DEFAULT/my_ip': value => $nova_migration_ip;
}
class { 'nova::network::neutron' :
neutron_admin_password => $admin_password,
neutron_admin_tenant_name => $admin_tenant_name,
neutron_region_name => $region_name,
neutron_admin_username => $admin_username,
neutron_admin_auth_url => $admin_auth_url,
neutron_url => $neutron_url,
neutron_ovs_bridge => $neutron_integration_bridge,
}
augeas { 'sysctl-net.bridge.bridge-nf-call-arptables':
context => '/files/etc/sysctl.conf',
changes => "set net.bridge.bridge-nf-call-arptables '1'",
before => Service['libvirt'],
}
augeas { 'sysctl-net.bridge.bridge-nf-call-iptables':
context => '/files/etc/sysctl.conf',
changes => "set net.bridge.bridge-nf-call-iptables '1'",
before => Service['libvirt'],
}
augeas { 'sysctl-net.bridge.bridge-nf-call-ip6tables':
context => '/files/etc/sysctl.conf',
changes => "set net.bridge.bridge-nf-call-ip6tables '1'",
before => Service['libvirt'],
}
service { 'nova-compute':
ensure => 'running',
name => $::nova::params::compute_service_name,
}
Nova_config<| |> ~> Service['nova-compute']
if($::operatingsystem == 'Ubuntu') {
tweaks::ubuntu_service_override { 'nova-network':
package_name => 'nova-network',
}
}

View File

@ -8,6 +8,58 @@
strategy:
type: parallel
# Skip default neutron plugins
- id: primary-openstack-network-plugins-l2
type: skipped
- id: openstack-network-plugins-l2
type: skipped
- id: openstack-network-routers-ha
type: skipped
- id: openstack-network-compute-nova
type: skipped
# Skip 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
- id: openstack-network-agents-sriov
type: skipped
# Skip default fuel networks and routers
- id: openstack-network-networks
type: skipped
- id: openstack-network-routers
type: skipped
- id: disable-openvswitch
groups: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
required_for: [netconfig, deploy_end]
requires: [deploy_start, globals]
type: puppet
reexecute_on:
- deploy_changes
parameters:
puppet_manifest: puppet/manifests/disable_openvswitch.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
- id: openstack-network-plumgrid-compute-nova
groups: ['compute']
required_for: [openstack-network-end]
requires: [openstack-network-common-config]
type: puppet
parameters:
puppet_manifest: puppet/manifests/plumgrid_nova_compute.pp
puppet_modules: puppet/modules/:/etc/puppet/modules/
timeout: 1440
- id: pgtools-support
role: ['controller', 'primary-controller']
required_for: [post_deployment_end]
@ -88,19 +140,10 @@
- id: setup-gateway
role: ['PLUMgrid-Gateway']
required_for: [post_deployment_end, cleanup_os]
required_for: [post_deployment_end]
requires: [post_deployment_start, setup-edge]
type: puppet
parameters:
puppet_manifest: puppet/manifests/gateway.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3000
- id: cleanup_os
role: ['primary-controller']
required_for: [post_deployment_end]
requires: [post_deployment_start, setup-gateway]
type: shell
parameters:
cmd: bash cleanup_os.sh
timeout: 3000