Bug 2115728

Summary: PV created using LSO with LV using by-path ids shows incorrect annotation.
Product: OpenShift Container Platform Reporter: Deepti Naphade <dnaphade>
Component: StorageAssignee: Jonathan Dobson <jdobson>
Storage sub component: Local Storage Operator QA Contact: Chao Yang <chaoyang>
Status: CLOSED WONTFIX Docs Contact:
Severity: medium    
Priority: medium CC: Holger.Wolf, jsafrane, wduan
Version: 4.11   
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-11 00:20:45 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:

Description Deepti Naphade 2022-08-05 07:37:55 UTC
Description of problem: PV created using LSO LV using by-path ids shows incorrect annotation.


Version-Release number of selected component (if applicable):
4.11.0-rc.6
4.11.0-202207121147 provided by Red Hat

How reproducible: Always

Steps to Reproduce:
1. Install a cluster.
2. Install LSO
3. Create LocalVolume Resource using by-path ids, for example:
apiVersion: "local.storage.openshift.io/v1"
kind: "LocalVolume"
metadata:
  name: "local-disks"
  namespace: "openshift-local-storage"
spec:
  nodeSelector:
    nodeSelectorTerms:
    - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - worker5
          - worker7
  storageClassDevices:
    - storageClassName: "local-sc"
      volumeMode: Filesystem
      fsType: xfs
      devicePaths:
        - /dev/disk/by-path/ccw-0.0.0003
        - /dev/disk/by-path/ccw-0.0.0004



Actual results:
Verify the generated PVs, The mount path uses by-path id. However Annotations shows vda, vdb which may change with reboot of the node and can be misleading.

annotations:
    pv.kubernetes.io/provisioned-by: local-volume-provisioner-worker7-d55727b8-b74a-4fca-bc6d-53925ba5deb6
    storage.openshift.com/device-name: vdd

local:
    path: /mnt/local-storage/local-sc/ccw-0.0.0003
    fsType: xfs

Expected results:
 By-path id be used instead.

Master Log:

Node Log (of failed PODs):

PV Dump:
kind: PersistentVolume
apiVersion: v1
metadata:
  name: local-pv-1994f0dd
  uid: b8b55642-cd87-4997-a982-bdc49b332595
  resourceVersion: '423480'
  creationTimestamp: '2022-08-02T19:46:50Z'
  labels:
    kubernetes.io/hostname: worker7
    storage.openshift.com/local-volume-owner-name: local-disks
    storage.openshift.com/local-volume-owner-namespace: openshift-local-storage
    storage.openshift.com/owner-kind: LocalVolume
    storage.openshift.com/owner-name: local-disks
    storage.openshift.com/owner-namespace: openshift-local-storage
  annotations:
    pv.kubernetes.io/provisioned-by: local-volume-provisioner-worker7-d55727b8-b74a-4fca-bc6d-53925ba5deb6
    storage.openshift.com/device-name: vdd
  finalizers:
    - kubernetes.io/pv-protection
  managedFields:
    - manager: diskmaker
      operation: Update
      apiVersion: v1
      time: '2022-08-02T19:46:50Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:pv.kubernetes.io/provisioned-by': {}
            'f:storage.openshift.com/device-name': {}
          'f:labels':
            .: {}
            'f:kubernetes.io/hostname': {}
            'f:storage.openshift.com/local-volume-owner-name': {}
            'f:storage.openshift.com/local-volume-owner-namespace': {}
            'f:storage.openshift.com/owner-kind': {}
            'f:storage.openshift.com/owner-name': {}
            'f:storage.openshift.com/owner-namespace': {}
        'f:spec':
          'f:accessModes': {}
          'f:capacity':
            .: {}
            'f:storage': {}
          'f:local':
            .: {}
            'f:fsType': {}
            'f:path': {}
          'f:nodeAffinity':
            .: {}
            'f:required': {}
          'f:persistentVolumeReclaimPolicy': {}
          'f:storageClassName': {}
          'f:volumeMode': {}
    - manager: kube-controller-manager
      operation: Update
      apiVersion: v1
      time: '2022-08-02T19:46:50Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:status':
          'f:phase': {}
      subresource: status
spec:
  capacity:
    storage: 2008Mi
  local:
    path: /mnt/local-storage/local-sc/ccw-0.0.0003
    fsType: xfs
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-sc
  volumeMode: Filesystem
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
                - worker7
status:
  phase: Available

PVC Dump:

StorageClass Dump (if StorageClass used by PV/PVC):

Additional info:

LV.yaml
apiVersion: "local.storage.openshift.io/v1"
kind: "LocalVolume"
metadata:
  name: "local-disks"
  namespace: "openshift-local-storage"
spec:
  nodeSelector:
    nodeSelectorTerms:
    - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - worker5
          - worker7
  storageClassDevices:
    - storageClassName: "local-sc"
      volumeMode: Filesystem
      fsType: xfs
      devicePaths:
        - /dev/disk/by-path/ccw-0.0.0003
        - /dev/disk/by-path/ccw-0.0.0004
        - /dev/disk/by-path/ccw-0.0.0005
        - /dev/disk/by-path/ccw-0.0.0006
        - /dev/disk/by-path/ccw-0.0.0007
        - /dev/disk/by-path/ccw-0.0.0008
        - /dev/disk/by-path/ccw-0.0.0009

Comment 1 Deepti Naphade 2022-08-05 07:39:20 UTC
Related defects: https://bugzilla.redhat.com/show_bug.cgi?id=2052618

Comment 5 Jonathan Dobson 2023-02-11 00:20:45 UTC
We no longer track bugs in Bugzilla, migrated to Jira:
https://issues.redhat.com/browse/OCPBUGS-7343