Add support for odl_l3-fdio 99/29399/6
authorFeng Pan <fpan@redhat.com>
Wed, 22 Feb 2017 19:44:39 +0000 (14:44 -0500)
committerFeng Pan <fpan@redhat.com>
Fri, 10 Mar 2017 21:20:18 +0000 (16:20 -0500)
This patch adds support for ODL L3 FDIO scenario.

Introduces a new deploy settings parameter, odl_routing_node, to
indicate the routing node's hostname. This parameter will only
be used for this scenario.

Change-Id: I8df3eb701299007761c6cec42c4ca318b124a0b8
opnfv-tht-pr: 108
os-net-config-pr: 4
Signed-off-by: Feng Pan <fpan@redhat.com>
build/nics-template.yaml.jinja2
build/opnfv-environment.yaml
build/rpm_specs/opnfv-apex-common.spec
config/deploy/os-odl_l3-fdio-ha.yaml [new file with mode: 0644]
config/deploy/os-odl_l3-fdio-noha.yaml [new file with mode: 0644]
config/network/network_settings_vpp.yaml
lib/overcloud-deploy-functions.sh
lib/python/apex/deploy_settings.py
lib/python/apex_python_utils.py
lib/undercloud-functions.sh
tests/test_apex_python_utils_py.py

index 920e9a1..f2c8000 100644 (file)
@@ -176,8 +176,8 @@ resources:
             -
               type: {{ nets['tenant']['nic_mapping'][role]['phys_type'] }}
               name: {{ nets['tenant']['nic_mapping'][role]['members'][0] }}
-              {%- if 'uio_driver' in nets['tenant']['nic_mapping'][role] %}
-              uio_driver: {{ nets['tenant']['nic_mapping'][role]['uio_driver'] }}
+              {%- if 'uio-driver' in nets['tenant']['nic_mapping'][role] %}
+              uio_driver: {{ nets['tenant']['nic_mapping'][role]['uio-driver'] }}
               {%- endif %}
               use_dhcp: false
               addresses:
@@ -185,10 +185,13 @@ resources:
                   ip_netmask: {get_param: TenantIpSubnet}
             {%- endif %}
             {%- endif %}
-            {%- if nets['external'][0]['enabled'] and external_net_type == 'interface' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %}
+            {%- if nets['external'][0]['enabled'] and external_net_type != 'br-ex' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %}
             -
-              type: interface
+              type: {{ nets['external'][0]['nic_mapping'][role]['phys_type'] }}
               name: {{ nets['external'][0]['nic_mapping'][role]['members'][0] }}
+              {%- if 'uio-driver' in nets['external'][0]['nic_mapping'][role] %}
+              uio_driver: {{ nets['external'][0]['nic_mapping'][role]['uio-driver'] }}
+              {%- endif %}
               {%- if role == 'controller' %}
               dns_servers: {get_param: DnsServers}
               {%- endif %}
index 30e6899..ff8d501 100644 (file)
@@ -25,8 +25,8 @@ parameter_defaults:
         key: 'os_compute_api:servers:show:host_status'
         value: 'rule:admin_or_owner'
     nova::api::default_floating_pool: 'external'
-    #neutron::agents::dhcp::interface_driver: "neutron.agent.linux.interface.NSDriver"
-    #neutron::agents::l3::interface_driver: "neutron.agent.linux.interface.NSDriver"
+    #VPP routing node, used for odl_l3-fdio only.
+    #opendaylight::vpp_routing_node: overcloud-novacompute-0.opnfvlf.org
   ControllerServices:
     - OS::TripleO::Services::CACerts
 #    - OS::TripleO::Services::CephClient
index a004542..702e26b 100644 (file)
@@ -51,6 +51,8 @@ install config/deploy/os-odl-bgpvpn-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-ape
 install config/deploy/os-odl-bgpvpn-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl-bgpvpn-noha.yaml
 install config/deploy/os-odl_l2-fdio-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl_l2-fdio-ha.yaml
 install config/deploy/os-odl_l2-fdio-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl_l2-fdio-noha.yaml
+install config/deploy/os-odl_l3-fdio-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl_l3-fdio-noha.yaml
+install config/deploy/os-odl_l3-fdio-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl_l3-fdio-ha.yaml
 install config/deploy/os-odl_l3-nofeature-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl_l3-nofeature-ha.yaml
 install config/deploy/os-odl-gluon-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-odl-gluon-noha.yaml
 #install config/deploy/os-onos-nofeature-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-onos-nofeature-ha.yaml
@@ -130,6 +132,8 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/
 %{_sysconfdir}/opnfv-apex/os-odl-bgpvpn-noha.yaml
 %{_sysconfdir}/opnfv-apex/os-odl_l2-fdio-noha.yaml
 %{_sysconfdir}/opnfv-apex/os-odl_l2-fdio-ha.yaml
+%{_sysconfdir}/opnfv-apex/os-odl_l3-fdio-noha.yaml
+%{_sysconfdir}/opnfv-apex/os-odl_l3-fdio-ha.yaml
 %{_sysconfdir}/opnfv-apex/os-odl_l3-nofeature-ha.yaml
 %{_sysconfdir}/opnfv-apex/os-odl-gluon-noha.yaml
 #%{_sysconfdir}/opnfv-apex/os-onos-nofeature-ha.yaml
