5 # Fetch INSTALLER_IP for APEX deployments
6 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
7 if [ -n "$RC_FILE_PATH" ]; then
8 echo "RC_FILE_PATH is set: ${RC_FILE_PATH}...skipping detecting UC IP"
10 echo "Gathering IP information for Apex installer VM"
11 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
12 if sudo virsh list | grep undercloud; then
13 echo "Installer VM detected"
14 undercloud_mac=$(sudo virsh domiflist undercloud | grep default | \
15 grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
16 export INSTALLER_IP=$(/usr/sbin/arp -e | grep ${undercloud_mac} | awk {'print $1'})
17 export sshkey_vol="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
18 sudo scp $ssh_options root@${INSTALLER_IP}:/home/stack/stackrc ${HOME}/stackrc
19 export stackrc_vol="-v ${HOME}/stackrc:/home/opnfv/functest/conf/stackrc"
21 if sudo iptables -C FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable 2> ${redirect}; then
22 sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
24 if sudo iptables -C FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable 2> ${redirect}; then
25 sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
27 echo "Installer ip is ${INSTALLER_IP}"
29 echo "No available installer VM exists and no credentials provided...exiting"
34 elif [[ ${INSTALLER_TYPE} == 'daisy' ]]; then
35 echo "Gathering IP information for Daisy installer VM"
36 if sudo virsh list | grep daisy; then
37 echo "Installer VM detected"
39 bridge_name=$(sudo virsh domiflist daisy | grep vnet | awk '{print $3}')
40 echo "Bridge is $bridge_name"
42 installer_mac=$(sudo virsh domiflist daisy | grep vnet | \
43 grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
44 export INSTALLER_IP=$(/usr/sbin/arp -e -i $bridge_name | grep ${installer_mac} | head -n 1 | awk {'print $1'})
46 echo "Installer ip is ${INSTALLER_IP}"
48 echo "No available installer VM exists...exiting"
52 elif [[ ${INSTALLER_TYPE} == 'fuel' ]]; then
53 if [[ ! "${BRANCH}" =~ "danube" ]]; then
54 echo "Map mcp ssh_key"
55 export sshkey_vol="-v ${SSH_KEY:-/var/lib/opnfv/mcp.rsa}:/root/.ssh/id_rsa"