Change plugin to support 9.2

There is few changes in the MOS 9.2. So plugin should be changed too.

Change-Id: I7080934a164c2abf5b71b18d0fbda52f5d46b552
Closes-bug: #1644861
This commit is contained in:
Igor Gajsin 2016-12-08 18:05:08 +03:00
parent 5a936abd65
commit 0e54ab7b1b
4 changed files with 27 additions and 51 deletions

View File

@ -101,20 +101,6 @@ define vmware_dvs::agent(
$fw_driver = 'networking_vsphere.agent.firewalls.noop_firewall.NoopvCenterFirewallDriver'
}
if ! defined(File["${py_root}/nova.patch"]) {
file {"${py_root}/nova.patch":
source => 'puppet:///modules/vmware_dvs/nova.patch',
notify => Exec['apply-nova-patch'],
}
}
if ! defined(Exec['apply-nova-patch']) {
exec {'apply-nova-patch':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => "patch -d ${py_root} -N -p1 < ${py_root}/nova.patch",
refreshonly => true,
}
}
if ! empty($vcenter_ca_content) and ! $vsphere_insecure {
$agent_vcenter_ca_filepath = $vcenter_ca_filepath
$agent_vcenter_insecure_real = false

View File

@ -2,26 +2,17 @@ class vmware_dvs::l2 {
$use_neutron = hiera('use_neutron', false)
if $use_neutron {
# override neutron options
$override_configuration = hiera_hash('configuration', {})
override_resources { 'neutron_agent_ovs':
data => $override_configuration['neutron_agent_ovs']
} ~> Service['neutron-ovs-agent-service']
}
if $use_neutron {
include ::neutron::params
$node_name = hiera('node_name')
$neutron_primary_controller_roles = hiera('neutron_primary_controller_roles', ['primary-controller'])
$neutron_compute_roles = hiera('neutron_compute_nodes', ['compute'])
$primary_controller = roles_include($neutron_primary_controller_roles)
$primary_neutron = has_primary_role(intersection(hiera('neutron_roles'), hiera('roles')))
$compute = roles_include($neutron_compute_roles)
$neutron_config = hiera_hash('neutron_config')
$neutron_config = hiera_hash('neutron_config')
$neutron_server_enable = pick($neutron_config['neutron_server_enable'], true)
$neutron_nodes = hiera_hash('neutron_nodes')
$neutron_nodes = hiera_hash('neutron_nodes')
$dpdk_config = hiera_hash('dpdk', {})
$enable_dpdk = pick($dpdk_config['enabled'], false)
@ -45,10 +36,10 @@ class vmware_dvs::l2 {
prepare_network_config($network_scheme)
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
if $compute and ! $dvr {
$do_floating = false
@ -69,11 +60,11 @@ class vmware_dvs::l2 {
})
if $segmentation_type == 'vlan' {
$net_role_property = 'neutron/private'
$iface = get_network_role_property($net_role_property, 'phys_dev')
$enable_tunneling = false
$network_type = 'vlan'
$tunnel_types = []
$net_role_property = 'neutron/private'
$iface = get_network_role_property($net_role_property, 'phys_dev')
$enable_tunneling = false
$network_type = 'vlan'
$tunnel_types = []
} else {
$net_role_property = 'neutron/mesh'
$tunneling_ip = get_network_role_property($net_role_property, 'ipaddr')
@ -81,11 +72,11 @@ class vmware_dvs::l2 {
$physical_net_mtu = pick(get_transformation_property('mtu', $iface[0]), '1500')
if $segmentation_type == 'gre' {
$mtu_offset = '42'
$mtu_offset = '42'
$network_type = 'gre'
} else {
# vxlan is the default segmentation type for non-vlan cases
$mtu_offset = '50'
$mtu_offset = '50'
$network_type = 'vxlan'
}
$tunnel_types = [$network_type]
@ -93,23 +84,22 @@ class vmware_dvs::l2 {
$enable_tunneling = true
}
# DPDK settings on compute node
if $enable_dpdk and $compute {
neutron_agent_ovs {
'securitygroup/enable_security_group': value => false;
}
$firewall_driver = 'neutron.agent.firewall.NoopFirewallDriver'
$firewall_driver = 'openvswitch'
$ovs_datapath_type = 'netdev'
$ovs_vhostuser_socket_dir = '/var/run/openvswitch'
} else {
neutron_agent_ovs {
'securitygroup/enable_security_group': value => true;
}
$firewall_driver = 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
$firewall_driver = hiera('security_groups', 'iptables_hybrid')
# Leave default values when passed to the class
$ovs_datapath_type = undef
$ovs_vhostuser_socket_dir = undef
}
neutron_agent_ovs {
'securitygroup/enable_security_group': value => true;
}
Neutron_agent_ovs<||> ~> Service['neutron-ovs-agent-service']
class { '::neutron::agents::ml2::ovs':
@ -129,7 +119,7 @@ class vmware_dvs::l2 {
enabled => true,
}
if str2bool(inline_template('<%= @neutron_nodes.values.keep_if {|h| h["name"] == @node_name}.length > 0%>')) {
if $node_name in keys($neutron_nodes) {
if $neutron_server_enable {
$service_ensure = 'running'
} else {
@ -137,9 +127,9 @@ class vmware_dvs::l2 {
}
service { 'neutron-server':
ensure => $service_ensure,
name => $::neutron::params::server_service,
enable => $neutron_server_enable,
ensure => $service_ensure,
hasstatus => true,
hasrestart => true,
tag => 'neutron-service',
@ -167,15 +157,15 @@ class vmware_dvs::l2 {
if $ha_agent {
#Exec<| title == 'waiting-for-neutron-api' |> ->
class { '::cluster::neutron::ovs' :
primary => $primary_controller,
primary => $primary_neutron,
}
}
}
# Stub for upstream neutron manifests
package { 'neutron':
ensure => 'installed',
name => 'binutils',
ensure => 'installed',
}
}

View File

@ -24,7 +24,7 @@
version: 2.1.0
groups: ['primary-controller','controller','compute-vmware']
required_for: [openstack-network-networks,vmware-vcenter]
requires: [vmware-dvs-network-common-config]
requires: [vmware-dvs-network-common-config, vmware-dvs-setup-neutron-plugin]
type: puppet
parameters:
puppet_manifest: puppet/manifests/agents.pp

View File

@ -3,7 +3,7 @@ name: fuel-plugin-vmware-dvs
# Human-readable name for your plugin
title: Neutron VMware DVS ML2 plugin
# Plugin version
version: '3.1.0'
version: '3.2.0'
# Description
description: Enable to use plugin vmware_dvs for Neutron
# Required fuel version