You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= Configuring the default and virt-default storage classes
9
+
10
+
A storage class determines how persistent storage is provisioned for workloads. In {VirtProductName}, the virt-default storage class takes precedence over the cluster default storage class and is used specifically for virtualization workloads. Only one storage class should be set as virt-default or cluster default at a time. If multiple storage classes are marked as default, the virt-default storage class overrides the cluster default. To ensure consistent behavior, configure only one storage class as the default for virtualization workloads.
11
+
12
+
[IMPORTANT]
13
+
====
14
+
Boot sources are created using the default storage class. If your cluster does not have a default storage class, you must define one.
15
+
====
16
+
17
+
.Procedure
18
+
19
+
. Patch the current virt-default or a cluster default storage class to false:
20
+
.. Identify all storage classes currently marked as virt-default by running the following command:
21
+
+
22
+
[source,terminal]
23
+
----
24
+
$ oc get sc -o json| jq '.items[].metadata|select(.annotations."storageclass.kubevirt.io/is-default-virt-class"=="true")|.name'
25
+
----
26
+
+
27
+
.. For each storage class returned, remove the virt-default annotation by running the following command:
. Delete any outdated `DataVolume` and `VolumeSnapshot` objects from the `openshift-virtualization-os-images` namespace by running the following command.
. Wait for all `DataSource` objects to reach a "Ready - True" status. Data sources can reference either a PersistentVolumeClaim (PVC) or a VolumeSnapshot. To check the expected source format, run the following command:
71
+
+
72
+
[source,terminal]
73
+
----
74
+
$ oc get storageprofile <storage_class_name> -o json | jq .status.dataImportCronSourceFormat
= Configuring a storage class for custom boot source updates
8
+
= Configuring a storage class for boot source images
9
9
10
-
You can override the default storage class by editing the `HyperConverged`custom resource (CR).
10
+
You can configure a specific storage class in the `HyperConverged` resource.
11
11
12
12
[IMPORTANT]
13
13
====
14
-
Boot sources are created from storage using the default storage class. If your cluster does not have a default storage class, you must define one before configuring automatic updates for custom boot sources.
14
+
To ensure stable behavior and avoid unnecessary re-importing, you can specify the `storageClassName` in the `dataImportCronTemplates` section of the `HyperConverged` resource.
15
15
====
16
16
17
17
.Procedure
@@ -23,7 +23,7 @@ Boot sources are created from storage using the default storage class. If your c
. Define a new storage class by entering a value in the `storageClassName` field:
26
+
. Add the `dataImportCronTemplate` to the spec section of the `HyperConverged` resource and set the `storageClassName`:
27
27
+
28
28
[source,yaml]
29
29
----
@@ -34,11 +34,12 @@ metadata:
34
34
spec:
35
35
dataImportCronTemplates:
36
36
- metadata:
37
-
name: rhel8-image-cron
37
+
name: rhel9-image-cron
38
38
spec:
39
39
template:
40
40
spec:
41
-
storageClassName: <new_storage_class> <1>
41
+
storage:
42
+
storageClassName: <storage_class> <1>
42
43
schedule: "0 */12 * * *" <2>
43
44
managedDataSource: <data_source> <3>
44
45
# ...
@@ -47,43 +48,23 @@ spec:
47
48
<2> Required: Schedule for the job specified in cron format.
48
49
<3> Required: The data source to use.
49
50
+
50
-
--
51
51
[NOTE]
52
-
----
52
+
====
53
53
For the custom image to be detected as an available boot source, the value of the `spec.dataVolumeTemplates.spec.sourceRef.name` parameter in the VM template must match this value.
54
-
----
55
-
--
54
+
====
56
55
57
-
. Remove the `storageclass.kubernetes.io/is-default-class` annotation from the current default storage class.
58
-
.. Retrieve the name of the current default storage class by running the following command:
59
-
+
60
-
[source,terminal]
61
-
----
62
-
$ oc get storageclass
63
-
----
64
-
+
65
-
.Example output
66
-
[source,text]
67
-
----
68
-
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
<1> Replace `<current_default_storage_class>` with the `storageClassName` value of the default storage class.
82
64
83
-
. Set the new storage class as the default by running the following command:
65
+
. Wait for all `DataSource` objects to reach a "Ready - True" status. Data sources can reference either a PersistentVolumeClaim (PVC) or a VolumeSnapshot. To check the expected source format, run the following command:
0 commit comments