kubevirt / containerized-data-importer

Data Import Service for kubernetes, designed with kubevirt in mind.
Apache License 2.0
416 stars 260 forks source link

cdi.kubevirt.io/storage.bind.immediate.requested annotation is not honored #2918

Closed ksimon1 closed 1 year ago

ksimon1 commented 1 year ago

What happened: When running windows11 tekton pipeline, the DV and PVC with cdi.kubevirt.io/storage.bind.immediate.requested annotation is in pending state.

What you expected to happen: DV and PVC is imported

How to reproduce it (as minimally and precisely as possible): Create DV

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  annotations:
    "cdi.kubevirt.io/storage.bind.immediate.requested": "true"
  generateName: windows-efi-root-disk-
spec:
  storage:
    resources:
      requests:
        storage: 20Gi
  source:
    blank: {}

Additional context:

Environment:

DV definition

[ksimon:11:01:37~/Stažené]$ oc describe dv windows-efi-root-disk-jwvl2
Name:         windows-efi-root-disk-jwvl2
Namespace:    kubevirt
Labels:       <none>
Annotations:  cdi.kubevirt.io/storage.bind.immediate.requested: true
              cdi.kubevirt.io/storage.usePopulator: true
API Version:  cdi.kubevirt.io/v1beta1
Kind:         DataVolume
Metadata:
  Creation Timestamp:  2023-10-05T08:36:37Z
  Generate Name:       windows-efi-root-disk-
  Generation:          1
  Managed Fields:
    API Version:  cdi.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:cdi.kubevirt.io/storage.usePopulator:
    Manager:      cdi-controller
    Operation:    Update
    Time:         2023-10-05T08:36:37Z
    API Version:  cdi.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:claimName:
        f:conditions:
        f:phase:
        f:progress:
    Manager:      cdi-controller
    Operation:    Update
    Subresource:  status
    Time:         2023-10-05T08:36:37Z
    API Version:  cdi.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:cdi.kubevirt.io/storage.bind.immediate.requested:
        f:generateName:
      f:spec:
        .:
        f:source:
          .:
          f:blank:
        f:storage:
          .:
          f:resources:
            .:
            f:requests:
              .:
              f:storage:
    Manager:         modify-data-object
    Operation:       Update
    Time:            2023-10-05T08:36:37Z
  Resource Version:  112334
  UID:               cc378790-9f49-4e23-ba74-2a803161fa4f
Spec:
  Source:
    Blank:
  Storage:
    Resources:
      Requests:
        Storage:  20Gi
Status:
  Claim Name:  windows-efi-root-disk-jwvl2
  Conditions:
    Last Heartbeat Time:   2023-10-05T08:36:37Z
    Last Transition Time:  2023-10-05T08:36:37Z
    Message:               PVC windows-efi-root-disk-jwvl2 Pending
    Reason:                Pending
    Status:                False
    Type:                  Bound
    Last Heartbeat Time:   2023-10-05T08:36:37Z
    Last Transition Time:  2023-10-05T08:36:37Z
    Status:                False
    Type:                  Ready
    Last Heartbeat Time:   2023-10-05T08:36:37Z
    Last Transition Time:  2023-10-05T08:36:37Z
    Status:                False
    Type:                  Running
  Phase:                   ImportScheduled
  Progress:                N/A
Events:
  Type    Reason   Age   From                          Message
  ----    ------   ----  ----                          -------
  Normal  Pending  25m   datavolume-import-controller  PVC windows-efi-root-disk-jwvl2 Pending

PVC definition


[ksimon:11:02:27~/Stažené]$ oc describe pvc windows-efi-root-disk-jwvl2
Name:          windows-efi-root-disk-jwvl2
Namespace:     kubevirt
StorageClass:  ssd-csi
Status:        Pending
Volume:        
Labels:        app=containerized-data-importer
               app.kubernetes.io/component=storage
               app.kubernetes.io/managed-by=cdi-controller
Annotations:   cdi.kubevirt.io/storage.bind.immediate.requested: true
               cdi.kubevirt.io/storage.contentType: kubevirt
               cdi.kubevirt.io/storage.preallocation.requested: false
               cdi.kubevirt.io/storage.usePopulator: true
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Block
DataSource:
  APIGroup:  cdi.kubevirt.io
  Kind:      VolumeImportSource
  Name:      volume-import-source-cc378790-9f49-4e23-ba74-2a803161fa4f
Used By:     <none>
Events:
  Type    Reason                       Age                  From                         Message
  ----    ------                       ----                 ----                         -------
  Normal  CreatedPVCPrimeSuccessfully  25m                  import-populator             PVC Prime created successfully
  Normal  WaitForFirstConsumer         51s (x106 over 25m)  persistentvolume-controller  waiting for first consumer to be created before binding

storageClass definition

[ksimon:10:45:47~/Stažené]$ oc describe storageclass ssd-csi
Name:                  ssd-csi
IsDefaultClass:        Yes
Annotations:           storageclass.kubernetes.io/is-default-class=true
Provisioner:           pd.csi.storage.gke.io
Parameters:            replication-type=none,type=pd-ssd
AllowVolumeExpansion:  True
MountOptions:          <none>
ReclaimPolicy:         Delete
VolumeBindingMode:     WaitForFirstConsumer
Events:                <none>
akalenyu commented 1 year ago

Yep we have the same issue in https://github.com/kubevirt/containerized-data-importer/issues/2915#issuecomment-1747266928 May I ask what is the use case for bypassing WFFC for a blank disk? doesn't it get consumed by a VM?