Skip to content

Commit cfd3acd

Browse files
committed
CNV-71192: Add TP support for custom video device selection when creating a VM
1 parent c277b6b commit cfd3acd

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed

modules/virt-creating-vm-cli.adoc

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="virt-creating-vm-cli_{context}"]
77
= Creating a VM from a VirtualMachine manifest
88

9+
[role="_abstract"]
910
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.
1011

1112
.Prerequisites
@@ -35,29 +36,31 @@ This example manifest does not configure VM authentication.
3536
apiVersion: kubevirt.io/v1
3637
kind: VirtualMachine
3738
metadata:
38-
name: rhel-9-minimal # <1>
39+
name: rhel-9-minimal
3940
spec:
4041
dataVolumeTemplates:
4142
- metadata:
4243
name: imported-volume-mk4lj
4344
spec:
4445
sourceRef:
4546
kind: DataSource
46-
name: rhel9 # <2>
47-
namespace: openshift-virtualization-os-images # <3>
47+
name: rhel9
48+
namespace: openshift-virtualization-os-images
4849
storage:
4950
resources: {}
5051
instancetype:
51-
inferFromVolume: imported-volume-mk4lj # <4>
52+
inferFromVolume: imported-volume-mk4lj
5253
inferFromVolumeFailurePolicy: Ignore
5354
preference:
54-
inferFromVolume: imported-volume-mk4lj # <5>
55+
inferFromVolume: imported-volume-mk4lj
5556
inferFromVolumeFailurePolicy: Ignore
5657
runStrategy: Always
5758
template:
5859
spec:
5960
domain:
60-
devices: {}
61+
devices:
62+
video:
63+
type: virtio
6164
memory:
6265
guest: 512Mi
6366
resources: {}
@@ -67,11 +70,14 @@ spec:
6770
name: imported-volume-mk4lj
6871
name: imported-volume-mk4lj
6972
----
70-
<1> The VM name.
71-
<2> The boot source for the guest operating system.
72-
<3> The namespace for the boot source. Golden images are stored in the `openshift-virtualization-os-images` namespace.
73-
<4> The instance type is inferred from the selected `DataSource` object.
74-
<5> The preference is inferred from the selected `DataSource` object.
73+
+
74+
75+
* `name: rhel-9-minimal` specifies the name of the VM.
76+
* `name: rhel9` specifies the boot source for the guest operating system in the `sourceRef` section.
77+
* `namespace: openshift-virtualization-os-images` specifies the namespace for the boot source. Golden images are stored in the `openshift-virtualization-os-images` namespace.
78+
* `instancetype: inferFromVolume: imported-volume-mk4lj` specifies the instance type inferred from the selected `DataSource` object.
79+
* `preference: inferFromVolume: imported-volume-mk4lj` specifies that the preference is inferred from the selected `DataSource` object.
80+
* `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.
7581
7682
. Create a virtual machine by using the manifest file:
7783
+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="virt-supported-custom-video-devices_{context}"]
7+
= Supported custom video device types
8+
9+
[role="_abstract"]
10+
When creating a virtual machine (VM), you can configure a custom video device type to override the default video configuration.
11+
12+
Configuring a custom video device allows you to specify different video devices, based on your guest operating system requirements and performance needs.
13+
14+
[IMPORTANT]
15+
====
16+
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.
17+
18+
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].
19+
====
20+
21+
Using a custom video device provides several advantages:
22+
23+
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.
24+
Resolution flexibility:: With some viodeo device types, you can set custom display resolutions.
25+
Memory efficiency:: Some video types are more memory efficient for headless or console-only operations.
26+
27+
You can configure the following video device types:
28+
29+
* 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.
30+
* VGA: the standard for analog video display (default on AMD/x86_64 with BIOS).
31+
* 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).
32+
* Cirrus: a legacy video device that provides stable video output.
33+
* ramfb: a simple, unaccelerated virtual display device primarily used in the QEMU emulator, and useful for ARM architecture.
34+
35+
[cols="1,1,1,1",options="header"]
36+
.Video device support by architecture
37+
|====
38+
|Architecture |Boot mode |Default type |Supported types
39+
| AMD/x86_64 | BIOS | `vga` | `virtio`, `vga`, `bochs`, `cirrus`, `ramfb``
40+
| AMD/x86_64 | EFI | `bochs` | `virtio`, `vga`, `bochs`, `cirrus`, `ramfb``
41+
| ARM64 | BIOS/EFI | `virtio` | `virtio`, `ramfb`
42+
| s390x | BIOS/EFI | `virtio` | `virtio`
43+
|====

virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9+
[role="_abstract"]
910
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.
1011

1112
[NOTE]
@@ -14,6 +15,7 @@ You can also xref:../../../virt/creating_vm/virt-creating-vms-from-instance-type
1415
====
1516

1617
include::modules/virt-creating-vm-cli.adoc[leveloffset=+1]
18+
include::modules/virt-supported-custom-video-devices.adoc[leveloffset=+2]
1719

1820
.Next steps
1921

0 commit comments

Comments
 (0)