Description of problem: When we use a gp2 storage class, we request 1G and we use all available space, MTC does not show a warning saying that there is no free space and that the migration could fail (or resize the volume if the functionality is enabled). Version-Release number of selected component (if applicable): MTC 1.4.4 How reproducible: Always Steps to Reproduce: 1. Create an application using a PVC $ oc new-project ocp-41887-pvresize $ cat <<EOF | oc create -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: namespace: ocp-41887-pvresize name: test-data spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi EOF $ cat <<EOF | oc create -f - apiVersion: apps/v1 kind: Deployment metadata: labels: app: pvresize-test name: pvresize-test namespace: ocp-41887-pvresize spec: replicas: 1 selector: matchLabels: app: pvresize-test template: metadata: labels: app: pvresize-test spec: containers: - name: podtest imagePullPolicy: Always image: quay.io/openshifttest/alpine command: [ "/bin/sh", "-c", "--" ] args: - dd if=/dev/zero of=/data/test/file_1 bs=10M count=98; echo "Files created"; while true; do sleep 30; done; restartPolicy: Never volumeMounts: - name: testvolume mountPath: /data/test volumes: - name: testvolume persistentVolumeClaim: claimName: test-data EOF $ oc -n ocp-41887-pvresize exec $(oc get pod -l app -ojsonpath='{.items[0].metadata.name}' -n ocp-41887-pvresize) -- df -h /data/test Filesystem Size Used Available Use% Mounted on /dev/xvdbp 975.9M 959.9M 0 100% /data/test 2. Create a migration plan using DVM Actual results: No warning is displayed in the migplan. Expected results: Since there is no free space left in the PV, MTC should display a warning in the migration plan to tell the user that the migration could fail (or the PV be resized if this functionality is enabled). Additional info: It seems to be a corner case, using other storage classes or other PV sizes the functionality works without problems. For instance, if we create a 10Gi gp2 PV instead of a 1Gi gp2 PV and we use 99% of the space, the warning is displayed. pgaikwad has been helping us to understand the problem, and it seems to be related to the precision of the rounded values when calculating if the warning should be displayed or not.
This feels like something that *should* be caught by the pv resize feature. Would be good to understand the underlying issue here, even if it's expected. I'm particularly interested in this because it's pretty frequent that we hear from customers with full vols.
We'd like to document this as a known issue rather than fixing with a source fix (which is arguably not possible). Pranav will follow up with specific details for what we would like to see documented.
Changes merged.