Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayobe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kayobe
Commits
6b19b817
Commit
6b19b817
authored
4 years ago
by
Zuul
Committed by
Gerrit Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "CI: Test SSH connectivity to deployed instances"
parents
95a4d7e0
02327b1c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/functions
+34
-1
34 additions, 1 deletion
dev/functions
with
34 additions
and
1 deletion
dev/functions
+
34
−
1
View file @
6b19b817
...
...
@@ -425,6 +425,11 @@ function overcloud_test_init {
export
ENABLE_EXT_NET
=
0
${
KOLLA_VENV_PATH
:-
$HOME
/kolla-venv
}
/share/kolla-ansible/init-runonce
unset
ENABLE_EXT_NET
# Allow provision-net to be used as an external network for floating IPs.
# Note: a provisioning network would not normally be external.
openstack network
set
provision-net
--external
openstack router
set
demo-router
--external-gateway
provision-net
else
echo
"Not running kolla-ansible init-runonce - resources exist"
fi
...
...
@@ -454,7 +459,35 @@ function overcloud_test {
echo
"
$name
: Node creation failed"
return
1
fi
# TODO(mgoddard): Test SSH connectivity to the VM.
# Test SSH connectivity. For servers attached directly to the external
# network, use the fixed IP. Otherwise add a floating IP.
if
[[
$network
=
provision-net
]]
;
then
ip
=
$(
openstack server show
"
$name
"
-f
value
-c
addresses |
sed
-e
"s/
${
network
}
=//"
)
else
echo
"
$name
: Attaching floating IP"
ip
=
$(
openstack floating ip create provision-net
-f
value
-c
floating_ip_address
)
openstack server add floating ip
${
name
}
${
ip
}
fi
echo
"
$name
: Waiting for ping and SSH access via
${
ip
}
"
attempts
=
6
for
i
in
$(
seq
1
$attempts
)
;
do
if
ping
-c1
-W1
$ip
&&
ssh
-v
-o
StrictHostKeyChecking
=
no
-o
BatchMode
=
yes
cirros@
$ip
hostname
;
then
break
elif
[[
$i
-eq
$attempts
]]
;
then
echo
"Failed to access server
$name
via SSH after
$attempts
attempts"
return
1
else
echo
"Cannot access server
$name
- retrying"
fi
sleep
10
done
echo
"
$name
: Ping and SSH successful"
if
[[
$network
!=
provision-net
]]
;
then
echo
"
$name
: Removing floating IP"
openstack server remove floating ip
${
name
}
${
ip
}
openstack floating ip delete
${
ip
}
fi
echo
"
$name
: Deleting the Node"
openstack server delete
--wait
"
$name
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment