Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1782650

Summary: UI creates block mode disk for hostpath provisioner storage class
Product: OpenShift Container Platform Reporter: Guohua Ouyang <gouyang>
Component: Console Kubevirt PluginAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED NOTABUG QA Contact: Nelly Credi <ncredi>
Severity: low Docs Contact:
Priority: low    
Version: 4.3.0CC: aos-bugs, fkrepins, gouyang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-13 01:15:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vm yaml none

Description Guohua Ouyang 2019-12-12 02:44:20 UTC
Description of problem:
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1739456#c9

It appears the UI is trying to create block mode disks, which are not possible for a hostpath provisioner. And that is why it remains pending.

[cnv-qe-jenkins@cnv-executor-guohua ~]$ oc get pvc
NAME            STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS           AGE
cirros          Bound     pvc-eb26f290-fef4-4aac-a95d-1d66556af826   2Gi        RWO            rook-ceph-block        23m
cirros-hpp      Bound     pvc-c16fd713-d4f9-4347-a1f5-6267f8510230   39Gi       RWO            hostpath-provisioner   7m56s
cirros-hpp1     Bound     pvc-7e79f54b-6901-4c6d-9b07-9496fa487e7d   39Gi       RWO            hostpath-provisioner   5m16s
test-rootdisk   Pending                                                                        hostpath-provisioner   4m40s
[cnv-qe-jenkins@cnv-executor-guohua ~]$ oc describe  pvc test-rootdisk
Name:          test-rootdisk
Namespace:     default
StorageClass:  hostpath-provisioner
Status:        Pending
Volume:        
Labels:        app=containerized-data-importer
               cdi-controller=test-rootdisk
Annotations:   cdi.kubevirt.io/storage.contentType: kubevirt
               cdi.kubevirt.io/storage.import.endpoint: https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
               cdi.kubevirt.io/storage.import.importPodName: importer-test-rootdisk-csrlv
               cdi.kubevirt.io/storage.import.source: http
               cdi.kubevirt.io/storage.pod.phase: Pending
               volume.beta.kubernetes.io/storage-provisioner: kubevirt.io/hostpath-provisioner
               volume.kubernetes.io/selected-node: host-172-16-0-18
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Block <-------------
Mounted By:    importer-test-rootdisk-csrlv
Events:
  Type     Reason                Age                   From                                                                                              Message
  ----     ------                ----                  ----                                                                                              -------
  Normal   WaitForFirstConsumer  4m44s                 persistentvolume-controller                                                                       waiting for first consumer to be created before binding
  Warning  ProvisioningFailed    30s (x3 over 4m44s)   kubevirt.io/hostpath-provisioner_hostpath-provisioner-khzgs_0a359049-96bf-4510-9890-038024938b67  kubevirt.io/hostpath-provisioner does not support block volume provisioning <---------
  Normal   ExternalProvisioning  10s (x22 over 4m44s)  persistentvolume-controller                                                                       waiting for a volume to be created, either by external provisioner "kubevirt.io/hostpath-provisioner" or manually created by system administrator

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create a VM from URL and choose hostpath provisioner as the disk storage class
2.
3.

Actual results:
The backend pvc is pending because hostpath provisioner does not support block mode.

Expected results:
It should use filesystem instead of the block mode when the sc is hostpath provisioner.

Additional info:

Comment 1 Tomas Jelinek 2019-12-12 08:07:45 UTC
It is configured by kubevirt-storage-class-defaults config map. Please refer to:
https://bugzilla.redhat.com/show_bug.cgi?id=1724654#c4
and try to configure your storage class to use filesystem mode.

Comment 2 Guohua Ouyang 2019-12-12 08:50:51 UTC
I've given it a try, but it still create the PVC with block mode.

$ oc get cm kubevirt-storage-class-defaults -n openshift-cnv -o yaml
apiVersion: v1
data:
  accessMode: ReadWriteMany
  hostpath-provisioner.accessMode: ReadWriteOnce
  hostpath-provisioner.volumeMode: Filesystem
  local-sc.accessMode: ReadWriteOnce
  local-sc.volumeMode: Filesystem
  volumeMode: Filesystem
kind: ConfigMap
metadata:
  creationTimestamp: "2019-12-12T08:20:52Z"
  labels:
    app: hyperconverged-cluster
  name: kubevirt-storage-class-defaults
  namespace: openshift-cnv
  ownerReferences:
  - apiVersion: hco.kubevirt.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: HyperConverged
    name: hyperconverged-cluster
    uid: 2148a988-a1ca-44f3-8d33-ab160e879755
  resourceVersion: "1296080"
  selfLink: /api/v1/namespaces/openshift-cnv/configmaps/kubevirt-storage-class-defaults
  uid: 14455a39-f0cf-4b14-976a-1baf84ac81db

Comment 3 Tomas Jelinek 2019-12-12 09:02:34 UTC
hostpath-provisioner.accessMode: ReadWriteOnce

this looks suspicious. It should be the name of your storage class. Is your storage class name really "hostpath-provisioner"?

Comment 4 Tomas Jelinek 2019-12-12 13:34:52 UTC
We can not reproduce this on any environment and the environment on which it reproduced is gone. Obviously it is not a generic issue, most probably some misconfiguration on the env. Lowering priority and will keep trying to understand how it happened, but not blocking on it.

Comment 5 Filip Krepinsky 2019-12-12 16:12:35 UTC
It would be helpful to see the VM YAML once the VM is created by the wizard

Comment 6 Guohua Ouyang 2019-12-13 01:00:52 UTC
Created attachment 1644608 [details]
vm yaml

Comment 7 Guohua Ouyang 2019-12-13 01:15:35 UTC
Don't see this on a fresh deployed env, it's probably a misconfiguration issue, close it for now.