summaryrefslogtreecommitdiffstats
path: root/ci/deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/deploy.sh')
-rwxr-xr-xci/deploy.sh114
1 files changed, 104 insertions, 10 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index da534a5c..da1d29e2 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -291,7 +291,7 @@ function configure_deps {
virsh net-list --all | grep -E "default\s+active\s+yes" > /dev/null || virsh net-autostart --network default
if [[ -z "$virtual" || "$virtual" == "FALSE" ]]; then
- for network in ${OPNFV_NETWORK_TYPES}; do
+ for network in ${enabled_network_list}; 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
@@ -523,7 +523,7 @@ EOF
for i in $(seq 0 $vm_index); do
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; do
+ for n in private_network public_network storage_network api_network; do
if [[ $enabled_network_list =~ $n ]]; then
echo -n "$n "
virsh attach-interface --domain baremetal${i} --type network --source $n --model rtl8139 --config
@@ -535,6 +535,13 @@ 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",
@@ -547,7 +554,8 @@ EOF
"cpu": "$vcpus",
"memory": "$ramsize",
"disk": "41",
- "arch": "x86_64"
+ "arch": "x86_64",
+ "capabilities": "$capability"
},
EOF
done
@@ -567,6 +575,12 @@ EOF
"ssh-user": "root"
}
EOF
+ #Overwrite the tripleo-inclubator domain.xml with our own, keeping a backup.
+ if [ ! -f /usr/share/tripleo/templates/domain.xml.bak ]; then
+ /usr/bin/mv -f /usr/share/tripleo/templates/domain.xml /usr/share/tripleo/templates/domain.xml.bak
+ fi
+
+ /usr/bin/cp -f $LIB/installer/domain.xml /usr/share/tripleo/templates/domain.xml
}
##Create virtual nodes in virsh
@@ -789,6 +803,12 @@ function undercloud_prep_overcloud_deploy {
exit 1
fi
+ # Handle different dataplanes
+ if [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
+ echo "${red}ovs is the only currently available dataplane. ${deploy_options_array['dataplane']} not implemented${reset}"
+ exit 1
+ fi
+
# Make sure the correct overcloud image is available
if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment."
@@ -801,14 +821,83 @@ 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
+ # Install ovs-dpdk inside the overcloud image if it is enabled.
+ if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
+ # install dpdk packages before ovs
+ echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
+
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ cat << EOF > vfio_pci.modules
+#!/bin/bash
+exec /sbin/modprobe vfio_pci >/dev/null 2>&1
+EOF
+
+ cat << EOF > uio_pci_generic.modules
+#!/bin/bash
+exec /sbin/modprobe uio_pci_generic >/dev/null 2>&1
+EOF
+
+ LIBGUESTFS_BACKEND=direct virt-customize --upload vfio_pci.modules:/etc/sysconfig/modules/ \
+ --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" \
+ -a overcloud-full.qcow2
+EOI
+
+ fi
+
+ # Set ODL version accordingly
+ if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['odl_version']}" == 'boron' ]]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
+ --run-command "yum -y install /root/boron/*" \
+ -a overcloud-full.qcow2
+EOI
+ fi
# Add performance deploy options if they have been set
if [ ! -z "${deploy_options_array['performance']}" ]; then
+
+ # Remove previous kernel args files per role
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f Compute-kernel_params.txt"
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f Controller-kernel_params.txt"
+
+ # 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
+
+ # Build IPA kernel option ramdisks
+ ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" <<EOI
+/bin/cp -f /home/stack/ironic-python-agent.initramfs /root/
+mkdir -p ipa/
+pushd ipa
+gunzip -c ../ironic-python-agent.initramfs | cpio -i
+if [ ! -f /home/stack/Compute-kernel_params.txt ]; then
+ touch /home/stack/Compute-kernel_params.txt
+ chown stack /home/stack/Compute-kernel_params.txt
+fi
+/bin/cp -f /home/stack/Compute-kernel_params.txt tmp/kernel_params.txt
+echo "Compute params set: "
+cat tmp/kernel_params.txt
+/bin/cp -f /root/image.py usr/lib/python2.7/site-packages/ironic_python_agent/extensions/image.py
+/bin/cp -f /root/image.pyc usr/lib/python2.7/site-packages/ironic_python_agent/extensions/image.pyc
+find . | cpio -o -H newc | gzip > /home/stack/Compute-ironic-python-agent.initramfs
+chown stack /home/stack/Compute-ironic-python-agent.initramfs
+if [ ! -f /home/stack/Controller-kernel_params.txt ]; then
+ touch /home/stack/Controller-kernel_params.txt
+ chown stack /home/stack/Controller-kernel_params.txt
+fi
+/bin/cp -f /home/stack/Controller-kernel_params.txt tmp/kernel_params.txt
+echo "Controller params set: "
+cat tmp/kernel_params.txt
+find . | cpio -o -H newc | gzip > /home/stack/Controller-ironic-python-agent.initramfs
+chown stack /home/stack/Controller-ironic-python-agent.initramfs
+popd
+/bin/rm -rf ipa/
+EOI
+
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml"
fi
@@ -864,11 +953,10 @@ 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
+bash -x set_perf_images.sh ${performance_roles[@]}
#if [[ -z "$virtual" ]]; then
# openstack baremetal introspection bulk start
#fi
@@ -939,6 +1027,12 @@ set -o errexit
echo "Configuring Neutron external network"
neutron net-create external --router:external=True --tenant-id \$(keystone tenant-get service | grep id | awk '{ print \$4 }')
neutron subnet-create --name external-net --tenant-id \$(keystone tenant-get service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${public_network_gateway} --allocation-pool start=${public_network_floating_ip_range%%,*},end=${public_network_floating_ip_range##*,} ${public_network_cidr}
+
+echo "Removing swift endpoint and service"
+swift_service_id=\$(keystone service-list | grep swift | cut -d ' ' -f 2)
+swift_endpoint_id=\$(keystone endpoint-list | grep \$swift_service_id | cut -d ' ' -f 2)
+keystone endpoint-delete \$swift_endpoint_id
+keystone service-delete \$swift_service_id
EOI
echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}"