Bug 1963899 - [Local Volume Set] Provision disk failed when disk label has unsupported value like ":"
Summary: [Local Volume Set] Provision disk failed when disk label has unsupported valu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.7.z
Assignee: Rohan CJ
QA Contact: Chao Yang
URL:
Whiteboard:
Depends On: 1933630
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-24 11:04 UTC by Rohan CJ
Modified: 2021-08-30 08:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1933630
Environment:
Last Closed: 2021-07-26 17:35:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift local-storage-operator pull 239 0 None open Bug 1963899: Move device information to annotations 2021-05-25 06:54:36 UTC
Red Hat Product Errata RHBA-2021:2762 0 None None None 2021-07-26 17:35:37 UTC

Description Rohan CJ 2021-05-24 11:04:07 UTC
+++ This bug was initially created as a clone of Bug #1933630 +++

Description of problem:
After adding iscsi disk on node, I get following disks, one disk in /dev/disk/by-id has the id like scsi-1LIO-ORG_disk01:60c21f72-174c-467b-a592-f9cd88ff01b2 as below:
sh-4.4# lsblk 
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0     2G  0 disk 
sdb       8:16   0     2G  0 disk 
sdc       8:32   0     2G  0 disk 
sdd       8:48   0     2G  0 disk 

sh-4.4# ls /dev/sd*
/dev/sda  /dev/sdb  /dev/sdc  /dev/sdd

sh-4.4# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-1LIO-ORG_disk01:60c21f72-174c-467b-a592-f9cd88ff01b2 -> ../../sdb

Then I created local volume set, but this volume failed to be provisioned with following error:
{"level":"info","ts":1614582558.1743612,"logger":"localvolumeset-symlink-controller","msg":"creating","Request.Namespace":"openshift-local-storage","Request.Name":"lvs","Device.Name":"sdb","pv.Name":"local-pv-2e4d7067"}
{"level":"error","ts":1614582558.1798408,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"localvolumeset-symlink-controller","request":"openshift-local-storage/lvs","error":"could not provision disk: PersistentVolume \"local-pv-2e4d7067\" is invalid: metadata.labels: Invalid value: \"scsi-1LIO-ORG_disk01:60c21f72-174c-467b-a592-f9cd88ff01b2\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/openshift/local-storage-operator/vendor/github.com/go-logr/zapr/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/src/github.com/openshift/local-storage-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/src/github.com/openshift/local-storage-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/go/src/github.com/openshift/local-storage-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/go/src/github.com/openshift/local-storage-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/github.com/openshift/local-storage-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/github.com/openshift/local-storage-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}

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

How reproducible:
Always in my test

Steps to Reproduce:
See Description:
1. Create iscsi_targe provisioner
2. Creare local volume set

Actual results:
iscsi disk could not be provisioned.

Expected results:
iscsi disk should be provisioned.


Master Log:

Node Log (of failed PODs):

PV Dump:
  
PVC Dump:

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

Additional info:

--- Additional comment from Wei Duan on 2021-03-02 03:11:43 UTC ---

Add the local storage version:
oc get csv -A
NAMESPACE                              NAME                                           DISPLAY          VERSION                 REPLACES   PHASE
openshift-local-storage                local-storage-operator.4.7.0-202102110027.p0   Local Storage    4.7.0-202102110027.p0              Succeeded


And all the records from /dev/disk/by-id/
sh-4.4# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-1LIO-ORG_disk01:60c21f72-174c-467b-a592-f9cd88ff01b2 -> ../../sdb
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-1LIO-ORG_disk02:c0708dd2-606a-490d-863c-009bff119cfd -> ../../sdd
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-3600140560c21f72174c467ba592f9cd8 -> ../../sdb
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-36001405c0708dd2606a490d863c009bf -> ../../sdd
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-SLIO-ORG_disk01_60c21f72-174c-467b-a592-f9cd88ff01b2 -> ../../sdb
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 scsi-SLIO-ORG_disk02_c0708dd2-606a-490d-863c-009bff119cfd -> ../../sdd
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 wwn-0x600140560c21f72174c467ba592f9cd8 -> ../../sdb
lrwxrwxrwx. 1 root root 9 Mar  1 07:01 wwn-0x6001405c0708dd2606a490d863c009bf -> ../../sdd

--- Additional comment from Wei Duan on 2021-03-02 03:12:23 UTC ---



--- Additional comment from Jan Safranek on 2021-03-02 15:41:45 UTC ---

Having /dev/disk/by-id names in PV labels is problematic, as they can have weird characters. We need either escape those (ugly!) or move them to annotations (but then you can't select them using a label selector - do we need this?)

--- Additional comment from Rohan CJ on 2021-04-23 06:11:27 UTC ---

Fixed in https://github.com/openshift/local-storage-operator/pull/219

--- Additional comment from Rohan CJ on 2021-04-23 06:14:33 UTC ---

To verify, check if PV labels with keys storage.openshift.com/device-name,storage.openshift.com/device-id move to annotations.

--- Additional comment from Chao Yang on 2021-04-26 10:22:57 UTC ---

oc get pv local-pv-8f6c0fad -o json | jq .metadata.annotations
{
  "storage.openshift.com/device-id": "scsi-1LIO-ORG_disk02:0c52d090-31ca-469d-9805-d743d467942d",
  "storage.openshift.com/device-name": "sdc"
}

local-storage-operator.4.8.0-202104231341.p0

Comment 1 Jan Safranek 2021-06-04 13:25:39 UTC
Why is this cloned to 4.7? I don't see any customer ticket, it seems nobody is complaining about this. In addition, we typically don't backport medium severity bugs.

Comment 2 Rohan CJ 2021-06-04 13:52:44 UTC
Running into this on RHEV platforms, OCS ran into to this while validating OCS for GA on RHEV.

Comment 3 Rohan CJ 2021-06-24 03:11:46 UTC
@jan, can we move forward with this?

Comment 6 Chao Yang 2021-07-06 06:22:46 UTC
oc get pv local-pv-af309dc7 -o json | jq .metadata.annotations
{
  "pv.kubernetes.io/provisioned-by": "local-volume-provisioner-ip-10-0-186-26.us-east-2.compute.internal-162f437c-ca10-472a-a309-6285d7e77f27",
  "storage.openshift.com/device-id": "scsi-1LIO-ORG_disk02:208bb049-e740-4a76-af28-bebf87962870",
  "storage.openshift.com/device-name": "sdc"
}

oc get csv
NAME                                        DISPLAY         VERSION              REPLACES   PHASE
local-storage-operator.4.7.0-202107022100   Local Storage   4.7.0-202107022100              Succeeded

Comment 8 Siddharth Sharma 2021-07-09 21:07:41 UTC
OCP engineering has decided to not ship 4.7.20 due to a blocker. This bug will be shipped as part of next z-stream release 4.7.21 planned on July 27th

Comment 11 errata-xmlrpc 2021-07-26 17:35:21 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 (OpenShift Container Platform 4.7.21 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/RHBA-2021:2762


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