- grep "OS-EXT-SRV-ATTR:host" | awk '{ print $4 }' |
- awk -F '.' '{print $1}')
- if [[ -z "$COMPUTE_HOST" ]] ; then
- echo "ERROR: failed to get compute hostname"
- exit 1
- fi
- if [[ "$INSTALLER_TYPE" == "apex" ]] ; then
- COMPUTE_USER=${COMPUTE_USER:-heat-admin}
- if [[ "$INSTALLER_IP" == "none" ]] ; then
- instack_mac=$(sudo virsh domiflist instack | awk '/default/{print $5}')
- INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk '{print $1}')
- fi
- COMPUTE_IP=$(sudo ssh $ssh_opts $INSTALLER_IP \
- "source stackrc; \
- nova show $COMPUTE_HOST \
- | awk '/ ctlplane network /{print \$5}'")
- elif [[ "$INSTALLER_TYPE" == "local" ]] ; then
- COMPUTE_USER=${COMPUTE_USER:-$(whoami)}
- COMPUTE_IP=$(getent hosts "$COMPUTE_HOST" | awk '{ print $1 }')
- if [[ -z "$COMPUTE_IP" ]]; then
- echo "ERROR: Could not resolve $COMPUTE_HOST. Either manually set COMPUTE_IP or enable DNS resolution."
- exit 1
- fi
- fi
+ grep "OS-EXT-SRV-ATTR:host" | awk '{ print $4 }')
+ compute_host_in_undercloud=${COMPUTE_HOST%%.*}
+ die_if_not_set $LINENO COMPUTE_HOST "Failed to get compute hostname"
+
+ get_compute_ip_from_hostname $COMPUTE_HOST
+
+ echo "COMPUTE_HOST=$COMPUTE_HOST"
+ echo "COMPUTE_IP=$COMPUTE_IP"