@@ -149,6 +153,8 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/
 %doc %{_docdir}/opnfv/inventory.yaml.example
 
 %changelog
+* Fri Mar 10 2017 Feng Pan <fpan@redhat.com> - 4.0-6
+- Add os-odl_l3-fdio-noha.yaml and os-odl_l3-fdio-ha.yaml
 * Wed Mar 08 2017 Dan Radez <dradez@redhat.com> - 4.0-5
 - Commenting out ONOS, unsupported in Danube
 - Adding kvm4nfv files
diff --git a/config/deploy/os-odl_l3-fdio-ha.yaml b/config/deploy/os-odl_l3-fdio-ha.yaml
new file mode 100644 (file)
index 0000000..af81e5a
--- /dev/null
@@ -0,0 +1,37 @@
+global_params:
+  ha_enabled: true
+
+deploy_options:
+  sdn_controller: opendaylight
+  sdn_l3: true
+  odl_version: carbon
+  odl_vpp_routing_node: overcloud-novacompute-0
+  tacker: true
+  congress: true
+  sfc: false
+  vpn: false
+  vpp: true
+  dataplane: fdio
+  performance:
+    Controller:
+      kernel:
+        hugepages: 1024
+        hugepagesz: 2M
+        intel_iommu: 'on'
+        iommu: pt
+        isolcpus: 1,2
+      vpp:
+        main-core: 1
+        corelist-workers: 2
+        uio-driver: uio_pci_generic
+    Compute:
+      kernel:
+        hugepagesz: 2M
+        hugepages: 2048
+        intel_iommu: 'on'
+        iommu: pt
+        isolcpus: 1,2
+      vpp:
+        main-core: 1
+        corelist-workers: 2
+        uio-driver: uio_pci_generic
diff --git a/config/deploy/os-odl_l3-fdio-noha.yaml b/config/deploy/os-odl_l3-fdio-noha.yaml
new file mode 100644 (file)
index 0000000..adb37f3
--- /dev/null
@@ -0,0 +1,37 @@
+global_params:
+  ha_enabled: false
+
+deploy_options:
+  sdn_controller: opendaylight
+  sdn_l3: true
+  odl_version: carbon
+  odl_vpp_routing_node: overcloud-novacompute-0
+  tacker: true
+  congress: true
+  sfc: false
+  vpn: false
+  vpp: true
+  dataplane: fdio
+  performance:
+    Controller:
+      kernel:
+        hugepages: 1024
+        hugepagesz: 2M
+        intel_iommu: 'on'
+        iommu: pt
+        isolcpus: 1,2
+      vpp:
+        main-core: 1
+        corelist-workers: 2
+        uio-driver: uio_pci_generic
+    Compute:
+      kernel:
+        hugepagesz: 2M
+        hugepages: 2048
+        intel_iommu: 'on'
+        iommu: pt
+        isolcpus: 1,2
+      vpp:
+        main-core: 1
+        corelist-workers: 2
+        uio-driver: uio_pci_generic
index 4b50745..c679215 100644 (file)
@@ -96,14 +96,12 @@ networks:                            # Network configurations
                                      # vlan, vxlan, gre
     nic_mapping:                     # Mapping of network configuration for Overcloud Nodes
       compute:                       # Mapping for compute profile (nodes that will be used as Compute nodes)
-        phys_type: vpp_interface     # Physical interface type (interface/vpp_interface)
-        uio_driver: uio_pci_generic  # uio driver, for vpp interfaces only
+        phys_type: interface         # Physical interface type (interface/bond)
         vlan: native                 # VLAN tag to use with this NIC
         members:                     # Physical NIC members of this mapping (Single value allowed for interface phys_type)
           - eth1                     # Note that logic nic name like nic1 cannot be used for fdio deployment yet.
       controller:                    # Mapping for controller profile (nodes that will be used as Controller nodes)
-        phys_type: vpp_interface     # Physical interface type (interface/vpp_interface)
-        uio_driver: uio_pci_generic  # uio driver, for vpp interfaces only
+        phys_type: interface         # Physical interface type (interface/bond)
         vlan: native
         members:
           - eth1                     # Note that logic nic name like nic1 cannot be used for fdio deployment yet.
index a46c6c6..4d4b764 100755 (executable)
@@ -28,7 +28,11 @@ function overcloud_deploy {
         DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/services/gluon.yaml"
       fi
     elif [ "${deploy_options_array['vpp']}" == 'True' ]; then
-      DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb.yaml"
+      if [ "${deploy_options_array['sdn_l3']}" == "True" ]; then
+        DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb.yaml"
+      else
+        DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb-l2.yaml"
+      fi
     else
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-l3.yaml"
     fi
@@ -145,6 +149,13 @@ EOI
 EOI
   fi
 
+  #Configure routing node for odl_l3-fdio
+  if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['dataplane']}" == 'fdio' && "${deploy_options_array['sdn_l3']}" == 'True' ]]; then
+    ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+       sed -i "/opendaylight::vpp_routing_node:/c\    opendaylight::vpp_routing_node: ${deploy_options_array['odl_vpp_routing_node']}.${domain_name}" ${ENV_FILE}
+EOI
+  fi
+
   if [ -n "${deploy_options_array['performance']}" ]; then
     for option in "${performance_options[@]}" ; do
     arr=($option)
