Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesystem is not resized when restoring from snapshot/cloning to larger size than origin #100

Merged
merged 6 commits into from
Jan 9, 2023

Conversation

RomanBednar
Copy link
Contributor

@RomanBednar RomanBednar commented Oct 13, 2022

Resolves #85

Sanity tests need to be disabled (or fixed) first: kubernetes/test-infra#27795

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 13, 2022
@RomanBednar RomanBednar changed the title filesystem is not resized when restoring from snapshot with a bigger size WIP: filesystem is not resized when restoring from snapshot with a bigger size Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2022
@RomanBednar RomanBednar changed the title WIP: filesystem is not resized when restoring from snapshot with a bigger size filesystem is not resized when restoring from snapshot/cloning to larger size than origin Oct 21, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 21, 2022
@coveralls
Copy link

coveralls commented Oct 21, 2022

Coverage Status

Coverage: 84.635% (+0.2%) from 84.439% when pulling 1f145af on RomanBednar:snapshot-resize into 886f02c on kubernetes-sigs:master.

@k8s-ci-robot
Copy link
Contributor

@RomanBednar: GitHub didn't allow me to assign the following users: arahamad-zz.

Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @arahamad-zz

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 1, 2022
@RomanBednar
Copy link
Contributor Author

/assign @ambiknai

@RomanBednar
Copy link
Contributor Author

/retest

@RomanBednar
Copy link
Contributor Author

@arahamad-zz PTAL as well since you might have more context about it.

pkg/ibmcsidriver/node.go Outdated Show resolved Hide resolved
@ambiknai
Copy link
Contributor

ambiknai commented Nov 3, 2022

With our existing driver, I was not able to recreate the issue

