Skip to content

Taking a snapshot of byte-precision sized PVC fails #1039

@qJkee

Description

@qJkee

Describe the bug
When trying to create a snapshot with exact bytes specified, it fails with error
rpc error: code = OutOfRange desc = requested size 1136238592 is smaller than source logical volume: 1136656384 during this check. Probably this is happens because of LVM which rounds up the storage, because i see the following message in the logs
Rounding up size to full physical extent <1.06 GiB

To Reproduce
Steps to reproduce the behavior:

  1. Create PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: simple-pvc
spec:
  volumeMode: Filesystem
  storageClassName: topolvm-provisioner
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1136234735
  1. Create pod
apiVersion: v1
kind: Pod
...
  volumes:
  - name: mypvc
    persistentVolumeClaim:
      claimName: simple-pvc
  1. Create Snapshot
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: simple-snap
spec:
  volumeSnapshotClassName: topolvm-provisioner
  source:
    persistentVolumeClaimName: simple-pvc

Expected behavior
Snapshot succeed

Additional context
When creating PVC with size 1136234735, LV gets created with size 1136656384, probably because of LVM rounding

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions