Cloud Experts Documentation

Deploying OpenShift Virtualization on ROSA (CLI)

This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.

OpenShift Virtualization is a feature of OpenShift that allows you to run virtual machines alongside your containers. This is useful for running legacy applications that can’t be containerized, or for running applications that require special hardware or software that isn’t available in a container.

In this tutorial, I’ll show you how to deploy OpenShift Virtualization on Red Hat OpenShift on AWS (ROSA). I’ll show you how to create a ROSA cluster, deploy the OpenShift Virtualization operator, and create a virtual machine.

It’s important to keep in mind that this tutorial is designed to show you the quickest way to get started with OpenShift Virtualization on ROSA. It’s not designed to be a production-ready deployment. If you’re planning to deploy OpenShift Virtualization in a production environment, you should follow the official documentation and best practices.

If you don’t want to deploy the resources yourself, you can watch the video below to see how it’s done.

Pre-requisites

  1. You will need a A ROSA Cluster (see Deploying ROSA HCP with Terraform if you need help creating one).

  2. Set the cluster name as an environment variable (in the example we re-use the variable from the Terraform guide). ort METAL_AZ=$(terraform output -json private_subnet_azs | jq -r ‘.[0]’)

  3. Create a bare metal machine pool

    Note bare metal machines are not cheap, so be warned!

Deploy the OpenShift Virtualization Operator

  1. Deploy the OpenShift Virtualization Operator

  2. If you want to see the progress of the operator you can log into the OpenShift Console (hint run oc whoami --show-console to get the URL)

    list of installed operators
  3. Create an OpenShift Virtualization operand

    Note: this is all defaults, so will not support a lot of the more advanced features you might want such as live migration.

  4. New “Virtualization” Section in the OpenShift Console

    Once the operator is installed you should see a new “Virtualization” section in the OpenShift Console (you may be prompted to refresh the page)

    Virtualization Section
  5. Close the popup window and click the “Download virtctl” button to download the virtctl binary.

Create a Virtual Machine

  1. Create a project and a secret containing your public SSH key

  2. Create a VM

  3. Start the VM

  4. Watch for the VM to be ready

    Every 2.0s: oc get vm NAME AGE STATUS READY example-vm 3m16s Running False

  5. SSH into the VM

  6. Congratulations! You now have a virtual machine running on OpenShift Virtualization on ROSA!

Cleanup

  1. Delete the VM

  2. Delete the ROSA Cluster

Interested in contributing to these docs?

Collaboration drives progress. Help improve our documentation The Red Hat Way.

Red Hat logo LinkedIn YouTube Facebook Twitter

Products

Tools

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.

Subscribe to our newsletter, Red Hat Shares

Sign up now
© 2023 Red Hat, Inc.