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

Volume partitions are not supported #812

Closed
jsafrane opened this issue Mar 23, 2021 · 2 comments · Fixed by #824
Closed

Volume partitions are not supported #812

jsafrane opened this issue Mar 23, 2021 · 2 comments · Fixed by #824
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jsafrane
Copy link
Contributor

/kind bug

What happened?
For CSI migration we need all in-tree features supported in the CSI driver. In-tree volumes support mounting volume partitions in pv.spec.awsElasticBlockStore.partition flag. Such capability should be present in the CSI driver too.

How to reproduce it (as minimally and precisely as possible)?
Enable CSI migration and use following Pod:

apiVersion: v1
kind: Pod
metadata:
  name: inline
spec:
  containers:
  - name: inline
    image: centos:7
    args:
    - sleep
    - '99999'
    volumeMounts:
    - mountPath: "/mnt/storage"
      name: inline
  volumes:
  - name: inline
    awsElasticBlockStore:
      fsType: xfs
      volumeID: vol-072b2b73e088c43b5
      partition: 1

Anything else we need to know?:
The CSI translation library makes the partition number available in volume_attribute: partition: https://github.com/kubernetes/kubernetes/blob/bbb58fa085ccfc4635aa8544686d960115449d95/staging/src/k8s.io/csi-translation-lib/plugins/aws_ebs.go#L112

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 23, 2021
@AndyXiangLi
Copy link
Contributor

Hi @jsafrane can you point me to the in-tree driver code that consume this partition field?

@jsafrane
Copy link
Contributor Author

jsafrane commented Apr 6, 2021

Most of the code is in getDiskByIDPaths, it's really about getting the right device name. Beware, NVMe and "regular" disks must be handled differently (/dev/nvme0n1 -> /dev/nvme0n1p1, /dev/xvda -> /dev/xvda1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants