---
title: What about balancing vm workloads?
exercise: 4
date: '2024-04-14'
tags: ['openshift','virtualisation','kubernetes','kubevirt']
draft: false
authors: ['default']
summary: "How do we optimally balance vm workloads across an OpenShift cluster?"
---

After the slick demos and objection handling from your pre sales team Acme Financial Services have agreed to run a small scale proof of concept for OpenShift Virtualisation 🎉

They have spun up a bare metal OpenShift cluster, installed OpenShift Virtualisation and now have a small number of virtual machines running.

One of the goals of the pilot is to ensure their virtual machine workloads will run efficiently on their new infrastructure and continually auto balance over time based on available underlying infrastructure capacity so they don't have some nodes much busier than others.

The Acme team are stuck on how they might implement this goal within their current sprint. They told you they found some documentation online on this thing called *"deschedular"* but have decided it would be easier to email Red Hat and ask for a walkthrough.

Your local pre-sales team has offered to setup an example environment for Acme and step through how to enable the feature. No worries right. After all, how hard can it be?

<Zoom>
|![workshop](/workshops/static/images/hackathon/yaml-file.jpeg)                 | 
|:-----------------------------------------------------------------------------:|
| *"We've all said it 😂"*                                                      |
</Zoom>


## 4.1 - Enabling virtual machine balancing profiles

Your challenge for this task is to enable the **Technology Preview** feature for Virtual Machine workload balancing in OpenShift at the cluster level.

Once enabled at the cluster level you then need to deploy a **CentOS Stream 9** virtual machine called `centos` running in a new namespace called `itsjustyaml`. No command line is required.

Documentation you may find helpful is:
- https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/advanced_vm_management/virt-enabling-descheduler-evictions.html
- https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-templates.html


## 4.2 - Check your work

If you've successfully enabled deschedular evictions for the `centos` virtual machine please post a message in `#event-anz-ocp-virt-hackathon` with the message:

> Please review team [name] solution for exercise 4.

This exercise is worth 25 points. The event team will reply in slack to confirm your updated team total score.
