1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

CNV-71192: Add TP support for custom video device selection when creating a VM

This commit is contained in:
Miriam Weiss
2025-12-21 12:34:49 +02:00
committed by openshift-cherrypick-robot
parent 80242a4343
commit 692b8c2491
3 changed files with 62 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
[id="virt-creating-vm-cli_{context}"]
= Creating a VM from a VirtualMachine manifest
[role="_abstract"]
You can create a virtual machine (VM) from a `VirtualMachine` manifest. To simplify the creation of these manifests, you can use the `virtctl` command-line tool.
.Prerequisites
@@ -35,7 +36,7 @@ This example manifest does not configure VM authentication.
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: rhel-9-minimal # <1>
name: rhel-9-minimal
spec:
dataVolumeTemplates:
- metadata:
@@ -43,21 +44,23 @@ spec:
spec:
sourceRef:
kind: DataSource
name: rhel9 # <2>
namespace: openshift-virtualization-os-images # <3>
name: rhel9
namespace: openshift-virtualization-os-images
storage:
resources: {}
instancetype:
inferFromVolume: imported-volume-mk4lj # <4>
inferFromVolume: imported-volume-mk4lj
inferFromVolumeFailurePolicy: Ignore
preference:
inferFromVolume: imported-volume-mk4lj # <5>
inferFromVolume: imported-volume-mk4lj
inferFromVolumeFailurePolicy: Ignore
runStrategy: Always
template:
spec:
domain:
devices: {}
devices:
video:
type: virtio
memory:
guest: 512Mi
resources: {}
@@ -67,11 +70,14 @@ spec:
name: imported-volume-mk4lj
name: imported-volume-mk4lj
----
<1> The VM name.
<2> The boot source for the guest operating system.
<3> The namespace for the boot source. Golden images are stored in the `openshift-virtualization-os-images` namespace.
<4> The instance type is inferred from the selected `DataSource` object.
<5> The preference is inferred from the selected `DataSource` object.
+
* `name: rhel-9-minimal` specifies the name of the VM.
* `name: rhel9` specifies the boot source for the guest operating system in the `sourceRef` section.
* `namespace: openshift-virtualization-os-images` specifies the namespace for the boot source. Golden images are stored in the `openshift-virtualization-os-images` namespace.
* `instancetype: inferFromVolume: imported-volume-mk4lj` specifies the instance type inferred from the selected `DataSource` object.
* `preference: inferFromVolume: imported-volume-mk4lj` specifies that the preference is inferred from the selected `DataSource` object.
* `type: virtio` specifies the use of a custom video device (a VirtIO device in this example) to enable hardware graphics acceleration. Enabling a custom video device is in Technology Preview for {VirtProductName} 4.21.
. Create a virtual machine by using the manifest file:
+

View File

@@ -0,0 +1,43 @@
// Module included in the following assemblies:
//
// * virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc
:_mod-docs-content-type: REFERENCE
[id="virt-supported-custom-video-devices_{context}"]
= Supported custom video device types
[role="_abstract"]
When creating a virtual machine (VM), you can configure a custom video device type to override the default video configuration.
Configuring a custom video device allows you to specify different video devices, based on your guest operating system requirements and performance needs.
[IMPORTANT]
====
Custom video device support is a Technology Preview feature only. Technology Preview features are not supported with Red{nbsp}Hat production service level agreements (SLAs) and might not be functionally complete. Red{nbsp}Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red{nbsp}Hat Technology Preview features, see link:https://access.redhat.com/support/offerings/techpreview/[Technology Preview Features Support Scope].
====
Using a custom video device provides several advantages:
Performance:: Certain video devices provide better performance than the default configuration. For example, VirtIO is a more efficient video device on AMD/x86_64 architecture than legacy VGA.
Resolution flexibility:: With some video device types, you can set custom display resolutions.
Memory efficiency:: Some video types are more memory efficient for headless or console-only operations.
You can configure the following video device types:
* VirtIO: provides improved performance, and hardware-accelerated video decoding and encoding by offloading tasks to the host. Recommended for modern guest operating systems with available `VirtIO` drivers.
* VGA: the standard for analog video display (default on AMD/x86_64 with BIOS).
* Bochs: an emulated graphics adapter that provides a simple interface for guest operating systems to manage display settings (default on AMD/x86_64 with EFI).
* Cirrus: a legacy video device that provides stable video output.
* ramfb: a simple, unaccelerated virtual display device primarily used in the QEMU emulator, and useful for ARM architecture.
[cols="1,1,1,1",options="header"]
.Video device support by architecture
|====
|Architecture |Boot mode |Default type |Supported types
| AMD/x86_64 | BIOS | `vga` | `virtio`, `vga`, `bochs`, `cirrus`, `ramfb``
| AMD/x86_64 | EFI | `bochs` | `virtio`, `vga`, `bochs`, `cirrus`, `ramfb``
| ARM64 | BIOS/EFI | `virtio` | `virtio`, `ramfb`
| s390x | BIOS/EFI | `virtio` | `virtio`
|====

View File

@@ -6,6 +6,7 @@ include::_attributes/common-attributes.adoc[]
toc::[]
[role="_abstract"]
You can create virtual machines (VMs) from the command line by editing or creating a `VirtualMachine` manifest. You can simplify VM configuration by using an xref:../../../virt/creating_vm/virt-creating-vms-from-instance-types.adoc#virt-creating-vms-from-instance-types[instance type] in your VM manifest.
[NOTE]
@@ -14,6 +15,7 @@ You can also xref:../../../virt/creating_vm/virt-creating-vms-from-instance-type
====
include::modules/virt-creating-vm-cli.adoc[leveloffset=+1]
include::modules/virt-supported-custom-video-devices.adoc[leveloffset=+2]
.Next steps