summaryrefslogtreecommitdiffstats
path: root/ci/deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/deploy.sh')
-rwxr-xr-xci/deploy.sh139
1 files changed, 83 insertions, 56 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 9cdd8297..18f96319 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -33,6 +33,7 @@ debug="FALSE"
declare -i CNT
declare UNDERCLOUD
declare -A deploy_options_array
+declare -a performance_options
declare -A NET_MAP
SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error)
@@ -102,50 +103,31 @@ parse_setting_value() {
local mystr=$1
echo $(echo $mystr | grep -Eo "\=.*$" | tr -d '=')
}
+
##parses network settings yaml into globals
parse_network_settings() {
+ local output
if output=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py parse_net_settings -n $NETSETS -i $net_isolation_enabled); then
- eval "$output"
echo -e "${blue}${output}${reset}"
+ eval "$output"
else
+ echo -e "${red}ERROR: Failed to parse network settings file $NETSETS ${reset}"
exit 1
fi
-
}
-##parses deploy settings yaml into globals and options array
-##params: none
-##usage: parse_deploy_settings
+
+##parses deploy settings yaml into globals
parse_deploy_settings() {
- local global_prefix="deploy_global_params_"
- local options_prefix="deploy_deploy_options_"
- local myvar myvalue
- local settings=$(parse_yaml $DEPLOY_SETTINGS_FILE "deploy_")
-
- for this_setting in $settings; do
- if contains_prefix $this_setting $global_prefix; then
- myvar=$(parse_setting_var $this_setting $global_prefix)
- if [ -z "$myvar" ]; then
- echo -e "${red}ERROR: while parsing ${DEPLOY_SETTINGS_FILE} for setting: ${this_setting}${reset}"
- fi
- myvalue=$(parse_setting_value $this_setting)
- # Do not override variables set by cmdline
- if [ -z "$(eval echo \$$myvar)" ]; then
- eval "$myvar=\$myvalue"
- echo -e "${blue}Global parameter set: ${myvar}:${myvalue}${reset}"
- else
- echo -e "${blue}Global parameter already set: ${myvar}${reset}"
- fi
- elif contains_prefix $this_setting $options_prefix; then
- myvar=$(parse_setting_var $this_setting $options_prefix)
- if [ -z "$myvar" ]; then
- echo -e "${red}ERROR: while parsing ${DEPLOY_SETTINGS_FILE} for setting: ${this_setting}${reset}"
- fi
- myvalue=$(parse_setting_value $this_setting)
- deploy_options_array[$myvar]=$myvalue
- echo -e "${blue}Deploy option set: ${myvar}:${myvalue}${reset}"
- fi
- done
+ local output
+ if output=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py parse-deploy-settings -f $DEPLOY_SETTINGS_FILE); then
+ echo -e "${blue}${output}${reset}"
+ eval "$output"
+ else
+ echo -e "${red}ERROR: Failed to parse deploy settings file $DEPLOY_SETTINGS_FILE ${reset}"
+ exit 1
+ fi
}
+
##parses baremetal yaml settings into compatible json
##writes the json to $CONFIG/instackenv_tmp.json
##params: none
@@ -292,10 +274,11 @@ function configure_deps {
virsh net-list --all | grep -E "default\s+active" > /dev/null || virsh net-start default
virsh net-list --all | grep -E "default\s+active\s+yes" > /dev/null || virsh net-autostart --network default
- for network in ${OPNFV_NETWORK_TYPES}; do
- echo "${blue}INFO: Creating Virsh Network: $network & OVS Bridge: ${NET_MAP[$network]}${reset}"
- ovs-vsctl list-br | grep ${NET_MAP[$network]} > /dev/null || ovs-vsctl add-br ${NET_MAP[$network]}
- virsh net-list --all | grep $network > /dev/null || (cat > ${libvirt_dir}/apex-virsh-net.xml && virsh net-define ${libvirt_dir}/apex-virsh-net.xml) << EOF
+ if [[ -z "$virtual" || "$virtual" == "FALSE" ]]; then
+ for network in ${OPNFV_NETWORK_TYPES}; do
+ echo "${blue}INFO: Creating Virsh Network: $network & OVS Bridge: ${NET_MAP[$network]}${reset}"
+ ovs-vsctl list-br | grep "^${NET_MAP[$network]}$" > /dev/null || ovs-vsctl add-br ${NET_MAP[$network]}
+ virsh net-list --all | grep $network > /dev/null || (cat > ${libvirt_dir}/apex-virsh-net.xml && virsh net-define ${libvirt_dir}/apex-virsh-net.xml) << EOF
<network>
<name>$network</name>
<forward mode='bridge'/>
@@ -303,21 +286,18 @@ function configure_deps {
<virtualport type='openvswitch'/>
</network>
EOF
- if ! (virsh net-list --all | grep $network > /dev/null); then
- echo "${red}ERROR: unable to create network: ${network}${reset}"
- exit 1;
- fi
- rm -f ${libvirt_dir}/apex-virsh-net.xml &> /dev/null;
- virsh net-list | grep -E "$network\s+active" > /dev/null || virsh net-start $network
- virsh net-list | grep -E "$network\s+active\s+yes" > /dev/null || virsh net-autostart --network $network
- done
+ if ! (virsh net-list --all | grep $network > /dev/null); then
+ echo "${red}ERROR: unable to create network: ${network}${reset}"
+ exit 1;
+ fi
+ rm -f ${libvirt_dir}/apex-virsh-net.xml &> /dev/null;
+ virsh net-list | grep -E "$network\s+active" > /dev/null || virsh net-start $network
+ virsh net-list | grep -E "$network\s+active\s+yes" > /dev/null || virsh net-autostart --network $network
+ done
- echo -e "${blue}INFO: Bridges set: ${reset}"
- ovs-vsctl list-br
- echo -e "${blue}INFO: virsh networks set: ${reset}"
- virsh net-list
+ echo -e "${blue}INFO: Bridges set: ${reset}"
+ ovs-vsctl list-br
- if [[ -z "$virtual" || "$virtual" == "FALSE" ]]; then
# bridge interfaces to correct OVS instances for baremetal deployment
for network in ${enabled_network_list}; do
if [[ "$network" != "admin_network" && "$network" != "public_network" ]]; then
@@ -337,8 +317,31 @@ EOF
exit 1
fi
done
+ else
+ for network in ${OPNFV_NETWORK_TYPES}; do
+ echo "${blue}INFO: Creating Virsh Network: $network${reset}"
+ virsh net-list --all | grep $network > /dev/null || (cat > ${libvirt_dir}/apex-virsh-net.xml && virsh net-define ${libvirt_dir}/apex-virsh-net.xml) << EOF
+<network ipv6='yes'>
+<name>$network</name>
+<bridge name='${NET_MAP[$network]}'/>
+</network>
+EOF
+ if ! (virsh net-list --all | grep $network > /dev/null); then
+ echo "${red}ERROR: unable to create network: ${network}${reset}"
+ exit 1;
+ fi
+ rm -f ${libvirt_dir}/apex-virsh-net.xml &> /dev/null;
+ virsh net-list | grep -E "$network\s+active" > /dev/null || virsh net-start $network
+ virsh net-list | grep -E "$network\s+active\s+yes" > /dev/null || virsh net-autostart --network $network
+ done
+
+ echo -e "${blue}INFO: Bridges set: ${reset}"
+ brctl show
fi
+ echo -e "${blue}INFO: virsh networks set: ${reset}"
+ virsh net-list
+
# ensure storage pool exists and is started
virsh pool-list --all | grep default > /dev/null || virsh pool-define-as --name default dir --target /var/lib/libvirt/images
virsh pool-list | grep -Eo "default\s+active" > /dev/null || (virsh pool-autostart default; virsh pool-start default)
@@ -638,7 +641,7 @@ function configure_network_environment {
##Copy over the glance images and instackenv json file
##params: none
function configure_undercloud {
-
+ local controller_nic_template compute_nic_template
echo
echo "Copying configuration files to Undercloud"
if [[ "$net_isolation_enabled" == "TRUE" ]]; then
@@ -646,13 +649,22 @@ function configure_undercloud {
echo -e "${blue}Network Environment set for Deployment: ${reset}"
cat $CONFIG/network-environment.yaml
scp ${SSH_OPTIONS[@]} $CONFIG/network-environment.yaml "stack@$UNDERCLOUD":
+ if ! controller_nic_template=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-controller.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
+ echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}"
+ exit 1
+ fi
+
+ if ! compute_nic_template=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-compute.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
+ echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}"
+ exit 1
+ fi
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI
mkdir nics/
cat > nics/controller.yaml << EOF
-$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-controller.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family)
+$controller_nic_template
EOF
cat > nics/compute.yaml << EOF
-$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-compute.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family)
+$compute_nic_template
EOF
EOI
fi
@@ -784,12 +796,12 @@ function undercloud_prep_overcloud_deploy {
elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then
echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}"
exit 1
- elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'false' ]]; then
+ elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
SDN_IMAGE=opendaylight
else
echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"
- echo "${red}Valid choices are opendaylight, opendaylight-external, onos, opencontrail, false, or null${reset}"
+ echo "${red}Valid choices are opendaylight, opendaylight-external, onos, opencontrail, False, or null${reset}"
exit 1
fi
@@ -805,6 +817,17 @@ function undercloud_prep_overcloud_deploy {
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
+ # Push performance options to subscript to modify per-role images as needed
+ for option in "${performance_options[@]}" ; do
+ echo -e "${blue}Setting performance option $option${reset}"
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "bash build_perf_image.sh $option"
+ done
+
+ # Add performance deploy options if they have been set
+ if [ ! -z "${deploy_options_array['performance']}" ]; then
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml"
+ fi
+
# make sure ceph is installed
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
@@ -856,6 +879,9 @@ source stackrc
set -o errexit
echo "Uploading overcloud glance images"
openstack overcloud image upload
+
+bash -x set_perf_images.sh ${performance_roles}
+
echo "Configuring undercloud and discovering nodes"
openstack baremetal import --json instackenv.json
openstack baremetal configure boot
@@ -1182,6 +1208,7 @@ main() {
exit 1
fi
if [ -n "$DEPLOY_SETTINGS_FILE" ]; then
+ echo -e "${blue}INFO: Parsing deploy settings file...${reset}"
parse_deploy_settings
fi
setup_undercloud_vm