Commit 23438c2d authored by David Johnson's avatar David Johnson

Tweak grafana instructions; expose setup script logs via nginx :7999.

parent 30ea5d3f
......@@ -446,15 +446,20 @@ passwdHelp = "Your OpenStack admin and instance VM password is randomly-generate
### pass
passwdHelp += " When logging in to the Dashboard, use the `admin` user; when logging into instance VMs, use the `ubuntu` user. If you have selected Mitaka or newer, use 'default' as the Domain at the login prompt."
grafanaInstructions = ""
if params.release in [ "pike","queens","rocky" ]:
grafanaInstructions = "You can also login to [your experiment's Grafana WWW interface](http://{host-%s}:3000/dashboard/db/openstack-instance-statistics?orgId=1) and view OpenStack statistics once you've created some VMs." % (params.controllerHost)
tourInstructions = \
"""
### Basic Instructions
Once your experiment nodes have booted, and this profile's configuration scripts have finished configuring OpenStack inside your experiment, you'll be able to visit [the OpenStack Dashboard WWW interface](http://{host-%s}/horizon/auth/login/?next=/horizon/project/instances/) (approx. 5-15 minutes). If you've selected the Pike release (or newer), you can also login to [your experiment's Grafana WWW interface](http://{host-%s}:3000/dashboard/db/openstack-instance-statistics?orgId=1) and view OpenStack instance VM statistics once you've created some VMs. %s
Once your experiment nodes have booted, and this profile's configuration scripts have finished configuring OpenStack inside your experiment, you'll be able to visit [the OpenStack Dashboard WWW interface](http://{host-%s}/horizon/auth/login/?next=/horizon/project/instances/) (approx. 5-15 minutes). %s %s
Please wait to login to the OpenStack dashboard until the setup scripts have completed (we've seen Dashboard issues with content not appearing if you login before configuration is complete). There are multiple ways to determine if the scripts have finished:
- First, you can watch the experiment status page: the overall State will say \"booted (startup services are still running)\" to indicate that the nodes have booted up, but the setup scripts are still running.
- Second, the Topology View will show you, for each node, the status of the startup command on each node (the startup command kicks off the setup scripts on each node). Once the startup command has finished on each node, the overall State field will change to \"ready\". If any of the startup scripts fail, you can mouse over the failed node in the topology viewer for the status code.
- Finally, the profile configuration scripts also send you two emails: once to notify you that controller setup has started, and a second to notify you that setup has completed. Once you receive the second email, you can login to the Openstack Dashboard and begin your work.
- Third, the profile configuration scripts also send you two emails: once to notify you that controller setup has started, and a second to notify you that setup has completed. Once you receive the second email, you can login to the Openstack Dashboard and begin your work.
- Finally, you can view [the profile setup script logfiles](http://{host-%s}:7999/) as the setup scripts run. Use the `admin` username and the random password above.
**NOTE:** If the web interface rejects your password or gives another error, the scripts might simply need more time to set up the backend. Wait a few minutes and try again. If you don't receive any email notifications, you can SSH to the 'ctl' node, become root, and check the primary setup script's logfile (/root/setup/setup-controller.log). If near the bottom there's a line that includes 'Your OpenStack instance has completed setup'), the scripts have finished, and it's safe to login to the Dashboard.
......@@ -467,7 +472,7 @@ The profile's setup scripts are automatically installed on each node in `/tmp/se
### Detailed Parameter Documentation
%s
""" % (params.controllerHost,params.controllerHost,passwdHelp,detailedParamAutoDocs)
""" % (params.controllerHost,grafanaInstructions,passwdHelp,params.controllerHost,detailedParamAutoDocs)
#
# Setup the Tour info with the above description and instructions.
......
......@@ -17,6 +17,46 @@ if [ -f $OURDIR/setup-driver-done ]; then
echo "setup-driver already ran; not running again"
exit 0
fi
#
# Setup nginx to show our setup/config directory.
#
if [ "$HOSTNAME" = "$CONTROLLER" ]; then
maybe_install_packages nginx
# Handle case where nginx won't start because the default site
# (which is enabled!) needs port 80, and apache might be listening
# there.
if [ ! $? -eq 0 ]; then
rm -f /etc/nginx/sites-available/default \
/etc/nginx/sites-enabled/default
maybe_install_packages nginx
fi
echo "$ADMIN_PASS" | htpasswd -n -i admin > /etc/nginx/htpasswd
chown www-data:root /etc/nginx/htpasswd
chmod 660 /etc/nginx/htpasswd
mkdir /var/www/profile-setup
chown www-data /var/www/profile-setup
mount -o bind,ro $OURDIR /var/www/profile-setup/
echo $OURDIR /var/www/profile-setup none defaults,bind 0 0 >> /etc/fstab
cat <<EOF >/etc/nginx/sites-available/profile-setup-logs
server {
include /etc/nginx/mime.types;
types { text/plain log; }
listen 7999 default_server;
listen [::]:7999 default_server;
root /var/www/profile-setup;
index index.html;
server_name _;
location / {
autoindex on;
auth_basic "profile-setup";
auth_basic_user_file /etc/nginx/htpasswd;
}
}
EOF
ln -s /etc/nginx/sites-available/profile-setup-logs \
/etc/nginx/sites-enabled/profile-setup-logs
fi
logtstart "driver"
# Copy our source code into $OURDIR for future use:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment