diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/overcloud-deploy-functions.sh | 17 | ||||
-rwxr-xr-x | lib/parse-functions.sh | 14 | ||||
-rw-r--r-- | lib/python/apex/common/constants.py | 4 | ||||
-rw-r--r-- | lib/python/apex/network_environment.py | 15 | ||||
-rwxr-xr-x | lib/python/apex_python_utils.py | 15 | ||||
-rwxr-xr-x | lib/virtual-setup-functions.sh | 18 |
6 files changed, 70 insertions, 13 deletions
diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh index 1fcaa0df..e613dae0 100755 --- a/lib/overcloud-deploy-functions.sh +++ b/lib/overcloud-deploy-functions.sh @@ -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 @@ -150,6 +157,12 @@ 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" fi diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index dde9041a..e8dd982d 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -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 diff --git a/lib/python/apex/common/constants.py b/lib/python/apex/common/constants.py index 996ef2f0..ae8ffe31 100644 --- a/lib/python/apex/common/constants.py +++ b/lib/python/apex/common/constants.py @@ -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/" diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py index 981c8f1c..bf81b98d 100644 --- a/lib/python/apex/network_environment.py +++ b/lib/python/apex/network_environment.py @@ -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. diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py index bc9bc56f..c548437d 100755 --- a/lib/python/apex_python_utils.py +++ b/lib/python/apex_python_utils.py @@ -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', diff --git a/lib/virtual-setup-functions.sh b/lib/virtual-setup-functions.sh index e7410da7..ed4d4dfd 100755 --- a/lib/virtual-setup-functions.sh +++ b/lib/virtual-setup-functions.sh @@ -40,6 +40,17 @@ EOF fi for i in $(seq 0 $vm_index); do + if [ "$VM_COMPUTES" -gt 0 ]; then + capability="profile:compute" + VM_COMPUTES=$((VM_COMPUTES - 1)) + else + capability="profile:control" + if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "$ha_enabled" == "True" && "$ramsize" -lt 10240 ]]; then + echo "WARN: RAM per controller too low. OpenDaylight specified in HA deployment requires at least 10GB" + echo "INFO: Increasing RAM per controller to 10GB" + ramsize=10240 + fi + fi if ! virsh list --all | grep baremetal${i} > /dev/null; then define_vm baremetal${i} network 41 'admin_network' $vcpus $ramsize for n in private_network public_network storage_network api_network; do @@ -54,13 +65,6 @@ EOF #virsh vol-list default | grep baremetal${i} 2>&1> /dev/null || virsh vol-create-as default baremetal${i}.qcow2 41G --format qcow2 mac=$(virsh domiflist baremetal${i} | grep admin_network | awk '{ print $5 }') - if [ "$VM_COMPUTES" -gt 0 ]; then - capability="profile:compute" - VM_COMPUTES=$((VM_COMPUTES - 1)) - else - capability="profile:control" - fi - cat >> $CONFIG/instackenv-virt.json << EOF { "pm_addr": "192.168.122.1", |