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

Bug 1768538

Summary: Storage class not displayed when using beta annotation in the volume
Product: OpenShift Container Platform Reporter: Sergio <sregidor>
Component: Migration ToolingAssignee: Scott Seago <sseago>
Status: CLOSED ERRATA QA Contact: Sergio <sregidor>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.0CC: chezhang, dymurray, rpattath, xjiang
Target Milestone: ---   
Target Release: 4.3.0   
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: 2020-02-06 20:20:44 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
Logs and yaml definitions none

Description Sergio 2019-11-04 16:43:42 UTC
Created attachment 1632625 [details]
Logs and yaml definitions

Description of problem:
Volumes with storage class defined via annotation  "volume.beta.kubernetes.io/storage-class" are not properly identified as members of this storage class by the controller.

Version-Release number of selected component (if applicable):
Target cluster:
OCP 4.2
$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.2.0-0.nightly-2019-11-01-115323   True        False         12h     Cluster version is 4.2.0-0.nightly-2019-11-01-115323

Source cluster:
OCP 4.1
$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.1.0-0.nightly-2019-11-01-212340   True        False         12h     Cluster version is 4.1.0-0.nightly-2019-11-01-212340

Controller:
      image: registry.redhat.io/rhcam-1-0/openshift-migration-controller-rhel8:v1.0
      imageID: registry.redhat.io/rhcam-1-0/openshift-migration-controller-rhel8@sha256:fe81b226dd2f79541fac9f2ba8766086d2d93fcd2f8ca0f7efbb86e3ff1f1f42

Velero:
      image: registry.redhat.io/rhcam-1-0/openshift-migration-velero-rhel8:v1.0
      imageID: registry.redhat.io/rhcam-1-0/openshift-migration-velero-rhel8@sha256:e4afec9bf56e75fc7fda793a31a7ed21fa87babf1abd779ef2865085c6cc3449
      image: registry.redhat.io/rhcam-1-0/openshift-migration-plugin-rhel8:v1.0
      imageID: registry.redhat.io/rhcam-1-0/openshift-migration-plugin-rhel8@sha256:f8c18177972624a209cd20277f844d885abd243161b50f96f7a37636b7d2f042


How reproducible:
Always

Steps to Reproduce:
1.Create a storage class

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: nfs-sc
provisioner: no-provisioning
parameters:

2. Create a PV with a volume beta annotation pointing to the create storage class, and using nfs server

apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    volume.beta.kubernetes.io/storage-class: nfs-sc
  finalizers:
  - kubernetes.io/pv-protection
  name: mysql-data
spec:
  accessModes:
  - ReadWriteMany
  capacity:
    storage: 2Gi
  nfs:
    path: /dbtest                     #relative path 
    server: XX.XX.XX.XX     # nfs remote server 
  persistentVolumeReclaimPolicy: Recycle
  volumeMode: Filesystem

3. Create an application using this storage class. For instance 

curl -o mysql-persistent-template.yaml  https://raw.githubusercontent.com/fusor/mig-controller/master/docs/scenarios/nfs-pv/mysql-persistent-template.yaml 

Modify the template to use "nfs-sc" storage class.	

3. Create a plan. To migrate it.



Actual results:
In "Persistent volumes" screen when creating the plan, the storage class is not detected and is presented as None.

The migplan shows that the controller could not detect the storage class:
...
  - capacity: 100Gi
    name: pv2
    pvc:
      accessModes:
      - ReadWriteOnce
      name: mysql
      namespace: mysql-persistent
    selection:
      action: copy
      copyMethod: filesystem
      storageClass: gp2
    supported:
      actions:
      - copy
      - move
      copyMethods:
      - filesystem
      - snapshot
  srcMigClusterRef:


Expected results:
The storage class should be detected as "nfs-sc".

Additional info:
Included a tgz file file with logs, pvs, pvcs plans...

Comment 1 Scott Seago 2019-12-16 22:43:43 UTC
Fix is here: https://github.com/fusor/mig-controller/pull/381

Comment 2 Dylan Murray 2020-01-10 19:10:51 UTC
This was included in: openshift-migration-controller-container-v1.1-1

Comment 3 Dylan Murray 2020-01-10 19:11:17 UTC
Sorry, included the wrong build: openshift-migration-controller-container-v1.1-1.2

Comment 5 Sergio 2020-01-15 12:43:25 UTC
Verified in CAM 1.1 osbs

Controller:
    image: image-registry.openshift-image-registry.svc:5000/rhcam-1-1/openshift-migration-controller-rhel8@sha256:b55c0c36333656a46e1d0500cf11cc8aa06e093d312e7c54f8e1075d4ab4c6c1


The resulting plan spec was (contains the storage class, and was displayed in the UI):
spec:
  destMigClusterRef:
    name: host
    namespace: openshift-migration
  migStorageRef:
    name: gcpbucket
    namespace: openshift-migration
  namespaces:
  - mysql-persistent
  persistentVolumes:
  - capacity: 100Gi
    name: pv10
    pvc:
      accessModes:
      - ReadWriteOnce
      name: mysql
      namespace: mysql-persistent
    selection:
      action: copy
      copyMethod: filesystem
      storageClass: standard
    storageClass: nfs-sc
    supported:
      actions:
      - copy
      - move
      copyMethods:
      - filesystem
      - snapshot
  srcMigClusterRef:
    name: ocp311new
    namespace: openshift-migration

Comment 7 errata-xmlrpc 2020-02-06 20:20:44 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, 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/RHEA-2020:0440