Bug 2035008 - Auto-update boot sources: CDI tries to import even when a PVC already exists; dataSources are not updated
Summary: Auto-update boot sources: CDI tries to import even when a PVC already exists;...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 4.10.0
Assignee: Arnon Gilboa
QA Contact: Yan Du
URL:
Whiteboard:
Depends On: 2037270 2037290
Blocks: 2032421 2034474
TreeView+ depends on / blocked
 
Reported: 2021-12-22 17:27 UTC by Ruth Netser
Modified: 2022-03-16 16:05 UTC (History)
5 users (show)

Fixed In Version: CNV v4.10.0-551
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-16 16:05:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2075 0 None Merged Use existing DataVolume on DataImportCron source digest match 2022-01-04 12:55:59 UTC
Red Hat Product Errata RHSA-2022:0947 0 None Closed RHEL EUS Errata Documentation 2022-06-16 06:26:55 UTC

Description Ruth Netser 2021-12-22 17:27:05 UTC
Description of problem:
When auto-update boot sources feature is enabled, CDI tried to import even when a DV with the same sha already exists.
The corresponding dataSource is not updated with the PVC name.

Version-Release number of selected component (if applicable):
CNV 4.10.0
cdi-operator - v4.10.0-65

How reproducible:
100$

Steps to Reproduce:
1. Enable enableCommonBootImageImport FG in HCO CR
2. dataImportCron creates source PVCs

Actual results:
dataSources are not updated with the name of the newly created PVC

"error":"datavolumes.cdi.kubevirt.io \"fedora-015778440a45\" already exists"

Expected results:
Source PVC name should be updated in dataSources

Additional info:
==================================================
{"level":"info","ts":1640193600.7585611,"logger":"controller.dataimportcron-controller.createImportDataVolume","msg":"Creating new source DataVolume","name":"fedora-015778440a45"}
{"level":"error","ts":1640193600.9089134,"logger":"controller-runtime.manager.controller.dataimportcron-controller","msg":"Reconciler error","name":"fedora-image-cron","namespace":"openshift-virtualization-os-im
ages","error":"datavolumes.cdi.kubevirt.io \"fedora-015778440a45\" already exists","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/remote-source/app/vendor/github.com/go-logr/zapr/zapr.go:132\nsigs.
k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:302\nsigs.k8s.io/controller-runt
ime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/co
ntroller.(*Controller).Start.func1.2\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:216\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99"}


==================================================


$ oc get hco -n openshift-cnv kubevirt-hyperconverged  -oyaml|grep -i boot
    enableCommonBootImageImport: true

==================================================

$ oc get pvc -A |grep fed
openshift-virtualization-os-images   fedora-015778440a45           Bound    pvc-046d6674-cec3-447a-883d-bc44a92cb5c4   245Gi      RWO            hostpath-provisioner   4m2s


==================================================
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataSource
metadata:
  annotations:
    operator-sdk/primary-resource: openshift-cnv/ssp-kubevirt-hyperconverged
    operator-sdk/primary-resource-type: SSP.ssp.kubevirt.io
  creationTimestamp: "2021-12-22T10:51:36Z"
  generation: 2
  labels:
    app.kubernetes.io/component: templating
    app.kubernetes.io/managed-by: ssp-operator
    app.kubernetes.io/name: data-sources
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.10.0
    dataimportcron-name: fedora-image-cron
  name: fedora
  namespace: openshift-virtualization-os-images
  resourceVersion: "385049"
  uid: 99370f72-eb12-4eea-bce0-c65e4318b8bf
spec:
  source:
    pvc:
      name: fedora
      namespace: openshift-virtualization-os-images
status:
  conditions:
  - lastHeartbeatTime: "2021-12-22T16:12:46Z"
    lastTransitionTime: "2021-12-22T16:12:46Z"
    message: No imports yet
    reason: NoImport
    status: "False"
    type: Ready



==================================================

$ oc describe dataimportcron -n openshift-virtualization-os-images fedora-image-cron
Name:         fedora-image-cron
Namespace:    openshift-virtualization-os-images
Labels:       app.kubernetes.io/component=templating
              app.kubernetes.io/managed-by=ssp-operator
              app.kubernetes.io/name=data-sources
              app.kubernetes.io/part-of=hyperconverged-cluster
              app.kubernetes.io/version=4.10.0
Annotations:  cdi.kubevirt.io/storage.bind.immediate.requested: true
              cdi.kubevirt.io/storage.import.sourceDesiredDigest: sha256:015778440a455891104430a939e80a8de86140f32e6b27317ac88bd9a8ef9eac
              operator-sdk/primary-resource: openshift-cnv/ssp-kubevirt-hyperconverged
              operator-sdk/primary-resource-type: SSP.ssp.kubevirt.io
API Version:  cdi.kubevirt.io/v1beta1
Kind:         DataImportCron
Metadata:
  Creation Timestamp:  2021-12-22T16:13:03Z
  Generation:          1
  Managed Fields:
    API Version:  cdi.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:cdi.kubevirt.io/storage.import.sourceDesiredDigest:
    Manager:      cdi-source-update-poller
    Operation:    Update
    Time:         2021-12-22T16:13:03Z
    API Version:  cdi.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:cdi.kubevirt.io/storage.bind.immediate.requested:
          f:operator-sdk/primary-resource:
          f:operator-sdk/primary-resource-type:
        f:labels:
          .:
          f:app.kubernetes.io/component:
          f:app.kubernetes.io/managed-by:
          f:app.kubernetes.io/name:
          f:app.kubernetes.io/part-of:
          f:app.kubernetes.io/version:
      f:spec:
        .:
        f:garbageCollect:
        f:managedDataSource:
        f:schedule:
        f:template:
          .:
          f:metadata:
          f:spec:
            .:
            f:source:
              .:
              f:registry:
                .:
                f:url:
            f:storage:
              .:
              f:resources:
                .:
                f:requests:
                  .:
                  f:storage:
          f:status:
      f:status:
    Manager:         manager
    Operation:       Update
    Time:            2021-12-22T16:13:03Z
  Resource Version:  384422
  UID:               f17e0995-0561-43a6-bfa8-486d3897bf24
Spec:
  Garbage Collect:      Outdated
  Managed Data Source:  fedora
  Schedule:             54 1/12 * * *
  Template:
    Metadata:
    Spec:
      Source:
        Registry:
          URL:  docker://quay.io/kubevirt/fedora-container-disk-images
      Storage:
        Resources:
          Requests:
            Storage:  5Gi
    Status:
Status:
Events:  <none>


==================================================

Comment 1 Yan Du 2022-01-17 13:51:59 UTC
The bug can't be tested until bug #2037270 and #2037290 are fixed

Comment 2 Yan Du 2022-01-19 04:31:44 UTC
Can not reproduce the issue with rhel8 and rhel9 image after bug #2037290 fixed.

Comment 3 Yan Du 2022-01-19 12:01:12 UTC
Work well for rhel8 and rhel9 image. Moving the bug to verified.
Feel free to re-open it if the fedora/centos images don't work well after bug #2037270 fixed

Comment 8 errata-xmlrpc 2022-03-16 16:05:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 4.10.0 Images security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0947


Note You need to log in before you can comment on or make changes to this bug.