diff options
Diffstat (limited to 'lib/undercloud-functions.sh')
-rwxr-xr-x | lib/undercloud-functions.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh index 6ba9a545..080fcbbd 100755 --- a/lib/undercloud-functions.sh +++ b/lib/undercloud-functions.sh @@ -19,7 +19,7 @@ function setup_undercloud_vm { define_vm undercloud hd 30 "$undercloud_nets" 4 12288 ### this doesn't work for some reason I was getting hangup events so using cp instead - #virsh vol-upload --pool default --vol undercloud.qcow2 --file $CONFIG/stack/undercloud.qcow2 + #virsh vol-upload --pool default --vol undercloud.qcow2 --file $BASE/stack/undercloud.qcow2 #2015-12-05 12:57:20.569+0000: 8755: info : libvirt version: 1.2.8, package: 16.el7_1.5 (CentOS BuildSystem <http://bugs.centos.org>, 2015-11-03-13:56:46, worker1.bsys.centos.org) #2015-12-05 12:57:20.569+0000: 8755: warning : virKeepAliveTimerInternal:143 : No response from client 0x7ff1e231e630 after 6 keepalive messages in 35 seconds #2015-12-05 12:57:20.569+0000: 8756: warning : virKeepAliveTimerInternal:143 : No response from client 0x7ff1e231e630 after 6 keepalive messages in 35 seconds @@ -28,14 +28,14 @@ function setup_undercloud_vm { #error: Reconnected to the hypervisor local undercloud_dst=/var/lib/libvirt/images/undercloud.qcow2 - cp -f $RESOURCES/undercloud.qcow2 $undercloud_dst + cp -f $IMAGES/undercloud.qcow2 $undercloud_dst # resize Undercloud machine echo "Checking if Undercloud needs to be resized..." undercloud_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a $undercloud_dst |grep device | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') if [ "$undercloud_size" -lt 30 ]; then qemu-img resize /var/lib/libvirt/images/undercloud.qcow2 +25G - LIBGUESTFS_BACKEND=direct virt-resize --expand /dev/sda1 $RESOURCES/undercloud.qcow2 $undercloud_dst + LIBGUESTFS_BACKEND=direct virt-resize --expand /dev/sda1 $IMAGES/undercloud.qcow2 $undercloud_dst LIBGUESTFS_BACKEND=direct virt-customize -a $undercloud_dst --run-command 'xfs_growfs -d /dev/sda1 || true' new_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a $undercloud_dst |grep filesystem | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') if [ "$new_size" -lt 30 ]; then @@ -71,12 +71,12 @@ function setup_undercloud_vm { CNT=10 echo -n "${blue}Waiting for Undercloud's dhcp address${reset}" undercloud_mac=$(virsh domiflist undercloud | grep default | awk '{ print $5 }') - while ! $(arp -e | grep ${undercloud_mac} > /dev/null) && [ $CNT -gt 0 ]; do + while ! $(arp -en | grep ${undercloud_mac} > /dev/null) && [ $CNT -gt 0 ]; do echo -n "." sleep 10 CNT=$((CNT-1)) done - UNDERCLOUD=$(arp -e | grep ${undercloud_mac} | awk {'print $1'}) + UNDERCLOUD=$(arp -en | grep ${undercloud_mac} | awk {'print $1'}) if [ -z "$UNDERCLOUD" ]; then echo "\n\nCan't get IP for Undercloud. Can Not Continue." @@ -136,12 +136,12 @@ function configure_undercloud { ovs_dpdk_bridge='' fi - if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then + if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e "br-ex"); then echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" exit 1 fi - if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then + if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" exit 1 fi @@ -207,6 +207,10 @@ openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.$ sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30 sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40 +if [[ -n "${deploy_options_array['ceph_device']}" ]]; then + sed -i '/ExtraConfig/a\\ ceph::profile::params::osds: {\\x27${deploy_options_array['ceph_device']}\\x27: {}}' ${ENV_FILE} +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 @@ -249,6 +253,7 @@ sudo systemctl restart openstack-heat-api EOI # configure external network +if [[ "$enabled_network_list" =~ "external" ]]; then ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" << EOI if [[ "$external_installer_vm_vlan" != "native" ]]; then cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-vlan${external_installer_vm_vlan} @@ -270,6 +275,7 @@ else fi fi EOI +fi # WORKAROUND: must restart the above services to fix sync problem with nova compute manager # TODO: revisit and file a bug if necessary. This should eventually be removed |