@@ -161,13 +172,6 @@ EOI
 EOI
   fi
 
-  if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
-    ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
-      sed -i "/neutron::agents::dhcp::interface_driver:/c\    neutron::agents::dhcp::interface_driver: neutron.agent.linux.interface.NSDriver" ${ENV_FILE}
-      sed -i "/neutron::agents::l3::interface_driver:/c\    neutron::agents::l3::interface_driver: neutron.agent.linux.interface.NSDriver" ${ENV_FILE}
-EOI
-  fi
-
   # Set ODL version accordingly
   if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && -n "${deploy_options_array['odl_version']}" ]]; then
     case "${deploy_options_array['odl_version']}" in
index 566e8be..9fb4c6f 100644 (file)
@@ -30,7 +30,8 @@ OPT_DEPLOY_SETTINGS = ['performance',
                        'vsperf',
                        'ceph_device',
                        'yardstick',
-                       'dovetail']
+                       'dovetail',
+                       'odl_vpp_routing_node']
 
 VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage']
 VALID_PERF_OPTS = ['kernel', 'nova', 'vpp']
index e21d046..830af36 100755 (executable)
@@ -106,10 +106,25 @@ def build_nic_template(args):
     template_dir, template = args.template.rsplit('/', 1)
 
     netsets = NetworkSettings(args.net_settings_file)
+    nets = netsets.get('networks')
+    ds = DeploySettings(args.deploy_settings_file).get('deploy_options')
     env = Environment(loader=FileSystemLoader(template_dir), autoescape=True)
     template = env.get_template(template)
 
-    print(template.render(nets=netsets['networks'],
+    if ds['dataplane'] == 'fdio':
+        nets['tenant']['nic_mapping'][args.role]['phys_type'] = 'vpp_interface'
+        if ds['sdn_l3']:
+            nets['external'][0]['nic_mapping'][args.role]['phys_type'] =\
+                'vpp_interface'
+    if ds.get('performance', {}).get(args.role.title(), {}).get('vpp', {})\
+            .get('uio-driver'):
+        nets['tenant']['nic_mapping'][args.role]['uio-driver'] =\
+            ds['performance'][args.role.title()]['vpp']['uio-driver']
+        if ds['sdn_l3']:
+            nets['external'][0]['nic_mapping'][args.role]['uio-driver'] =\
+                ds['performance'][args.role.title()]['vpp']['uio-driver']
+
+    print(template.render(nets=nets,
                           role=args.role,
                           external_net_af=netsets.get_ip_addr_family(),
                           external_net_type=args.ext_net_type,
@@ -175,11 +190,14 @@ def get_parser():
                               help='path to network settings file')
     nic_template.add_argument('-e', '--ext-net-type', default='interface',
                               dest='ext_net_type',
-                              choices=['interface', 'br-ex'],
+                              choices=['interface', 'vpp_interface', 'br-ex'],
                               help='External network type')
     nic_template.add_argument('-d', '--ovs-dpdk-bridge',
                               default=None, dest='ovs_dpdk_bridge',
                               help='OVS DPDK Bridge Name')
+    nic_template.add_argument('--deploy-settings-file',
+                              help='path to deploy settings file')
+
     nic_template.set_defaults(func=build_nic_template)
     # parse-deploy-settings
     deploy_settings = subparsers.add_parser('parse-deploy-settings',
index 080fcbb..2a370bf 100755 (executable)
@@ -127,7 +127,11 @@ function configure_undercloud {
 
   # check for ODL L3/ONOS
   if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then
-    ext_net_type=br-ex
+    if [ "${deploy_options_array['dataplane']}" == 'fdio' ]; then
+      ext_net_type=vpp_interface
+    else
+      ext_net_type=br-ex
+    fi
   fi
 
   if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
@@ -136,12 +140,12 @@ function configure_undercloud {
     ovs_dpdk_bridge=''
   fi
 
-  if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e "br-ex"); then
+  if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e "br-ex" --deploy-settings-file $DEPLOY_SETTINGS_FILE); then
     echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}"
     exit 1
   fi
 
-  if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then
+  if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge" --deploy-settings-file $DEPLOY_SETTINGS_FILE); then
     echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}"
     exit 1
   fi
index eb16f67..550042f 100644 (file)
@@ -81,7 +81,8 @@ class TestCommonUtils(object):
         args = self.parser.parse_args(['nic-template',
                                        '-s', net_sets,
                                        '-r', 'compute',
-                                       '-t', nic_template])
+                                       '-t', nic_template,
+                                       '--deploy-settings-file', deploy_sets])
         assert_equal(build_nic_template(args), None)
 
     def test_parse_inventory(self):