From 8131692770530c9a7687718e7620fc4fb583b935 Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Tue, 18 Jul 2017 13:35:13 -0400 Subject: Add VPP and honeycomb services Change-Id: I6ed724f4c81a230a17584c33cc4de8b4000d525e --- Puppetfile_extras | 4 ++ .../parser/functions/honeycomb_int_role_mapping.rb | 21 +++++++ manifests/profile/base/neutron/agents/honeycomb.pp | 43 +++++++++++++++ manifests/profile/base/neutron/agents/vpp.pp | 64 ++++++++++++++++++++++ manifests/profile/base/neutron/opendaylight.pp | 2 +- manifests/profile/base/neutron/plugins/ml2.pp | 4 ++ manifests/profile/base/neutron/plugins/ml2/vpp.pp | 49 +++++++++++++++++ manifests/profile/base/vpp.pp | 32 +++++++++++ releasenotes/notes/vpp-7368457faab68824.yaml | 7 +++ releasenotes/notes/vpp-ml2-9c1321fa30f3b172.yaml | 3 + 10 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 lib/puppet/parser/functions/honeycomb_int_role_mapping.rb create mode 100644 manifests/profile/base/neutron/agents/honeycomb.pp create mode 100644 manifests/profile/base/neutron/agents/vpp.pp create mode 100644 manifests/profile/base/neutron/plugins/ml2/vpp.pp create mode 100644 manifests/profile/base/vpp.pp create mode 100644 releasenotes/notes/vpp-7368457faab68824.yaml create mode 100644 releasenotes/notes/vpp-ml2-9c1321fa30f3b172.yaml diff --git a/Puppetfile_extras b/Puppetfile_extras index 22a053b..5e3be14 100644 --- a/Puppetfile_extras +++ b/Puppetfile_extras @@ -29,6 +29,10 @@ mod 'etcd', :git => 'https://github.com/cristifalcas/puppet-etcd', :ref => '1.10.0' +mod 'fdio', + :git => 'https://git.fd.io/puppet-fdio', + :ref => 'master' + mod 'ntp', :git => 'https://github.com/puppetlabs/puppetlabs-ntp', :ref => '4.2.x' diff --git a/lib/puppet/parser/functions/honeycomb_int_role_mapping.rb b/lib/puppet/parser/functions/honeycomb_int_role_mapping.rb new file mode 100644 index 0000000..ff9739b --- /dev/null +++ b/lib/puppet/parser/functions/honeycomb_int_role_mapping.rb @@ -0,0 +1,21 @@ +module Puppet::Parser::Functions + newfunction(:honeycomb_int_role_mapping, :type => :rvalue, :doc => "Convert Honeycomb role mapping from kernel nic name (eth1) to VPP name (GigabitEthernet0/7/0).") do |arg| + mapping_list = arg[0] + mapping_list.map! do |item| + mapping = item.split(':') + unless mapping.length == 2 + raise Puppet::ParseError, "Invalid physnet mapping format: #{item}. Expecting 'interface_name:role_name'" + end + if defined? call_function + vpp_int = call_function('hiera', [mapping[0]]) + else + vpp_int = function_hiera([mapping[0]]) + end + if vpp_int.to_s.strip.empty? + raise Puppet::ParseError, "VPP interface mapped to #{mapping[0]} is not found." + end + vpp_int+':'+mapping[1] + end + return mapping_list + end +end diff --git a/manifests/profile/base/neutron/agents/honeycomb.pp b/manifests/profile/base/neutron/agents/honeycomb.pp new file mode 100644 index 0000000..c4e36a6 --- /dev/null +++ b/manifests/profile/base/neutron/agents/honeycomb.pp @@ -0,0 +1,43 @@ +# Copyright 2017 Red Hat, Inc. +# +# 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. +# +# == Class: tripleo::profile::base::neutron::agents::honeycomb +# +# Honeycomb Neutron agent profile +# +# Honeycomb is a java-based agent that runs on the same host as a VPP +# instance, and exposes yang models via netconf or restconf to allow +# remote management of that VPP instance. +# +# === Parameters +# +# [*step*] +# (Optional) The current step of the deployment +# Defaults to hiera('step') +# +# [*interface_role_mapping*] +# (Optional) VPP interface role mapping, note that the interface name +# specified here is a kernel interface name that is bound to VPP. +# Defaults to [] +# +class tripleo::profile::base::neutron::agents::honeycomb ( + $step = hiera('step'), + $interface_role_mapping = [], +) { + if $step >= 4 { + class { '::fdio::honeycomb': + interface_role_map => honeycomb_int_role_mapping($interface_role_mapping), + } + } +} diff --git a/manifests/profile/base/neutron/agents/vpp.pp b/manifests/profile/base/neutron/agents/vpp.pp new file mode 100644 index 0000000..6e278d7 --- /dev/null +++ b/manifests/profile/base/neutron/agents/vpp.pp @@ -0,0 +1,64 @@ +# Copyright 2017 Red Hat, Inc. +# +# 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. +# +# == Class: tripleo::profile::base::neutron::agents::vpp +# +# Neutron VPP Agent profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*etcd_host*] +# (Optional) etcd server VIP. +# Defaults to hiera('etcd_vip') +# +# [*etcd_port*] +# (Optional) etcd server listening port. +# Defaults to 2379 +# +# [*physnet_mapping*] +# (Optional) physnet mapping, example: 'datacentre:eth1'. Note that the +# interface specified here is a kernel interface name that is bound to +# VPP. +# Defaults to [] +# +# [*type_drivers*] +# (optional) List of network type driver entrypoints to be loaded +# Could be an array that can contain flat, vlan or vxlan +# Defaults to hiera('neutron::plugins::ml2::type_drivers', undef) +# +class tripleo::profile::base::neutron::agents::vpp( + $step = hiera('step'), + $etcd_host = hiera('etcd_vip'), + $etcd_port = 2379, + $physnet_mapping = [], + $type_drivers = hiera('neutron::plugins::ml2::type_drivers', undef), +) { + if empty($etcd_host) { + fail('etcd_vip not set in hieradata') + } + + if $step >= 4 { + class { '::neutron::agents::ml2::vpp': + etcd_host => $etcd_host, + etcd_port => $etcd_port, + physnets => vpp_physnet_mapping($physnet_mapping), + type_drivers => $type_drivers, + } + } +} diff --git a/manifests/profile/base/neutron/opendaylight.pp b/manifests/profile/base/neutron/opendaylight.pp index b5e6d11..89dbf83 100644 --- a/manifests/profile/base/neutron/opendaylight.pp +++ b/manifests/profile/base/neutron/opendaylight.pp @@ -36,7 +36,7 @@ class tripleo::profile::base::neutron::opendaylight ( $node_name = hiera('bootstack_nodeid') ) { - if $step >= 1 { + if $step == 1 { validate_array($odl_api_ips) if empty($odl_api_ips) { fail('No IPs assigned to OpenDaylight Api Service') diff --git a/manifests/profile/base/neutron/plugins/ml2.pp b/manifests/profile/base/neutron/plugins/ml2.pp index 52d4ca1..1702fed 100644 --- a/manifests/profile/base/neutron/plugins/ml2.pp +++ b/manifests/profile/base/neutron/plugins/ml2.pp @@ -81,5 +81,9 @@ class tripleo::profile::base::neutron::plugins::ml2 ( include ::neutron::plugins::ml2::fujitsu include ::neutron::plugins::ml2::fujitsu::fossw } + + if 'vpp' in $mechanism_drivers { + include ::tripleo::profile::base::neutron::plugins::ml2::vpp + } } } diff --git a/manifests/profile/base/neutron/plugins/ml2/vpp.pp b/manifests/profile/base/neutron/plugins/ml2/vpp.pp new file mode 100644 index 0000000..217e4cf --- /dev/null +++ b/manifests/profile/base/neutron/plugins/ml2/vpp.pp @@ -0,0 +1,49 @@ +# Copyright 2017 Red Hat, Inc. +# +# 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. +# +# == Class: tripleo::profile::base::neutron::plugins::ml2::vpp +# +# VPP Neutron ML2 profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*etcd_host*] +# (Optional) etcd server VIP. +# Defaults to hiera('etcd_vip') +# +# [*etcd_port*] +# (Optional) etcd server listening port. +# Defaults to 2379 +# +class tripleo::profile::base::neutron::plugins::ml2::vpp ( + $step = hiera('step'), + $etcd_host = hiera('etcd_vip'), + $etcd_port = 2379, +) { + if empty($etcd_host) { + fail('etcd_vip not set in hieradata') + } + + if $step >= 4 { + class { '::neutron::plugins::ml2::vpp': + etcd_host => $etcd_host, + etcd_port => $etcd_port, + } + } +} diff --git a/manifests/profile/base/vpp.pp b/manifests/profile/base/vpp.pp new file mode 100644 index 0000000..05f52f9 --- /dev/null +++ b/manifests/profile/base/vpp.pp @@ -0,0 +1,32 @@ +# Copyright 2017 Red Hat, Inc. +# +# 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. +# +# == Class: tripleo::profile::base::vpp +# +# vpp profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::base::vpp ( + $step = hiera('step'), +) { + if $step >= 1 { + include ::fdio + } +} diff --git a/releasenotes/notes/vpp-7368457faab68824.yaml b/releasenotes/notes/vpp-7368457faab68824.yaml new file mode 100644 index 0000000..94264c5 --- /dev/null +++ b/releasenotes/notes/vpp-7368457faab68824.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add profiles for VPP service. Vector Packet Processing (VPP) is a high + performance packet processing stack that runs in user space in Linux. + VPP is used as an alternative to kernel networking stack for accelerated + network data path. diff --git a/releasenotes/notes/vpp-ml2-9c1321fa30f3b172.yaml b/releasenotes/notes/vpp-ml2-9c1321fa30f3b172.yaml new file mode 100644 index 0000000..2f8ae14 --- /dev/null +++ b/releasenotes/notes/vpp-ml2-9c1321fa30f3b172.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds support for networking-vpp ML2 mechanism driver and agent. -- cgit 1.2.3-korg