Installing Linux distributions on the Z platform can be challenging and time-consuming. Since Z is a complex environment, professionals who don’t use it much often run into issues. That’s where Tessia comes in handy.
Hosted by the Open Mainframe project, Tessia is an open source tool that automates the installation, configuration, and testing of Linux distros running on Z.
Alexander Efremkin, a software engineer at IBM and Tessia lead, shows how to self-provision Linux distros on Z by integrating Tessia, in a presentation at the Open Mainframe Summit 2021 event. If you missed it, watch the video below.
Before learning how Tessia works, let’s learn more about what Tessia is and what it does.
What Is Tessia?
Tessia is an open-source tool. Think of it as a task execution support and system installation assistant. It’s part of the Open Mainframe Project.
Tessia can help you:
- automate tasks related to installation
- manage your resources
- integrate with different resources by using its CLI (command-line interface) and REST API
With Tessia, you can install a Linux distro on Z in the blink of an eye, start ansible jobs on target machines, and manage resources easily.
Why Would You Need Tessia?
Z is a very complex environment, with many possible hardware and software options. That means that are many choices to be made about which persistent storage, network, and virtualization method you use.
Operating Systems Supported by Tessia
Tessia comes out of the box with support for some OSs:
- RHEL (Red Hat Enterprise Linux) 7, 8
- SLES (SUSE Linux Enterprise Server) 12, 15
- Ubuntu 16, 18, 20
How Do You Use Tessia?
There are two main ways to use Tessia: through its CLI and REST API. Both methods issue commands that can fire up jobs or changes to the database. More on that later.
Tessia: Running a Smoke Test With Rundeck
After properly installing and configuring Tessia, a recommended next step is to run a quick sanity check using a runbook tool, such as Rundeck. The check consists of verifying whether we’re able to use Tessia’s interface through Rundeck, and it’s very simple to perform:
- Using Rundeck, create a project.
- Then locate Tessia’s server to run commands.
- Finally, try out a configuration check with the command tess conf show.
Once you complete the check successfully, you can move on to more complicated scenarios.
Tessia: Workflow for Provisioning a Job
You can use Tessia to create a workflow for provisioning a job. This workflow should be capable of two things:
- Reserve a free system in a resource pool
- Prepare the system (boot, install OS, run additional jobs)
Let’s look at an example workflow.
Define the Resource Pools
Before creating the job, the first step is to define these resource pools in Tessia. This consists of defining a job to add all of the needed resources, which can include:
- network addresses
Note that you might have to provide sensitive information during these steps. Be sure to retrieve that information from secure storage. Tessia can parameterize it, taking it as a job option or retrieving it from a key store. Adding resources one by one is time-consuming. Tessia offers bulk import and export operations to speed up those tasks.
Find a Free System
When everything that’s needed is in a pool group, Tessia can create the provisioning job. The first step of the job is to find a free system in the resource pool. With the help of the command line, it’s possible to find a free system in the resource pool. You can do it with the following Tessia command:
tess system list –project pool –long
It’s also important to retrieve the output from the previous command. You can use a regular expression pattern to extract the value you need:
Move the System to a Different Resource Pool
The next step is taking the system from the resource pool and moving it to a different pool:
tess system edit –system $(data.system) –project amp
Run an Installation Task
The final step is to run an automatic installation step, which is also a one-liner:
tess system autoinstall –system $(data.system) –os ubuntu20.04.02
The command above installs a point release of Ubuntu 20, the latest long-term support version at the time of this writing. Of course, as you’ve seen, Tessia offers support for different versions of Linux, and the options from the command above can be parameterized as well.
Run and Verify the Job
After configuring the steps, you can run the job. The job executes in the background, and you can access its logs:
This overview offered a glance at how we can use Tessia to provision a Linux system on Z. We executed commands against Tessia’s CLI via Rundeck. However, we could have performed all of the same actions via Tessia’s API with the same results. Instead of running commands, you’d be making HTTP requests to Tessia’s server. And instead of capturing the output from the command line and extracting the information with regex, you’d parse a JSON response instead.
This has been recap of Open Mainframe Summit 2021. If you’d like to learn more about Open Mainframe Summit 2022, hosted in Philadelphia, PA on September 21-22, please click here: https://events.linuxfoundation.org/open-mainframe-summit/ .
This post was written by Carlos Schults. Carlos is a consultant and software engineer with experience in desktop, web, and mobile development. Though his primary language is C#, he has experience with a number of languages and platforms. His main interests include automated testing, version control, and code quality.