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

Add support for clonning pv for backend with no snapshot support #210

Open
paraddise opened this issue Aug 30, 2023 · 0 comments
Open

Add support for clonning pv for backend with no snapshot support #210

paraddise opened this issue Aug 30, 2023 · 0 comments

Comments

@paraddise
Copy link

I'm creating storage poll with LinstorSatelliteConfiguration in piraeus operator

---
apiVersion: piraeus.io/v1
kind: LinstorSatelliteConfiguration
metadata:
  name: worker-b-1
spec:
  nodeSelector:
    linbit.com/hostname: worker-b-1
  storagePools:
    - name: preallocated-lvm-pool
      lvmPool:
        volumeGroup: preallocated-lvm-pool
      source:
        hostDevices:
          - /dev/nvme0n4
---
apiVersion: piraeus.io/v1
kind: LinstorSatelliteConfiguration
metadata:
  name: worker-a-2
spec:
  nodeSelector:
    linbit.com/hostname: worker-a-2
  storagePools:
    - name: preallocated-lvm-pool
      lvmPool:
        volumeGroup: preallocated-lvm-pool
      source:
        hostDevices:
          - /dev/nvme0n2

After that creating StorageClass that uses this StoragePool

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: preallocated-lvm-pool-r1
parameters:
  csi.storage.k8s.io/fstype: ext4
  storagePool: preallocated-lvm-pool
  allowRemoteVolumeAccess: "true"
  disklessOnRemaining: "true"
  DrbdOptions/auto-add-quorum-tiebreaker: "true"
provisioner: linstor.csi.linbit.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

Creating pvc from this StorageClass

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: volume-logger
  namespace: volume-logger
spec:
  storageClassName: preallocated-lvm-pool-r1
  resources:
    requests:
      storage: 1Gi
  accessModes:
    - ReadWriteOnce

Getting the following output from kubectl describe

Name:          volume-logger
Namespace:     volume-logger
StorageClass:  preallocated-lvm-pool-r1
Status:        Bound
Volume:        pvc-e89128f3-428a-4f8f-b418-96b0467e7bc0
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: linstor.csi.linbit.com
               volume.kubernetes.io/selected-node: worker-c-1
               volume.kubernetes.io/storage-provisioner: linstor.csi.linbit.com
Finalizers:    [kubernetes.io/pvc-protection provisioner.storage.kubernetes.io/cloning-protection]
Capacity:      1Gi
Access Modes:  RWO
VolumeMode:    Filesystem
Used By:       <none>
Events:
  Type    Reason                 Age                From                                                                                                 Message
  ----    ------                 ----               ----                                                                                                 -------
  Normal  WaitForFirstConsumer   38m (x6 over 39m)  persistentvolume-controller                                                                          waiting for first consumer to be created before binding
  Normal  ExternalProvisioning   38m                persistentvolume-controller                                                                          waiting for a volume to be created, either by external provisioner "linstor.csi.linbit.com" or manually created by system administrator
  Normal  Provisioning           38m                linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  External provisioner is provisioning volume for claim "volume-logger/volume-logger"
  Normal  ProvisioningSucceeded  38m                linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  Successfully provisioned volume pvc-e89128f3-428a-4f8f-b418-96b0467e7bc0

Next, trying to create PersistentVolumeClaim from another

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: volume-logger-cloned
  namespace: volume-logger
spec:
  storageClassName: preallocated-lvm-pool-r1
  resources:
    requests:
      storage: 1Gi
  dataSource:
    kind: PersistentVolumeClaim
    name: volume-logger
  accessModes:
    - ReadWriteOnce

And getting the following output from describe

Name:          volume-logger-cloned
Namespace:     volume-logger
StorageClass:  preallocated-lvm-pool-r1
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: linstor.csi.linbit.com
               volume.kubernetes.io/selected-node: worker-c-1
               volume.kubernetes.io/storage-provisioner: linstor.csi.linbit.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
DataSource:
  Kind:   PersistentVolumeClaim
  Name:   volume-logger
Used By:  volume-logger-775b868c7-l6xpf
Events:
  Type     Reason                Age               From                                                                                                 Message
  ----     ------                ----              ----                                                                                                 -------
  Normal   WaitForPodScheduled   5s (x2 over 11s)  persistentvolume-controller                                                                          waiting for pod volume-logger-775b868c7-l6xpf to be scheduled
  Normal   ExternalProvisioning  4s                persistentvolume-controller                                                                          waiting for a volume to be created, either by external provisioner "linstor.csi.linbit.com" or manually created by system administrator
  Warning  ProvisioningFailed    4s                linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  failed to provision volume with StorageClass "preallocated-lvm-pool-r1": rpc error: code = Internal desc = CreateVolume failed for pvc-3c9aa5d7-d47a
-44d1-bdd7-fb42e9986916: failed to create snapshot for source volume: rpc error: code = Internal desc = failed to create snapshot: failed to create snapshot: Message: 'Storage driver 'LVM' does not support snapshots.'; Details: 'Used for storage pool 'preallocated-lvm-pool' on 'worker-a-2'.
Resource: pvc-e89128f3-428a-4f8f-b418-96b0467e7bc0, Snapshot: for-pvc-3c9aa5d7-d47a-44d1-bdd7-fb42e9986916'; Reports: '[64EEE67E-00000-000147]'
  Warning  ProvisioningFailed  3s  linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  failed to provision volume with StorageClass "preallocated-lvm-pool-r1": rpc error: code = Internal desc = CreateVolume failed for pvc-3c9aa5d7-d47a-44d1-bdd7-fb42e
9986916: failed to create snapshot for source volume: rpc error: code = Internal desc = failed to create snapshot: failed to create snapshot: Message: 'Storage driver 'LVM' does not support snapshots.'; Details: 'Used for storage pool 'preallocated-lvm-pool' on 'worker-a-2'.
Resource: pvc-e89128f3-428a-4f8f-b418-96b0467e7bc0, Snapshot: for-pvc-3c9aa5d7-d47a-44d1-bdd7-fb42e9986916'; Reports: '[64EEE67E-00000-000148]'
  Normal   Provisioning        1s (x3 over 4s)  linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  External provisioner is provisioning volume for claim "volume-logger/volume-logger-cloned"
  Warning  ProvisioningFailed  1s               linstor.csi.linbit.com_linstor-csi-controller-55f8d4646d-462qt_d3d16baa-4de4-4c16-9c8f-91d610f90a6b  failed to provision volume with StorageClass "preallocated-lvm-pool-r1": rpc error: code = Internal desc = CreateVolume failed for pvc-3c9aa5d7-d47a-44
d1-bdd7-fb42e9986916: failed to create snapshot for source volume: rpc error: code = Internal desc = failed to create snapshot: failed to create snapshot: Message: 'Storage driver 'LVM' does not support snapshots.'; Details: 'Used for storage pool 'preallocated-lvm-pool' on 'worker-a-2'.
Resource: pvc-e89128f3-428a-4f8f-b418-96b0467e7bc0, Snapshot: for-pvc-3c9aa5d7-d47a-44d1-bdd7-fb42e9986916'; Reports: '[64EEE67E-00000-000149]'

As far as I know the creation of volume from another volume implemented with use of snapshot, LVM (not thin doesn't support snapshots) in linstor. But linstor has linstor rd clone <source> <target>.

Is it possible to use clone instead of snapshots?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant