Did you know that you can run virtual machines on OpenShift? OpenShift Virtualization is an operator that allows you to do just that. Once the operator is installed, you can run your VMs on OpenShift, side-by-side with your containerized workloads.
OpenShift Virtualization uses KVM, the virtualization software stack that is used in Red Hat Virtualization (RHV), in OpenStack, and in most clouds worldwide, to run the VMs that are managed by OpenShift just like any other workload in the cluster. And just like any other cloud native resource, VMs are also defined and managed as a code. This means that cloud native methodologies and tools that are used with containerized workloads can be applied to VMs as well.
What Is Tekton?
Tekton is a powerful and flexible open-source framework for creating CI/CD systems, allowing developers to build, test, and deploy across cloud providers and on-premise systems.
A Tekton pipeline is a collection of tasks that you define and arrange in a specific order of execution as part of your continuous integration flow. Each task in a pipeline executes as a pod on your Kubernetes cluster. You can configure various execution conditions to fit your needs.
OpenShift pipelines uses Tekton building blocks to automate deployments across multiple platforms. In this blog I will refer to Tekton, but for production environments, OpenShift pipelines is recommended.
Creating and Customizing the OS Installations
Tekton pipelines can control many VM tasks, from a single VM operation to managing the VM's entire life cycle. It can run tasks like downloading a Windows OS image, customizing VM configuration, deploying the VM, and more. This creates VMs that are consistent and that minimize human errors and increase security.
An example of a common process that can be used is Windows OS installation, where a pipeline can manage the unattended sysprep process. You can create a Kubernetes config file that holds the sysprep files (autounattend.xml, etc.) and define a pipeline that provisions a new Windows VM, attaches the config file, and starts the VM. This will trigger the Windows automated unattended installation.
You can think of many other tasks and build your own pipelines. Start by creating multiple Tekton tasks for many of VM operations. Once those stages are ready, use them as building blocks to build Tekton pipelines that can automate the processes you need.
AI/ML and Other Use Cases
Tekton pipelines can include a single task or a few tasks to perform specific operations like customizing VM disks or networks. In more complex operations, a pipeline can include multiple tasks that control the entire VM lifecycle, from creation to termination and deletion.
An interesting use case for a full lifecycle management are AI/ML workloads that may require VMs for things like AI/ML visualization. These VMs can be fully provisioned and managed by Tekton pipelines, from image preparation, attaching a data source, starting the VM that runs the ML module, and once done, shutting down the VM (and in some cases, deleting it). Repeat this pipeline with a new data source as many times as needed.

Summary
With OpenShift Virtualization, VMs are cloud native objects that are declared as code. They share the same API as containers and can be treated just like a container workload. This means that CI/CD processes can include a mix of VMs and containers, and Tekton can run tasks on VMs and containers in a single pipeline, sequentially or in parallel, avoiding silos and eliminating multi-system dependencies.

Tekton (and OpenShift pipelines) is a Kubernetes-native CI/CD framework that can be used with many other CI/CD products to perform a variety of tasks. OpenShift Virtualization brings virtual machines into OpenShift so they are managed with the same API as containers. Because of that, VMs can be managed seamlessly by Kubernetes-native tools like Tekton and ArgoCD alongside containerized workloads. Automating VM-related tasks with Tekton is safer, repeatable, and faster than performing them manually. Those Tekton tasks and pipelines can be shared across clusters for cross-cluster consistency.
You can find some examples of Tekton Tasks for virtual machines in the OpenShift documentation here or in this GitHub repository.
Existing VMs can “lift and shift” to OpenShift Virtualization using tools like Red Hat Migration Toolkit for Virtualization (MTV) and benefit from these same capabilities without the need to rewrite them.
Whether you’re already using Tekton or are new to it, I hope this post gave you some ideas on how to use VMs in pipelines. I’m sure you’ll be able to find additional use cases once you start using it.
About the author
More like this
Browse by channel
Automation
The latest on IT automation for tech, teams, and environments
Artificial intelligence
Updates on the platforms that free customers to run AI workloads anywhere
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
The latest on how we reduce risks across environments and technologies
Edge computing
Updates on the platforms that simplify operations at the edge
Infrastructure
The latest on the world’s leading enterprise Linux platform
Applications
Inside our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Customer support
- Developer resources
- Find a partner
- Red Hat Ecosystem Catalog
- Red Hat value calculator
- Documentation
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit