Bug 1963927

Summary: No warning displayed when there is no free space in the PVC
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: DocumentationAssignee: Avital Pinnick <apinnick>
Status: CLOSED CURRENTRELEASE QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 1.4.4CC: ernelson, pgaikwad, whu, xjiang
Target Milestone: ---   
Target Release: 1.6.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-09-29 06:57:10 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 Sergio 2021-05-24 12:17:38 UTC
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.

Comment 1 Erik Nelson 2021-06-16 01:24:49 UTC
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.

Comment 2 Erik Nelson 2021-06-29 17:36:47 UTC
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.

Comment 4 Avital Pinnick 2021-09-29 06:57:10 UTC
Changes merged.