Fix performance option handling
[apex.git] / build / build_perf_image.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2016 Red Hat Inc.
4 # Michael Chapman <michapma@redhat.com>
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 ROLE=$1
12 shift
13 CATEGORY=$1
14 shift
15 KEY=$1
16 shift
17 VALUE=$1
18 shift
19
20 IMAGE=$ROLE-overcloud-full.qcow2
21
22 # Create image copy for this role
23 if [ ! -f $IMAGE ] ; then
24   cp overcloud-full.qcow2 $IMAGE
25 fi
26
27 if [ "$CATEGORY" == "nova" ]; then
28   if [ "$KEY" == "libvirtpin" ]; then
29     sudo sed -i "s/#LibvirtCPUPinSet:.*/LibvirtCPUPinSet: '${VALUE}'/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
30     sudo sed -i "s/^#resource_registry:/resource_registry:/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
31     sudo sed -i "s/#  {numa}/  OS::TripleO::ComputeExtraConfigPre: ..\/puppet\/extraconfig\/pre_deploy\/compute\/numa.yaml/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
32   fi
33 fi
34
35 if [ "$CATEGORY" == "kernel" ]; then
36   LIBGUESTFS_BACKEND=direct virt-customize \
37     --run-command "bash -x /root/setkernelparam.sh $KEY $VALUE" \
38     -a $IMAGE
39 fi
40