You might see the following lab activity types in this course:
A guided exercise is a hands-on practice exercise that follows a presentation section. It walks you through a procedure to perform, step by step.
A quiz is typically used when checking knowledge-based learning, or when a hands-on activity is impractical for some other reason.
An end-of-chapter lab is a graded hands-on activity to help you to check your learning. You work through a set of high-level steps, based on the guided exercises in that chapter, but the steps do not walk you through every command. A solution is provided with a step-by-step walk-through.
A comprehensive review lab is used at the end of the course. It is also a graded hands-on activity, and might cover content from the entire course. You work through a specification of what to accomplish in the activity, without receiving the specific steps to do so. Again, a solution is provided with a step-by-step walk-through that meets the specification.
To prepare your lab environment at the start of each hands-on activity, run the lab start command with a specified activity name from the activity's instructions.
Likewise, at the end of each hands-on activity, run the lab finish command with that same activity name to clean up after the activity.
Each hands-on activity has a unique name within a course.
The syntax for running an exercise script is as follows:
[student@workstation ~]$ lab exercise actionThe action is a choice of start, grade, or finish.
All exercises support start and finish.
Only end-of-chapter labs and comprehensive review labs support grade.
The start action verifies the required resources to begin an exercise.
It might include configuring settings, creating resources, checking prerequisite services, and verifying necessary outcomes from previous exercises.
You can perform an exercise at any time, even without performing preceding exercises.
For graded activities, the grade action directs the lab command to evaluate your work, and shows a list of grading criteria with a PASS or FAIL status for each.
To achieve a PASS status for all criteria, fix the failures and rerun the grade action.
The finish action cleans up resources that were configured during the exercise.
You can perform an exercise as many times as you want.
The lab command supports tab completion.
For example, to list all exercises that you can start, enter lab start and then press the Tab key twice.
When you run the lab command with a valid exercise and action, it creates one log file in the /tmp/log/labs directory, and also creates the directory itself if it does not exist.
The created exercise file captures any error messages from your terminal.
[student@workstation ~]$ls -l /tmp/log/labs-rw-rw-r--. 1 student student 1024 Apr 25 12:00comprehensive-review
Exercise scripts send output to the log file when the scripts fail. Thus, the exercise log is useful for troubleshooting.
Although exercise scripts are always run from the workstation machine, they perform tasks on other systems in the course environment.
Many course environments, including OpenStack and OpenShift, use a command-line tool from the workstation machine to communicate with server systems by using API calls.
Because script actions typically distribute tasks to many systems, additional troubleshooting is necessary to determine where a failed task occurred. Log in to those other systems and use Linux diagnostic skills to read local system log files and determine the root cause of a lab script failure.