summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Ovsianikov <sovsianikov@mirantis.com>2016-05-24 18:18:32 +0300
committerSerhiy Ovsianikov <sovsianikov@mirantis.com>2016-05-26 17:59:39 +0300
commitcc86e3997f96f02eca6234d1282d746ba162023a (patch)
treeb9c2525402d61efa1939c3f456c86b043e51349f
parent46f785a4898a0bcdff43446c5d2c53f75b51b0c2 (diff)
Additional verification of network interface settings
In some cases, VBoxManage utility can't assign network interface parameters on the first try. This commit adds additional checks of network interface settings and re-assigns the network settings if the first attempt was unsuccessful. Change-Id: If8a24ec44257b47e221477c46e93e3f62e63a07d Closes-Bug: #1535742
Notes
Notes (review): Code-Review+2: Maksim Malchuk <mmalchuk@mirantis.com> Code-Review+1: Sergey Kulanov <skulanov@mirantis.com> Workflow+1: Maksim Malchuk <mmalchuk@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 02 Jun 2016 08:51:39 +0000 Reviewed-on: https://review.openstack.org/320535 Project: openstack/fuel-virtualbox Branch: refs/heads/master
-rwxr-xr-xfunctions/network.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/functions/network.sh b/functions/network.sh
index 3777479..2b9616f 100755
--- a/functions/network.sh
+++ b/functions/network.sh
@@ -153,10 +153,19 @@ create_hostonly_interfaces() {
153 echo "Configuring IP address $ip and network mask $mask on interface: $name..." 153 echo "Configuring IP address $ip and network mask $mask on interface: $name..."
154 execute VBoxManage hostonlyif ipconfig "$id" --ip $ip --netmask $mask 154 execute VBoxManage hostonlyif ipconfig "$id" --ip $ip --netmask $mask
155 # Check what we have created actually. 155 # Check what we have created actually.
156 # Sometimes VBox occasionally fails to apply settings to the last IFace under Windows 156 # Sometimes VBox occasionally fails to apply settings to the last IFace under Windows and CentOS
157 if !(check_if_iface_settings_applied "$id" $ip $mask); then 157 local count_set=3;
158 while [[ $count_set > 0 ]] && !(check_if_iface_settings_applied "$id" $ip $mask); do
159 count_set=$(($count_set-1));
160 echo
158 echo "Looks like VirtualBox failed to apply settings for interface $name" 161 echo "Looks like VirtualBox failed to apply settings for interface $name"
159 echo "Sometimes such error happens under Windows." 162 echo "Trying to apply network settings for interface $name one more time..."
163 echo "Configuring IP address $ip and network mask $mask on interface: $name..."
164 sleep ${net_sleep}
165 execute VBoxManage hostonlyif ipconfig "$id" --ip $ip --netmask $mask
166 done
167 if [[ $count_set == 0 ]] && !(check_if_iface_settings_applied "$id" $ip $mask); then
168 echo "Sometimes such error happens under Windows and CentOS."
160 echo "Please run launch.sh one more time." 169 echo "Please run launch.sh one more time."
161 echo "If this error remains after several attempts, then something really went wrong." 170 echo "If this error remains after several attempts, then something really went wrong."
162 echo "Aborting." 171 echo "Aborting."