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

Bug 1906391

Summary: [Cinder CSI driver] Mounted volume using small size when cloning a larger size pvc
Product: OpenShift Container Platform Reporter: Wei Duan <wduan>
Component: StorageAssignee: Mike Fedosin <mfedosin>
Storage sub component: OpenStack CSI Drivers QA Contact: Wei Duan <wduan>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, m.andre, pprinett
Version: 4.7   
Target Milestone: ---   
Target Release: 4.8.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: 2021-03-24 16:23:07 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 Wei Duan 2020-12-10 12:19:23 UTC
Description of problem:
When cloned a target PVC with a larger size(4G) than the original PVC(2G), the mounted volume size for the container is accurately 2G although there is a 4G device on attached node.

Version-Release number of selected component (if applicable):
4.7.0-0.nightly-2020-12-09-112139

How reproducible:
Always

Steps to Reproduce:
0. Install OSP cluster and cinder csi driver is installed.
1. Create mypod-ori and mypvc-ori(2G)
2. Create mypvc-clone cloned from mypvc-ori, set the storage size to 4G
3. Create mypod-clone to consume mypvc-clone
4. Check the mounted volume in the pod
5. Check the mounted volume on the attached node
6. Check the block device on the attached node


Actual results:
1. pvc info:
$ oc get pvc
NAME          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
mypvc-clone   Bound    pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc   4Gi        RWO            standard-csi   41m
mypvc-ori     Bound    pvc-a481f003-5e7b-4d7b-9d3b-f76fb2570907   2Gi        RWO            standard-csi   48m

2. check the mounted volume in the pod is 2G
$ oc rsh mypod-clone
/ # mount | grep /mnt/local
/dev/vdc on /mnt/local type ext4 (rw,seclabel,relatime)
/ # df -h | grep /mnt/local
/dev/vdc                  1.9G      6.0M      1.9G   0% /mnt/local

3. check the mounted volume on the attached node is 2G
# df -h | grep pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/globalmount   
/dev/vdc        2.0G  6.0M  1.9G   1% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/globalmount

4. check the block device on the attached node is 4G
# lsblk | grep pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/globalmount
vdc    252:32   0    4G  0 disk /var/lib/kubelet/pods/20d1d6bc-251b-4dd2-8b63-41dff74ac79e/volumes/kubernetes.io~csi/pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/m


Expected results:
Mounted volume size in the pod should be 4G. 

Master Log:

Node Log (of failed PODs):

PV Dump:
  
PVC Dump:

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

Additional info:

Comment 1 Pierre Prinetti 2021-01-06 15:38:31 UTC
From bug triage:

We need more info to understand the issue.
What is the expected behaviour? How is the behaviour different than with the in-tree driver?

Can you provide more details on the commands / yaml files you used so that we can reproduce?

Thanks!

Comment 3 Wei Duan 2021-01-27 02:25:46 UTC
Sorry I missed the "needinfo"

When I clone origin volume(2G) with large size(4G), we would like: 
1. cloned pvc is 4G  
mypvc-clone   Bound    pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc   4Gi        RWO            standard-csi   41m
-> expected
  
2. attached device size is 4G
# lsblk | grep pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/globalmount
vdc    252:32   0    4G  0 disk /var/lib/kubelet/pods/20d1d6bc-251b-4dd2-8b63-41dff74ac79e/volumes/kubernetes.io~csi/pvc-b02e301c-69c4-4d9c-a71d-1317cad030bc/m
-> expected

3. Filesystem size should be 4G 
/ # df -h | grep /mnt/local
/dev/vdc                  1.9G      6.0M      1.9G   0% /mnt/local
-> not expexted

Finally, the filesystem size is what we care about.

Comment 5 Mike Fedosin 2021-03-24 16:23:07 UTC

*** This bug has been marked as a duplicate of bug 1919291 ***