Bug 1942883

Summary: AWS EBS CSI driver does not support partitions
Product: OpenShift Container Platform Reporter: Jan Safranek <jsafrane>
Component: StorageAssignee: Jan Safranek <jsafrane>
Storage sub component: Kubernetes External Components QA Contact: Qin Ping <piqin>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs
Version: 4.7   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:55:38 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 Jan Safranek 2021-03-25 09:38:14 UTC
Description of problem:

With CSI migration enabled && in-tree PV (or inline volume) with a partition specified, the CSI driver tries to mount the whole disk.

Version-Release number of selected component (if applicable):
4.7

How reproducible:

Steps to Reproduce:
1. Enable CSI migration on AWS
2. Manually create a volume and a partition on it.
3. Run this pod:

{
    "apiVersion": "v1",
    "kind": "Pod",
    "metadata": {
        "name": "inline"
    },
    "spec": {
        "nodeSelector": {
                "topology.kubernetes.io/zone": "us-east-2a"
        },
        "containers": [
            {
                "name": "inline",
                "image":
"quay.io/openshifttest/storage@sha256:a05b96d373be86f46e76817487027a7f5b8b5f87c0ac18a246b018df11529b40",
                "securityContext": {
                    "privileged": true
                },
                "imagePullPolicy": "IfNotPresent",
                "volumeMounts": [
                    {
                        "mountPath": "/mnt/storage",
                        "name": "inline"
                    }
                ]
            }
        ],
        "volumes": [
            {
                "name": "inline",
                "awsElasticBlockStore": {
                    "fsType": "xfs",
                    "volumeID": "vol-0140cff45bc3ecdbc",
                    "partition": 1,
                    "readOnly": false
                }
            }
        ]
    }
}


Fix both with "traditional" (volumes are /dev/xvdXY) and Nitro systems (/dev/nvmeXYZ)!

Upstream issue: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/issues/812

Comment 2 Qin Ping 2021-04-15 09:19:32 UTC
Checked with: 4.8.0-0.nightly-2021-04-14-211524

With the following definition in PV:
  csi:
    driver: ebs.csi.aws.com
    volumeHandle: vol-0ceb1fe2304435f21
    fsType: xfs
    volumeAttributes:
      partition: "1"

Nitro system works well:
sh-4.4# df -T /mnt/storage/
Filesystem     Type 1K-blocks  Used Available Use% Mounted on
/dev/nvme1n1p1 xfs    2085888 47580   2038308   3% /mnt/storage

Traditional system workes well too:
sh-4.4# df /mnt/storage/
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/xvdba1      2085888 49892   2035996   3% /mnt/storage

Comment 5 errata-xmlrpc 2021-07-27 22:55:38 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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/RHSA-2021:2438