How to use workload partitioning with Red Hat OpenShift Container Platform

Learn how to use workload partitioning with Red Hat® OpenShift® Container Platform to benefit resource-constrained environments.

This learning path is for operations teams or system administrators
Developers may want to check out Network observability with eBPF on developers.redhat.com. 

Get started on developers.redhat.com

Testing workload isolation with a virtual machine

1 hr and 20 mins

We’ve seen how workload partitioning works on cluster nodes, but it can also be applied to virtual machines (VM). Now we can test with virtual machines managed by Red Hat OpenShift Virtualization.

What will you learn?

  • How virtual machines can use workload isolation

What you need before starting:

Create a virtual machine

Use the OpenShift console or virtctl to create a virtual machine with 4 CPU cores in a project/namespace.

A screenshot of Red Hat console showing a virtual machine created from the virtctl command.
A screenshot of Red Hat console showing a virtual machine created from the virtctl command.

Access the VM and run a stress test

Use virtctl to SSH into the VM and execute the stress-ng command.

# Download and install virtctl if you haven't already
wget --no-check-certificate https://hyperconverged-cluster-cli-download-openshift-cnv.apps.demo-01-rhsys.wzhlab.top/amd64/linux/virtctl.tar.gz
tar zvxf virtctl.tar.gz
mv virtctl ~/.local/bin/

# SSH into the VM and run the test
virtctl -n demo ssh user@vm-name --identity-file=~/.ssh/id_rsa
stress-ng --cpu 4 --cpu-load 100 --temp-path /tmp

Observe Host CPU usage

Checking top on the host node will again show that the QEMU process for the VM is consuming CPU cycles exclusively from the isolated cores (20-23).

# top output snippet
%Cpu19 :  1.7 us,  2.0 sy,  0.0 ni, 96.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu20 : 99.0 us,  0.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.7 hi,  0.0 si,  0.0 st
%Cpu21 : 96.7 us,  0.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  1.0 hi,  2.0 si,  0.0 st
%Cpu22 : 98.7 us,  0.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  1.0 hi,  0.0 si,  0.0 st
%Cpu23 : 99.0 us,  0.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.3 hi,  0.0 si,  0.0 st

Verifying VM Process CPU affinity

Finally, we can confirm the CPU affinity of the VM's QEMU process on the host node. This demonstrates that the entire virtual machine, as a workload, is constrained to the isolated CPU cores.

# Find the PID of the qemu-kvm process for the VM
ps -ef | grep qemu-kvm
# 107        44891   44699 62 03:04 ?        00:04:53 /usr/libexec/qemu-kvm -name guest=demo_centos-stream10-tan-tarantula-34,.............

# Check its CPU affinity
taskset -c -p 44891
# pid 44891's current affinity list: 20-23

Once you have finished this testing, we can take a look at how this all works together behind the scenes.  

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동