# avoid some network problems dpends on infra and installers.
# This tunnel will be terminated by stop_consumer() or after 10 mins passed.
if [[ "$INSTALLER_TYPE" == "apex" ]] ; then
- CONTROLLER_IPS=$(nova list | grep ' overcloud-controller-[0-9] ' \
- | sed -e 's/^.*ctlplane=//' -e 's/ *|$//')
+ CONTROLLER_IPS=$(sudo ssh $ssh_opts $INSTALLER_IP \
+ "source stackrc; \
+ nova list | grep ' overcloud-controller-[0-9] ' \
+ | sed -e 's/^.*ctlplane=//' -e 's/ *|\$//'")
fi
if [[ -z "$CONTROLLER_IPS" ]]; then
echo "ERROR: Could not get CONTROLLER_IPS."
for ip in $CONTROLLER_IPS
do
forward_rule="-R $CONSUMER_PORT:localhost:$CONSUMER_PORT"
- tunnel_command="sudo ssh $ssh_opts $ip $forward_rule sleep 600"
+ tunnel_command="sudo ssh $ssh_opts_cpu $COMPUTE_USER@$ip $forward_rule sleep 600"
$tunnel_command > "ssh_tunnel.${ip}.log" 2>&1 < /dev/null &
done
}
for ip in $CONTROLLER_IPS
do
forward_rule="-R $CONSUMER_PORT:localhost:$CONSUMER_PORT"
- tunnel_command="sudo ssh $ssh_opts $ip $forward_rule sleep 600"
+ tunnel_command="sudo ssh $ssh_opts_cpu $COMPUTE_USER@$ip $forward_rule sleep 600"
kill $(pgrep -f "$tunnel_command")
print_log "ssh_tunnel.${ip}.log"
done