Could you please help to explain why this change is required.

 
➜  demo oc describe pvc restore-pvc1                                                                                  
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Bound
Volume:        pvc-806bb7e6-698f-4c4d-befe-95c25d61638c
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      100Gi
Access Modes:  RWO
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                 Age                 From                                                                                      Message
  ----    ------                 ----                ----                                                                                      -------
  Normal  Provisioning           103s                vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning   60s (x4 over 103s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
  Normal  ProvisioningSucceeded  55s                 vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  Successfully provisioned volume pvc-806bb7e6-698f-4c4d-befe-95c25d61638c
➜  demo oc get pvc                                                                                                    
NAME                       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                 AGE
csi-block-pvc-custom-one   Bound    pvc-ade48371-4627-4660-9b30-75e7171a8381   10Gi       RWO            ibmc-vpc-block-5iops-tier    43h
restore-pvc1               Bound    pvc-806bb7e6-698f-4c4d-befe-95c25d61638c   100Gi      RWO            ibmc-vpc-block-10iops-tier   108s
➜  demo oc create -f podtwo.yaml 
deployment.apps/podtwo created


➜  demo oc get pods
NAME                         READY   STATUS    RESTARTS   AGE
podtwo-59f696d697-xb88s      1/1     Running   0          79s
testcustom-cfd587b66-rbq2p   1/1     Running   0          4m51s
➜  demo oc exec -it podtwo-59f696d697-xb88s  /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@podtwo-59f696d697-xb88s:/# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    252:0    0  100G  0 disk 
|-vda1 252:1    0    1G  0 part 
`-vda2 252:2    0   99G  0 part /etc/resolv.conf
vdb    252:16   0  372K  0 disk 
vdc    252:32   0   44K  0 disk 
vdd    252:48   0   10G  0 disk 
vde    252:64   0  100G  0 disk /myvolumepath
root@podtwo-59f696d697-xb88s:/# oc describe pod podtwo-59f696d697-xb88s
bash: oc: command not found
root@podtwo-59f696d697-xb88s:/# exit
exit
command terminated with exit code 127
➜  demo oc describe pod podtwo-59f696d697-xb88s
Name:         podtwo-59f696d697-xb88s
Namespace:    default
Priority:     0
Node:         10.240.0.55/10.240.0.55
Start Time:   Wed, 02 Nov 2022 10:57:47 +0530
Labels:       app=podtwo
              pod-template-hash=59f696d697
Annotations:  cni.projectcalico.org/containerID: 4827e3bf290fce03eaf302efcf188b64943ce968f3f5fe5831d39d5c3742e6a9
              cni.projectcalico.org/podIP: 172.17.211.39/32
              cni.projectcalico.org/podIPs: 172.17.211.39/32
Status:       Running
IP:           172.17.211.39
IPs:
  IP:           172.17.211.39
Controlled By:  ReplicaSet/podtwo-59f696d697
Containers:
  container-name:
    Container ID:   containerd://2367233072c99e668c5cdf2d727e4e79f1d2c86499bd900aebfb236fdf8b33e5
    Image:          nginx
    Image ID:       docker.io/library/nginx@sha256:943c25b4b66b332184d5ba6bb18234273551593016c0e0ae906bab111548239f
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Wed, 02 Nov 2022 10:58:58 +0530
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /myvolumepath from pvc-name (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-jnd2h (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  pvc-name:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  restore-pvc1
    ReadOnly:   false
  kube-api-access-jnd2h:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 600s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 600s
Events:
  Type    Reason                  Age    From                     Message
  ----    ------                  ----   ----                     -------
  Normal  Scheduled               3m34s  default-scheduler        Successfully assigned default/podtwo-59f696d697-xb88s to 10.240.0.55
  Normal  SuccessfulAttachVolume  2m27s  attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-806bb7e6-698f-4c4d-befe-95c25d61638c"
  Normal  Pulling                 2m24s  kubelet                  Pulling image "nginx"
  Normal  Pulled                  2m23s  kubelet                  Successfully pulled image "nginx" in 479.047887ms
  Normal  Created                 2m23s  kubelet                  Created container container-name
  Normal  Started                 2m23s  kubelet                  Started container container-name
➜  demo 
➜  demo oc get pvc                   
NAME                       STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                 AGE
csi-block-pvc-custom-one   Bound     pvc-ade48371-4627-4660-9b30-75e7171a8381   10Gi       RWO            ibmc-vpc-block-5iops-tier    43h
restore-pvc1               Pending                                                                        ibmc-vpc-block-10iops-tier   30s
➜  demo oc describe pvc restore-pvc1 
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                Age               From                                                                                      Message
  ----    ------                ----              ----                                                                                      -------
  Normal  Provisioning          34s               vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning  6s (x3 over 34s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
➜  demo oc describe pvc restore-pvc1 
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                Age                From                                                                                      Message
  ----    ------                ----               ----                                                                                      -------
  Normal  Provisioning          38s                vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning  10s (x3 over 38s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
➜  demo oc describe pvc restore-pvc1 
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                Age                From                                                                                      Message
  ----    ------                ----               ----                                                                                      -------
  Normal  Provisioning          41s                vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning  13s (x3 over 41s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
➜  demo oc describe pvc restore-pvc1 
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                Age               From                                                                                      Message
  ----    ------                ----              ----                                                                                      -------
  Normal  Provisioning          44s               vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning  1s (x4 over 44s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
➜  demo kubectl logs -n kube-system ibm-vpc-block-csi-controller-0  -c iks-vpc-block-driver > iks-vpc-block-driver.log 
➜  demo kubectl logs -n kube-system ibm-vpc-block-csi-controller-0  -c iks-vpc-block-driver > iks-vpc-block-driver.log
➜  demo oc describe pvc restore-pvc1                                                                                  
Name:          restore-pvc1
Namespace:     default
StorageClass:  ibmc-vpc-block-10iops-tier
Status:        Bound
Volume:        pvc-806bb7e6-698f-4c4d-befe-95c25d61638c
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
               volume.kubernetes.io/storage-provisioner: vpc.block.csi.ibm.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      100Gi
Access Modes:  RWO
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      snapshot-csi-block-6
Used By:     <none>
Events:
  Type    Reason                 Age                 From                                                                                      Message
  ----    ------                 ----                ----                                                                                      -------
  Normal  Provisioning           103s                vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  External provisioner is provisioning volume for claim "default/restore-pvc1"
  Normal  ExternalProvisioning   60s (x4 over 103s)  persistentvolume-controller                                                               waiting for a volume to be created, either by external provisioner "vpc.block.csi.ibm.io" or manually created by system administrator
  Normal  ProvisioningSucceeded  55s                 vpc.block.csi.ibm.io_ibm-vpc-block-csi-controller-0_b34802ae-3391-4835-815a-a405ea593912  Successfully provisioned volume pvc-806bb7e6-698f-4c4d-befe-95c25d61638c
➜  demo oc get pvc                                                                                                    
NAME                       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                 AGE
csi-block-pvc-custom-one   Bound    pvc-ade48371-4627-4660-9b30-75e7171a8381   10Gi       RWO            ibmc-vpc-block-5iops-tier    43h
restore-pvc1               Bound    pvc-806bb7e6-698f-4c4d-befe-95c25d61638c   100Gi      RWO            ibmc-vpc-block-10iops-tier   108s
➜  demo oc create -f podtwo.yaml 
deployment.apps/podtwo created
➜  demo oc get pods
NAME                         READY   STATUS              RESTARTS   AGE
podtwo-59f696d697-xb88s      0/1     ContainerCreating   0          56s
testcustom-cfd587b66-rbq2p   1/1     Running             0          4m28s
➜  demo oc get pods
NAME                         READY   STATUS              RESTARTS   AGE
podtwo-59f696d697-xb88s      0/1     ContainerCreating   0          60s
testcustom-cfd587b66-rbq2p   1/1     Running             0          4m32s
➜  demo oc get pods
NAME                         READY   STATUS              RESTARTS   AGE
podtwo-59f696d697-xb88s      0/1     ContainerCreating   0          63s
testcustom-cfd587b66-rbq2p   1/1     Running             0          4m35s
➜  demo oc get pods
NAME                         READY   STATUS              RESTARTS   AGE
podtwo-59f696d697-xb88s      0/1     ContainerCreating   0          66s
testcustom-cfd587b66-rbq2p   1/1     Running             0          4m38s
➜  demo oc get pods
NAME                         READY   STATUS    RESTARTS   AGE
podtwo-59f696d697-xb88s      1/1     Running   0          79s
testcustom-cfd587b66-rbq2p   1/1     Running   0          4m51s
➜  demo oc exec -it podtwo-59f696d697-xb88s  /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@podtwo-59f696d697-xb88s:/# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    252:0    0  100G  0 disk 
|-vda1 252:1    0    1G  0 part 
`-vda2 252:2    0   99G  0 part /etc/resolv.conf
vdb    252:16   0  372K  0 disk 
vdc    252:32   0   44K  0 disk 
vdd    252:48   0   10G  0 disk 
vde    252:64   0  100G  0 disk /myvolumepath
root@podtwo-59f696d697-xb88s:/# oc describe pod podtwo-59f696d697-xb88s
bash: oc: command not found
root@podtwo-59f696d697-xb88s:/# exit
exit
command terminated with exit code 127
➜  demo oc describe pod podtwo-59f696d697-xb88s
Name:         podtwo-59f696d697-xb88s
Namespace:    default
Priority:     0
Node:         10.240.0.55/10.240.0.55
Start Time:   Wed, 02 Nov 2022 10:57:47 +0530
Labels:       app=podtwo
              pod-template-hash=59f696d697
Annotations:  cni.projectcalico.org/containerID: 4827e3bf290fce03eaf302efcf188b64943ce968f3f5fe5831d39d5c3742e6a9
              cni.projectcalico.org/podIP: 172.17.211.39/32
              cni.projectcalico.org/podIPs: 172.17.211.39/32
Status:       Running
IP:           172.17.211.39
IPs:
  IP:           172.17.211.39
Controlled By:  ReplicaSet/podtwo-59f696d697
Containers:
  container-name:
    Container ID:   containerd://2367233072c99e668c5cdf2d727e4e79f1d2c86499bd900aebfb236fdf8b33e5
    Image:          nginx
    Image ID:       docker.io/library/nginx@sha256:943c25b4b66b332184d5ba6bb18234273551593016c0e0ae906bab111548239f
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Wed, 02 Nov 2022 10:58:58 +0530
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /myvolumepath from pvc-name (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-jnd2h (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  pvc-name:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  restore-pvc1
    ReadOnly:   false
  kube-api-access-jnd2h:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 600s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 600s
Events:
  Type    Reason                  Age    From                     Message
  ----    ------                  ----   ----                     -------
  Normal  Scheduled               3m34s  default-scheduler        Successfully assigned default/podtwo-59f696d697-xb88s to 10.240.0.55
  Normal  SuccessfulAttachVolume  2m27s  attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-806bb7e6-698f-4c4d-befe-95c25d61638c"
  Normal  Pulling                 2m24s  kubelet                  Pulling image "nginx"
  Normal  Pulled                  2m23s  kubelet                  Successfully pulled image "nginx" in 479.047887ms
  Normal  Created                 2m23s  kubelet                  Created container container-name
  Normal  Started                 2m23s  kubelet                  Started container container-name
root@podtwo-59f696d697-xb88s:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          98G   12G   82G  12% /
tmpfs            64M     0   64M   0% /dev
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/vde         99G   15G   84G  15% /myvolumepath
/dev/vda2        98G   12G   82G  12% /etc/hosts
shm              64M     0   64M   0% /dev/shm
tmpfs            13G   16K   13G   1% /run/secrets/kubernetes.io/serviceaccount
tmpfs           7.8G     0  7.8G   0% /proc/acpi
tmpfs           7.8G     0  7.8G   0% /proc/scsi
tmpfs           7.8G     0  7.8G   0% /sys/firmware

@RomanBednar
Copy link
Contributor Author

With our existing driver, I was not able to recreate the issue

Could you please help to explain why this change is required.

You probably did recreate the issue but looking at the output you did not check the filesystem size of the PVC restored from snapshot - that's where the problem is. Use df to check filesystem size, you can't see that with lsblk. For more details check the Bugzilla that's linked in the issue #85 (if needed).

@ambiknai
Copy link
Contributor

ambiknai commented Nov 4, 2022

Thanks @RomanBednar . I am going to pull this code, build an image and do e2e in our CSI driver.

@ambiknai
Copy link
Contributor

ambiknai commented Nov 8, 2022

I have verified e2e functionality and works as expected. @arahamad could you pls take a look in to the PR once.

Copy link
Contributor

@arahamad arahamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just see if you can implement these changes in https://github.com/IBM/ibm-csi-common which will require very less changes in this repo

pkg/ibmcsidriver/node.go Outdated Show resolved Hide resolved
pkg/ibmcsidriver/node.go Outdated Show resolved Hide resolved
@RomanBednar
Copy link
Contributor Author

RomanBednar commented Nov 29, 2022

Tested on real cluster to verify resizing works in current version of the patch. I've build a driver with changes here in vendor dir and then moved them to separate PR.

$ oc get pvc/pvc-1-snapshot-restore && oc exec pod/example-2 -- df -h | grep nginx
NAME                     STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                 AGE
pvc-1-snapshot-restore   Bound    pvc-7326acb8-ff75-44aa-82e2-ba159b2bd9a8   20Gi       RWO            ibmc-vpc-block-10iops-tier   4m7s
/dev/vde         20G   28M   20G   1% /usr/share/nginx/html

Tests here will fail until the changes are merged in library and version here gets bumped. @arahamad and @ambiknai PTAL and review again.

@ambiknai
Copy link
Contributor

ambiknai commented Jan 4, 2023

@RomanBednar New release created - https://github.com/IBM/ibm-csi-common/releases/tag/v1.1.2

Could you please do necessary changes in this PR to use Resize logic from ibm-csi-common repo. Resize method from this codebase can be removed.

VolumeMountUtils is already instantiated in init() of ibmcsidriver
module so there is no need for this line of code.
In order to allow testing of code that includes command sequence we
need to change the driver so it can accept a list of fake commands.
This is the actual fix for resizing filesystem when volume is restored
from a snapshot to larger size
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 5, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 6, 2023
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 6, 2023

@RomanBednar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-ibm-vpc-block-csi-driver-sanity 528af82 link true /test pull-ibm-vpc-block-csi-driver-sanity

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ambiknai
Copy link
Contributor

ambiknai commented Jan 6, 2023

@RomanBednar Could you change ibm-csi-common version to new release - https://github.com/IBM/ibm-csi-common/releases/tag/v1.1.3

@RomanBednar
Copy link
Contributor Author

@RomanBednar Could you change ibm-csi-common version to new release - https://github.com/IBM/ibm-csi-common/releases/tag/v1.1.3

@ambiknai Done.

Copy link
Contributor

@arahamad arahamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

please verify changes as well

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 9, 2023
Copy link
Contributor

@ambiknai ambiknai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ambiknai, arahamad, RomanBednar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RomanBednar
Copy link
Contributor Author

/hold cancel

IBM/ibm-csi-common#69 is now merged.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2023
@k8s-ci-robot k8s-ci-robot merged commit 50dc6d1 into kubernetes-sigs:master Jan 9, 2023
@ambiknai ambiknai mentioned this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resize filesystem of a larger volume created from a snapshot/volume
5 participants