Adds configuring vpp/hc on all nodes 91/17391/9
authorTim Rozet <trozet@redhat.com>
Fri, 22 Jul 2016 03:00:21 +0000 (23:00 -0400)
committerTim Rozet <trozet@redhat.com>
Wed, 3 Aug 2016 15:35:48 +0000 (11:35 -0400)
Changes include:
 - starting vpp with pci addr of tenant nic
 - setting performance options for fdio scenario
 - creates nosdn fdio scenario (needs newtorking-vpp, etc)
 - starts HC if ODL is used

opnfv-tht-pr: 46

JIRA: APEX-133

Change-Id: Ie7a7f1418b94dfb82255ec9aebc550a955dd696a
Signed-off-by: Tim Rozet <trozet@redhat.com>
12 files changed:
build/build_perf_image.sh
build/network-environment.yaml
build/opnfv-apex-common.spec
config/deploy/os-nosdn-fdio-noha.yaml [new file with mode: 0644]
config/deploy/os-odl_l2-fdio-ha.yaml
config/deploy/os-odl_l2-fdio-noha.yaml
lib/overcloud-deploy-functions.sh
lib/parse-functions.sh
lib/python/apex/common/constants.py
lib/python/apex/network_environment.py
lib/python/apex_python_utils.py
tests/test_apex_network_environment.py

index c91b563..a6ca066 100644 (file)
@@ -27,8 +27,6 @@ fi
 if [ "$CATEGORY" == "nova" ]; then
   if [ "$KEY" == "libvirtpin" ]; then
     sudo sed -i "s/#LibvirtCPUPinSet:.*/LibvirtCPUPinSet: '${VALUE}'/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
-    sudo sed -i "s/^#resource_registry:/resource_registry:/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
-    sudo sed -i "s/#  {numa}/  OS::TripleO::ComputeExtraConfigPre: ..\/puppet\/extraconfig\/pre_deploy\/compute\/numa.yaml/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
   fi
 fi
 
index 84bb5ce..bbd0796 100644 (file)
@@ -39,7 +39,6 @@ resource_registry:
   OS::TripleO::Compute::Net::SoftwareConfig: nics/compute.yaml
   OS::TripleO::Controller::Net::SoftwareConfig: nics/controller.yaml
 
-
 parameter_defaults:
   NeutronExternalNetworkBridge: 'br-ex'
   ControlPlaneSubnetCidr: "24"
index 854fbbb..6b86bf8 100644 (file)
@@ -35,6 +35,7 @@ install ci/util.sh %{buildroot}%{_bindir}/opnfv-util
 
 mkdir -p %{buildroot}%{_sysconfdir}/opnfv-apex/
 install config/deploy/os-nosdn-nofeature-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml
+install config/deploy/os-nosdn-fdio-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml
 install config/deploy/os-nosdn-ovs-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-ovs-noha.yaml
 install config/deploy/os-nosdn-nofeature-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-ha.yaml
 install config/deploy/os-nosdn-performance-ha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-performance-ha.yaml
