11.3.3. Configuring a storage class for boot source images


You can configure a specific storage class in the HyperConverged resource.

중요

To ensure stable behavior and avoid unnecessary re-importing, you can specify the storageClassName in the dataImportCronTemplates section of the HyperConverged resource.

Prerequisites

  • You have installed the OpenShift CLI (oc).

Procedure

  1. Open the HyperConverged CR in your default editor by running the following command:

    $ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
  2. Add the dataImportCronTemplate to the spec section of the HyperConverged resource and set the storageClassName:

    apiVersion: hco.kubevirt.io/v1beta1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
    spec:
      dataImportCronTemplates:
      - metadata:
          name: rhel9-image-cron
        spec:
          template:
            spec:
              storage:
                storageClassName: <storage_class>
          schedule: "0 */12 * * *"
          managedDataSource: <data_source>
    # ...
    • spec.dataImportCronTemplates.spec.template.spec.storage.storageClassName specifies the storage class.
    • spec.dataImportCronTemplates.spec.schedule is a required field that specifies the schedule for the job in cron format.
    • spec.dataImportCronTemplates.spec.managedDataSource is a required field that specifies the data source to use.

      참고

      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.

  3. Wait for the HyperConverged Operator (HCO) and Scheduling, Scale, and Performance (SSP) resources to complete reconciliation.
  4. Delete any outdated DataVolume and VolumeSnapshot objects from the openshift-virtualization-os-images namespace by running the following command.

    $ oc delete DataVolume,VolumeSnapshot -n openshift-virtualization-os-images --selector=cdi.kubevirt.io/dataImportCron
  5. 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:

    $ oc get storageprofile <storage_class_name> -o json | jq .status.dataImportCronSourceFormat
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

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

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

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

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동