Skip to content

Commit b8fe131

Browse files
authored
Merge pull request #63333 from sjhala-ccs/cnv-18302
CNV-18302: Persistent storage support for vTPM
2 parents 1420341 + 31669e1 commit b8fe131

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

modules/virt-about-vtpm-devices.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ from a Windows 11 image to function without a physical TPM chip.
1616
If you do not enable vTPM, then the VM does not recognize a TPM device, even if
1717
the node has one.
1818

19-
vTPM devices also protect virtual machines by temporarily storing secrets
20-
without physical hardware. However, using vTPM for persistent secret storage is
21-
not currently supported. vTPM discards stored secrets after a VM shuts down.
19+
A vTPM device also protects virtual machines by storing secrets without physical hardware. {VirtProductName} supports persisting vTPM device state by using Persistent Volume Claims (PVCs) for VMs. You must specify the storage class to be used by the PVC by setting the `vmStateStorageClass` attribute in the `HyperConverged` custom resource (CR):
20+
21+
[source,yaml]
22+
----
23+
kind: HyperConverged
24+
metadata:
25+
name: kubevirt-hyperconverged
26+
spec:
27+
vmStateStorageClass: <storage_class_name>
28+
29+
# ...
30+
----
31+
32+
[NOTE]
33+
====
34+
The storage class must be of type `Filesystem` and support the `ReadWriteMany` (RWX) access mode.
35+
====

modules/virt-adding-vtpm-to-vm.adoc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
Adding a virtual Trusted Platform Module (vTPM) device to a virtual machine
1010
(VM) allows you to run a VM created from a Windows 11 image without a physical
11-
TPM device. A vTPM device also temporarily stores secrets for that VM.
11+
TPM device. A vTPM device also stores secrets for that VM.
12+
13+
.Prerequisites
14+
* You have installed the OpenShift CLI (`oc`).
15+
* You have configured a Persistent Volume Claim (PVC) to use a storage class of type `Filesystem` that supports the `ReadWriteMany` (RWX) access mode. This is necessary for the vTPM device data to persist across VM reboots.
1216
1317
.Procedure
1418

@@ -19,7 +23,7 @@ TPM device. A vTPM device also temporarily stores secrets for that VM.
1923
$ oc edit vm <vm_name>
2024
----
2125

22-
. Edit the VM `spec` so that it includes the `tpm: {}` line. For example:
26+
. Edit the VM specification to add the vTPM device. For example:
2327
+
2428
[source,yaml]
2529
----
@@ -32,10 +36,12 @@ spec:
3236
spec:
3337
domain:
3438
devices:
35-
tpm: {} <1>
39+
tpm: <1>
40+
persistent: true <2>
3641
# ...
3742
----
38-
<1> Adds the TPM device to the VM.
43+
<1> Adds the vTPM device to the VM.
44+
<2> Specifies that the vTPM device state persists after the VM is shut down. The default value is `false`.
3945

4046
. To apply your changes, save and exit the editor.
4147

0 commit comments

Comments
 (0)