Merge "giving some love to make clean"
[apex.git] / build / build_perf_image.sh
index 50843e4..68a1804 100644 (file)
@@ -27,14 +27,17 @@ 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
 
 if [ "$CATEGORY" == "kernel" ]; then
-  LIBGUESTFS_BACKEND=direct virt-customize \
-    --run-command "bash -x /root/setkernelparam.sh $KEY $VALUE" \
-    -a $IMAGE
+  echo "${KEY}=${VALUE}" >> $ROLE-kernel_params.txt
+  if [[ "$dataplane" == 'fdio' && "$KEY" == 'hugepages' ]]; then
+    # set kernel hugepages params for fdio
+    LIBGUESTFS_BACKEND=direct virt-customize --run-command "echo vm.hugetlb_shm_group=0 >> /usr/lib/sysctl.d/00-system.conf" \
+                                             --run-command "echo vm.max_map_count=$(printf "%.0f" $(echo 2.2*$VALUE | bc)) >> /usr/lib/sysctl.d/00-system.conf" \
+                                             --run-command "echo kernel.shmmax==$((VALUE * 2 * 1024 * 1024)) >> /usr/lib/sysctl.d/00-system.conf" \
+                                             -a ${IMAGE}
+  fi
 fi