Skip to content

PVC clone: the size of underlying volume does not match the PVC #48

@cumirror

Description

@cumirror

source pvc's size is 4Gi:

# kubectl get pvc -o wide -n test
NAME                      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE     VOLUMEMODE
ubuntu-tmpl               Bound    pvc-4c1174d0-acf4-49a6-b264-bbdd3ddf6209   4Gi        RWX            csi-neonsan    6d22h   Block

clone pvc's size is 6Gi:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
    name: clone-of-ubuntu-tmpl
    namespace: test
spec:
  accessModes:
  - ReadWriteMany
  volumeMode: Block
  resources:
    requests:
      storage: 6Gi
  dataSource:
    kind: PersistentVolumeClaim
    name: ubuntu-tmpl

after clone, pvc info:

# kubectl get pvc -o wide -n test
NAME                      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE     VOLUMEMODE
clone-of-ubuntu-tmpl      Bound    pvc-27f06c3f-ea0b-47a8-b637-7adba49845ca   6Gi        RWX            csi-neonsan    19m     Block
ubuntu-tmpl               Bound    pvc-4c1174d0-acf4-49a6-b264-bbdd3ddf6209   4Gi        RWX            csi-neonsan    6d22h   Block

after clone, clone volume size is 4Gi not 6Gi:

# neonsan list_volume -pool kube -detail
+------------+------------------------------------------+-------------+------+---------+-----------+---------------+-------+---------+--------+------------------+-----------+---------------------+---------------------+
|     ID     |                   NAME                   |    SIZE     | POOL | RG NAME | REP COUNT | MIN REP COUNT | ROLE  | POLICY  | STATUS | VOLUME ALLOCATED | ENCRYPTED |     STATUS TIME     |    CREATED TIME     |
+------------+------------------------------------------+-------------+------+---------+-----------+---------------+-------+---------+--------+------------------+-----------+---------------------+---------------------+
| 1543503872 | pvc-27f06c3f-ea0b-47a8-b637-7adba49845ca |  4294967296 | kube | SSD0    |         1 |             1 | alone | default | OK     |       2617245696 | no        | 2020-11-26 15:22:08 | 2020-11-26 15:22:08 |
|  402653184 | pvc-4c1174d0-acf4-49a6-b264-bbdd3ddf6209 |  4294967296 | kube | SSD0    |         1 |             1 | alone | default | OK     |       2617245696 | no        | 2020-11-26 15:22:08 | 2020-11-19 17:04:25 |
+------------+------------------------------------------+-------------+------+---------+-----------+---------------+-------+---------+--------+------------------+-----------+---------------------+---------------------+

After cloning is complete, the size of underlying storage volume should be consistent with the requested PVC.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions