Enables networking-vpp in nosdn-fdio scenario 27/20827/1
authorFeng Pan <fpan@redhat.com>
Thu, 8 Sep 2016 02:26:35 +0000 (22:26 -0400)
committerTim Rozet <trozet@redhat.com>
Sun, 11 Sep 2016 00:42:16 +0000 (00:42 +0000)
- Add puppet neutron support for configuring both ML2 driver and
networking-vpp agent
- Update THT to invoke new puppet classes.

JIRA: APEX-261

opnfv-tht-pr: 76

Change-Id: Iab21713eb711e9f24fa66cba30c895e43a3e945e
Signed-off-by: Feng Pan <fpan@redhat.com>
(cherry picked from commit d327766d7e7ff91f4ed1a11cfcda70254420f524)

build/overcloud-full.sh
build/puppet-neutron/manifests/agents/ml2/networking-vpp.pp [new file with mode: 0644]
build/puppet-neutron/manifests/plugins/ml2/networking-vpp.pp [new file with mode: 0644]
ci/PR_revision.log
lib/overcloud-deploy-functions.sh

index 0357ba0..2166707 100755 (executable)
@@ -115,6 +115,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \
     $dpdk_pkg_str \
     $fdio_pkg_str \
     --upload ../networking-vpp.noarch.rpm:/root/fdio \
+    --run-command "pip install distro flask_restful" \
     --run-command "yum install -y etcd" \
     --run-command "pip install python-etcd" \
     --install "centos-release-qemu-ev" \
@@ -149,6 +150,8 @@ LIBGUESTFS_BACKEND=direct virt-customize \
     --run-command "mkdir /root/fdio_neutron_l3" \
     --upload ../neutron/agent/l3/namespaces.py:/root/fdio_neutron_l3/ \
     --upload ../neutron/agent/l3/router_info.py:/root/fdio_neutron_l3/ \
+    --upload ../puppet-neutron/manifests/agents/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/agents/ml2/ \
+    --upload ../puppet-neutron/manifests/plugins/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/plugins/ml2/ \
     -a overcloud-full_build.qcow2
 
 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
diff --git a/build/puppet-neutron/manifests/agents/ml2/networking-vpp.pp b/build/puppet-neutron/manifests/agents/ml2/networking-vpp.pp
new file mode 100644 (file)
index 0000000..c25c281
--- /dev/null
@@ -0,0 +1,56 @@
+# == Class: neutron::agents::ml2::networking-vpp
+#
+# Setups networking-vpp Neutron agent for ML2 plugin.
+#
+# === Parameters
+#
+# [*package_ensure*]
+#   (optional) Package ensure state.
+#   Defaults to 'present'.
+#
+# [*enabled*]
+#   (required) Whether or not to enable the agent.
+#   Defaults to true.
+#
+# [*manage_service*]
+#   (optional) Whether to start/stop the service
+#   Defaults to true
+#
+# [*physnets*]
+#   List of <physical_network>:<physical_interface>
+#   tuples mapping physical network names to agent's node-specific physical
+#   network interfaces. Defaults to empty list.
+#
+# [*flat_network_if*]
+#   VPP interface used for flat network
+#   Defaults to ''.
+#
+class neutron::agents::ml2::networking-vpp (
+  $package_ensure   = 'present',
+  $enabled          = true,
+  $manage_service   = true,
+  $physnets         = '',
+  $flat_network_if  = '',
+) {
+
+  include ::neutron::params
+
+  if $manage_service {
+    if $enabled {
+      $service_ensure = 'running'
+    } else {
+      $service_ensure = 'stopped'
+    }
+  }
+
+  neutron_plugin_ml2 {
+    'ml2_vpp/physnets': value => $physnets;
+    'ml2_vpp/flat_network_if': value => $flat_network_if;
+  }->
+  service { 'networking-vpp-agent':
+    ensure    => $service_ensure,
+    name      => 'networking-vpp-agent',
+    enable    => $enabled,
+    tag       => 'neutron-service',
+  }
+}
\ No newline at end of file
diff --git a/build/puppet-neutron/manifests/plugins/ml2/networking-vpp.pp b/build/puppet-neutron/manifests/plugins/ml2/networking-vpp.pp
new file mode 100644 (file)
index 0000000..26548d3
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Install the networking-vpp ML2 mechanism driver and generate config file
+# from parameters in the other classes.
+#
+# === Parameters
+#
+# [*package_ensure*]
+# (optional) The intended state of the networking-vpp
+# package, i.e. any of the possible values of the 'ensure'
+# property for a package resource type.
+# Defaults to 'present'
+#
+# [*agents*]
+# Networking-vpp agents's addresses
+# Defaults to $::os_service_default
+#
+class neutron::plugins::ml2::networking-vpp (
+  $package_ensure  = 'present',
+  $agents          = $::os_service_default,
+) {
+  require ::neutron::plugins::ml2
+
+  ensure_resource('package', 'networking-vpp',
+    {
+      ensure => $package_ensure,
+      tag    => 'openstack',
+    }
+  )
+
+  neutron_plugin_ml2 {
+    'ml2_vpp/agents': value => $agents;
+  }
+}
index 0f8f4b8..7a732ed 100644 (file)
@@ -35,3 +35,4 @@
 69,Fix vpp mount
 72,Fix compute node preconfig DPDK
 75,Add AggregateInstanceExtraSpecFilter to Scheduler
+76,Add networking-vpp ML2 mechanism driver
\ No newline at end of file
index 53c7eef..e278a68 100755 (executable)
@@ -52,6 +52,9 @@ function overcloud_deploy {
     exit 1
   elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
     echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
+    if [ "${deploy_options_array['vpp']}" == 'True' ]; then
+      DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-networking-vpp.yaml"
+    fi
     SDN_IMAGE=opendaylight
   else
     echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"