summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild/instack.sh14
-rwxr-xr-xci/deploy.sh72
2 files changed, 81 insertions, 5 deletions
diff --git a/build/instack.sh b/build/instack.sh
index f3a366a0..54f05d54 100755
--- a/build/instack.sh
+++ b/build/instack.sh
@@ -226,8 +226,14 @@ PACKAGES+=",openstack-nova-api,openstack-nova-cert,openstack-heat-api-cfn,openst
PACKAGES+=",openstack-ceilometer-central,openstack-ceilometer-polling,openstack-ceilometer-collector,"
PACKAGES+=",openstack-heat-api-cloudwatch,openstack-heat-engine,openstack-heat-common,openstack-ceilometer-notification"
PACKAGES+=",hiera,puppet,memcached,keepalived,mariadb,mariadb-server,rabbitmq-server,python-pbr,python-proliantutils"
-
-LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES -a instack.qcow2
+PACKAGES+=",ceph-common"
+
+# install the packages above and enabling ceph to live on the controller
+LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES \
+ --run-command "sed -i '/ControllerEnableCephStorage/c\\ ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
+ --run-command "sed -i '/ \$enable_ceph = /c\\ \$enable_ceph = true' /usr/share/openstack-tripleo-heat-templates/puppet/manifests/overcloud_controller_pacemaker.pp" \
+ --run-command "sed -i '/ \$enable_ceph = /c\\ \$enable_ceph = true' /usr/share/openstack-tripleo-heat-templates/puppet/manifests/overcloud_controller.pp" \
+ -a instack.qcow2
popd
@@ -238,8 +244,10 @@ cp overcloud-full.qcow2 overcloud-full-odl.qcow2
# remove unnecessary packages and install necessary packages
LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y openstack-neutron-openvswitch" \
+ --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
--upload /etc/yum.repos.d/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
- --install opendaylight,python-networking-odl -a overcloud-full-odl.qcow2
+ --install opendaylight,python-networking-odl,ceph \
+ -a overcloud-full-odl.qcow2
## WORK AROUND
## when OpenDaylight lands in upstream RDO manager this can be removed
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 9d5d9d28..bcc9c4b0 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -26,6 +26,7 @@ ha_enabled="TRUE"
ping_site="8.8.8.8"
ntp_server="pool.ntp.org"
net_isolation_enabled="TRUE"
+post_config="TRUE"
declare -i CNT
declare UNDERCLOUD
@@ -370,7 +371,7 @@ function configure_deps {
elif [ "$virtual" == "FALSE" ]; then
virsh_enabled_networks="admin_network public_network"
else
- virsh_enabled_neworks=$enabled_network_list
+ virsh_enabled_networks=$enabled_network_list
fi
for network in ${OPNFV_NETWORK_TYPES}; do
@@ -678,8 +679,13 @@ if [[ "$net_isolation_enabled" == "TRUE" ]]; then
openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_network_dhcp_range##*,}
openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_network_introspection_range}
openstack-config --set undercloud.conf DEFAULT undercloud_debug false
+
fi
+sudo sed -i '/CephClusterFSID:/c\\ CephClusterFSID: \\x27$(cat /proc/sys/kernel/random/uuid)\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
+sudo sed -i '/CephMonKey:/c\\ CephMonKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
+sudo sed -i '/CephAdminKey:/c\\ CephAdminKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
+
openstack undercloud install &> apex-undercloud-install.log
sleep 30
sudo systemctl restart openstack-glance-api
@@ -710,6 +716,9 @@ function undercloud_prep_overcloud_deploy {
exit 1
fi
+ # make sure ceph is installed
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
+
# check if HA is enabled
if [[ "$ha_enabled" == "TRUE" ]]; then
DEPLOY_OPTIONS+=" --control-scale 3 --compute-scale 2"
@@ -756,9 +765,54 @@ echo "Configuring nameserver on ctlplane network"
neutron subnet-update \$(neutron subnet-list | grep -v id | grep -v \\\\-\\\\- | awk {'print \$2'}) --dns-nameserver 8.8.8.8
echo "Executing overcloud deployment, this should run for an extended period without output."
sleep 60 #wait for Hypervisor stats to check-in to nova
+# save deploy command so it can be used for debugging
+cat > deploy_command << EOF
openstack overcloud deploy --templates $DEPLOY_OPTIONS
+EOF
+openstack overcloud deploy --templates $DEPLOY_OPTIONS
+EOI
+
+}
+
+##Post configuration after install
+##params: none
+function configure_post_install {
+ local opnfv_attach_networks ovs_ip ip_range net_cidr tmp_ip
+ opnfv_attach_networks="admin_network public_network"
+
+ echo -e "${blue}INFO: Post Install Configuration Running...${reset}"
+
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+source stackrc
+set -o errexit
+echo "Configuring Neutron external network"
+neutron net-create external --router:external=True
+neutron subnet-create --name external-net --disable-dhcp external --gateway ${public_network_gateway} --allocation-pool start=${public_network_floating_ip_range%%,*},end=${public_network_floating_ip_range##*,} ${public_network_cidr}
EOI
+ echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}"
+ for network in ${opnfv_attach_networks}; do
+ ovs_ip=$(find_ip ${NET_MAP[$network]})
+ tmp_ip=''
+ if [ -n "$ovs_ip" ]; then
+ echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} has IP address ${ovs_ip}${reset}"
+ else
+ echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} missing IP, will configure${reset}"
+ # use last IP of allocation pool
+ eval "ip_range=\${${network}_usable_ip_range}"
+ ovs_ip=${ip_range##*,}
+ eval "net_cidr=\${${network}_cidr}"
+ sudo ip addr add ${ovs_ip}/${net_cidr##*/} dev ${NET_MAP[$network]}
+ tmp_ip=$(find_ip ${NET_MAP[$network]})
+ if [ -n "$tmp_ip" ]; then
+ echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} IP set: ${tmp_ip}${reset}"
+ continue
+ else
+ echo -e "${red}ERROR: Unable to set OVS Bridge ${NET_MAP[$network]} with IP: ${ovs_ip}${reset}"
+ return 1
+ fi
+ fi
+ done
}
display_usage() {
@@ -771,7 +825,8 @@ display_usage() {
echo -e " -r|--resources : Directory to deployment resources. Optional. Defaults to /var/opt/opnfv/stack \n"
echo -e " -v|--virtual : Virtualize overcloud nodes instead of using baremetal. \n"
echo -e " --no-ha : disable High Availability deployment scheme, this assumes a single controller and single compute node \n"
- echo -e " --flat : disable Network Isolation and use a single flat network for the underlay network."
+ echo -e " --flat : disable Network Isolation and use a single flat network for the underlay network.\n"
+ echo -e " --no-post-config : disable Post Install configuration."
}
##translates the command line parameters into variables
@@ -833,6 +888,11 @@ parse_cmdline() {
echo "Underlay Network Isolation Disabled: using flat configuration"
shift 1
;;
+ --no-post-config )
+ post_config="FALSE"
+ echo "Post install configuration disabled"
+ shift 1
+ ;;
*)
display_usage
exit 1
@@ -895,6 +955,14 @@ main() {
fi
configure_undercloud
undercloud_prep_overcloud_deploy
+ if [ "$post_config" == "TRUE" ]; then
+ if ! configure_post_install; then
+ echo -e "${red}ERROR:Post Install Configuration Failed, Exiting.${reset}"
+ exit 1
+ else
+ echo -e "${blue}INFO: Post Install Configuration Complete${reset}"
+ fi
+ fi
}
main "$@"