@@ -104,6 +105,7 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/
 %{_var}/opt/opnfv/lib/installer/onos/onos_gw_mac_update.sh
 %{_var}/opt/opnfv/lib/installer/domain.xml
 %{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml
+%{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml
 %{_sysconfdir}/opnfv-apex/os-nosdn-ovs-noha.yaml
 %{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-ha.yaml
 %{_sysconfdir}/opnfv-apex/os-nosdn-performance-ha.yaml
@@ -129,6 +131,8 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/
 %doc %{_docdir}/opnfv/inventory.yaml.example
 
 %changelog
+* Thu Aug 1 2016 Tim Rozet <trozet@redhat.com> - 3.0-11
+- Add nosdn fdio scenarios.
 * Tue Jul 5 2016 Dan Radez <dradez@redhat.com> - 3.0-10
 - Adding functions.sh files
 * Thu Jun 15 2016 Tim Rozet <trozet@redhat.com> - 3.0-9
diff --git a/config/deploy/os-nosdn-fdio-noha.yaml b/config/deploy/os-nosdn-fdio-noha.yaml
new file mode 100644 (file)
index 0000000..057177f
--- /dev/null
@@ -0,0 +1,25 @@
+global_params:
+  ha_enabled: false
+
+deploy_options:
+  sdn_controller: false
+  sdn_l3: false
+  tacker: false
+  congress: false
+  sfc: false
+  vpn: false
+  vpp: true
+  dataplane: fdio
+  performance:
+    Controller:
+      kernel:
+        hugepages: 1024
+        hugepagesz: 2M
+    Compute:
+      nova:
+        libvirtpin: 1
+      kernel:
+        hugepagesz: 2M
+        hugepages: 4096
+        intel_iommu: 'on'
+        iommu: pt
index e0f2669..c7a9d8e 100644 (file)
@@ -10,3 +10,17 @@ deploy_options:
   sfc: false
   vpn: false
   vpp: true
+  dataplane: fdio
+  performance:
+    Controller:
+      kernel:
+        hugepages: 1024
+        hugepagesz: 2M
+    Compute:
+      nova:
+        libvirtpin: 1
+      kernel:
+        hugepagesz: 2M
+        hugepages: 4096
+        intel_iommu: 'on'
+        iommu: pt
index 9fc896b..ca09015 100644 (file)
@@ -10,3 +10,19 @@ deploy_options:
   sfc: false
   vpn: false
   vpp: true
+  dataplane: fdio
+  performance:
+    Controller:
+      kernel:
+        hugepages: 1024
+        hugepagesz: 2M
+        intel_iommu: 'on'
+        iommu: pt
+    Compute:
+      nova:
+        libvirtpin: 1
+      kernel:
+        hugepagesz: 2M
+        hugepages: 4096
+        intel_iommu: 'on'
+        iommu: pt
index 14c3724..5b0e1ac 100755 (executable)
@@ -71,7 +71,7 @@ function overcloud_deploy {
   scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
 
   # Install ovs-dpdk inside the overcloud image if it is enabled.
-  if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
+  if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
     # install dpdk packages before ovs
     echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
 
@@ -90,9 +90,16 @@ EOF
                                                --upload uio_pci_generic.modules:/etc/sysconfig/modules/ \
                                                --run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \
                                                --run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \
-                                               --run-command "yum install -y /root/dpdk_rpms/*" \
                                                -a overcloud-full.qcow2
+
+      if [ "${deploy_options_array['dataplane']}" == 'fdio' ]; then
+        sed -i '/FdioEnabled:/c\  FdioEnabled: true' opnfv-environment.yaml
+      else
+        LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/dpdk_rpms/*" \
+                                                 -a overcloud-full.qcow2
+      fi
 EOI
+
   elif [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
     echo "${red}${deploy_options_array['dataplane']} not supported${reset}"
     exit 1
@@ -148,6 +155,12 @@ find . | cpio -o -H newc | gzip > /home/stack/Controller-ironic-python-agent.ini
 chown stack /home/stack/Controller-ironic-python-agent.initramfs
 popd
 /bin/rm -rf ipa/
+EOI
+
+    # set NIC heat params and resource registry
+    ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+sed -i '/TenantNIC:/c\  TenantNIC: '${private_network_compute_interface} opnfv-environment.yaml
+sed -i '/PublicNIC:/c\  PublicNIC: '${public_network_compute_interface} opnfv-environment.yaml
 EOI
 
     DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml"
index dde9041..e8dd982 100755 (executable)
@@ -52,8 +52,18 @@ parse_setting_value() {
 
 ##parses network settings yaml into globals
 parse_network_settings() {
-  local output
-  if output=$(python3.4 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -i $net_isolation_enabled -e $CONFIG/network-environment.yaml); then
+  local output parse_ext
+  parse_ext=''
+
+  for val in ${performance_roles[@]}; do
+    if [ "$val" == "Compute" ]; then
+      parse_ext="${parse_ext} --compute-pre-config "
+    elif [ "$val" == "Controller" ]; then
+      parse_ext="${parse_ext} --controller-pre-config "
+    fi
+  done
+
+  if output=$(python3.4 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -i $net_isolation_enabled -e $CONFIG/network-environment.yaml $parse_ext); then
       echo -e "${blue}${output}${reset}"
       eval "$output"
   else
index 996ef2f..ae8ffe3 100644 (file)
@@ -17,3 +17,7 @@ OPNFV_NETWORK_TYPES = [ADMIN_NETWORK, PRIVATE_NETWORK, PUBLIC_NETWORK,
 DNS_SERVERS = ["8.8.8.8", "8.8.4.4"]
 ROLES = ['compute', 'controller']
 DOMAIN_NAME = 'localdomain.com'
+COMPUTE_PRE = "OS::TripleO::ComputeExtraConfigPre"
+CONTROLLER_PRE = "OS::TripleO::ControllerExtraConfigPre"
+PRE_CONFIG_DIR = "/usr/share/openstack-tripleo-heat-templates/puppet/" \
+                 "extraconfig/pre_deploy/"
index 981c8f1..bf81b98 100644 (file)
@@ -15,6 +15,9 @@ from .common.constants import (
     STORAGE_NETWORK,
     PUBLIC_NETWORK,
     API_NETWORK,
+    CONTROLLER_PRE,
+    COMPUTE_PRE,
+    PRE_CONFIG_DIR
 )
 
 PORTS = '/ports'
@@ -48,8 +51,11 @@ class NetworkEnvironment:
     The class builds upon an existing network-environment file and modifies
     based on a NetworkSettings object.
     """
-    def __init__(self, net_settings, filename):
+    def __init__(self, net_settings, filename, compute_pre_config=False,
+                 controller_pre_config=False):
         with open(filename, 'r') as net_env_fh:
+            self.compute_pre = compute_pre_config
+            self.controller_pre = controller_pre_config
             self.netenv_obj = yaml.load(net_env_fh)
             self._update_net_environment(net_settings)
 
@@ -185,6 +191,13 @@ class NetworkEnvironment:
                 prefix = ''
             self.netenv_obj[reg][key] = tht_dir + prefix + postfix
 
+        if self.compute_pre:
+            self.netenv_obj[reg][COMPUTE_PRE] = PRE_CONFIG_DIR + \
+                "compute/numa.yaml"
+        if self.controller_pre:
+            self.netenv_obj[reg][CONTROLLER_PRE] = PRE_CONFIG_DIR + \
+                "controller/numa.yaml"
+
         # Set IPv6 related flags to True. Not that we do not set those to False
         # when IPv4 is configured, we'll use the default or whatever the user
         # may have set.
index bc9bc56..c548437 100755 (executable)
@@ -38,7 +38,9 @@ def parse_net_settings(args):
     """
     settings = NetworkSettings(args.net_settings_file,
                                args.network_isolation)
-    net_env = NetworkEnvironment(settings, args.net_env_file)
+    net_env = NetworkEnvironment(settings, args.net_env_file,
+                                 args.compute_pre_config,
+                                 args.controller_pre_config)
     dump_yaml(net_env.get_netenv_settings(), '/tmp/network-environment.yaml')
     settings.dump_bash()
 
@@ -136,6 +138,17 @@ def get_parser():
                               default="network-environment.yaml",
                               dest='net_env_file',
                               help='path to network environment file')
+    net_settings.add_argument('--compute-pre-config',
+                              default=False,
+                              action='store_true',
+                              dest='compute_pre_config',
+                              help='Boolean to enable Compute Pre Config')
+    net_settings.add_argument('--controller-pre-config',
+                              action='store_true',
+                              default=False,
+                              dest='controller_pre_config',
+                              help='Boolean to enable Controller Pre Config')
+
     net_settings.set_defaults(func=parse_net_settings)
 
     get_int_ip = subparsers.add_parser('find-ip',
index 2a8438f..97bdd37 100644 (file)
@@ -38,6 +38,8 @@ class TestNetworkEnvironment(object):
 
     def test_get_netenv_settings(self):
         ns = NetworkSettings('../config/network/network_settings.yaml', True)
-        ne = NetworkEnvironment(ns, '../build/network-environment.yaml')
+        ne = NetworkEnvironment(ns, '../build/network-environment.yaml',
+                                compute_pre_config=True,
+                                controller_pre_config=True)
         assert_is_instance(ne.get_netenv_settings(), dict)
         assert_not_equal(ne.get_netenv_settings(), {})