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

A PV clone could not be created from VolumeSnapshot using the ontap-san-economy driver #461

Closed
yasuoohno opened this issue Oct 8, 2020 · 2 comments

Comments

@yasuoohno
Copy link

Describe the bug

With the storagePrefix set, the volume clone could not be created from the snapshot using the onta-san-economy driver.

Environment

Provide accurate information about the environment to help us reproduce the issue.

  • Trident version: 20.07.1
  • Trident installation flags used: -n trident
  • Container runtime: Docker-CE 19.03.13
  • Kubernetes version: 1.18.9
  • Kubernetes orchestrator: kubeadm
  • Kubernetes enabled feature gates:
  • OS: Debian 10
  • NetApp backend types: ONTAP 9.7 with iSCSI / ontap-san-economy

To Reproduce

  1. Create ontap-san-economy backend with "storagePrefix": "OSE"
  2. Create PersistentVolume as a source.
  3. Create VolumeSnapshot from source PV.
  4. Create PersistentVolume from VolumeSnapshot DataSource (and fail)

Expected behavior

It can create PersistentVolume from VolumeSnapshot source.

Additional context

In the pvc's log, the volume snapshot LUN name is
OSE_pvc_63302077_d822_43e4_b38a_bef5fffb0a4e_snapshot_snapshot_d7395801_d47d_4852_ae12_14a096498498.

But ontap side, the snapshot LUN path is different,
OSEpvc_63302077_d822_43e4_b38a_bef5fffb0a4e_snapshot_snapshot_d7395801_d47d_4852_ae12_14a096498498
....^ There is no "_" following the storagePrefix.

$ kubectl get pvc
NAME              STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
iscsi-vol1        Bound     pvc-63302077-d822-43e4-b38a-bef5fffb0a4e   100Mi      RWO            saneco         7h11m
iscsi-vol1-snap   Pending                                                                        saneco         6h43m

$ kubectl describe pvc iscsi-vol1-snap
Name:          iscsi-vol1-snap
Namespace:     default
StorageClass:  saneco
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: csi.trident.netapp.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
DataSource:
  APIGroup:  snapshot.storage.k8s.io
  Kind:      VolumeSnapshot
  Name:      iscsi-vol1-snapshot
Mounted By:  <none>
Events:
  Type    Reason                Age                       From                                                                                     Message
  ----    ------                ----                      ----                                                                                     -------
  Normal  ExternalProvisioning  4m40s (x1603 over 6h44m)  persistentvolume-controller                                                              waiting for a volume to be created, either by external provisioner "csi.trident.netapp.io" or manually created by system administrator
  Normal  Provisioning          65s (x89 over 6h44m)      csi.trident.netapp.io_trident-csi-68d979fb85-98b97_7cb07f53-54a3-4fb0-9010-7422d7469af7  External provisioner is provisioning volume for claim "default/iscsi-vol1-snap"
  Normal  ProvisioningFailed    65s (x89 over 6h44m)      csi.trident.netapp.io                                                                    failed to create cloned volume pvc-bacd1978-e830-41fa-86bc-58b7bbeb7287 on backend ontapsaneco_172.16.80.212: error LUN OSE_pvc_63302077_d822_43e4_b38a_bef5fffb0a4e_snapshot_snapshot_d7395801_d47d_4852_ae12_14a096498498 does not exist

$ tridentctl get snapshot -n trident -o yaml
items:
- Config:
    internalName: snapshot-d7395801-d47d-4852-ae12-14a096498498
    name: snapshot-d7395801-d47d-4852-ae12-14a096498498
    version: "1"
    volumeInternalName: OSE_pvc_63302077_d822_43e4_b38a_bef5fffb0a4e
    volumeName: pvc-63302077-d822-43e4-b38a-bef5fffb0a4e
  State: ""
  dateCreated: "2020-10-08T06:10:36Z"
  size: 104857600

$ ssh admin@ontapsim "lun show -vserver svm01"
Vserver   Path                            State   Mapped   Type        Size
--------- ------------------------------- ------- -------- -------- --------
svm01     /vol/trident_lun_pool_OSE_GXNFACQWJP/OSE_pvc_63302077_d822_43e4_b38a_bef5fffb0a4e online mapped linux 100MB
svm01     /vol/trident_lun_pool_OSE_GXNFACQWJP/OSEpvc_63302077_d822_43e4_b38a_bef5fffb0a4e_snapshot_snapshot_d7395801_d47d_4852_ae12_14a096498498 online unmapped linux 100MB
@yasuoohno yasuoohno added the bug label Oct 8, 2020
@yasuoohno yasuoohno changed the title A PV clone could not be created from VolumeSnapshot using the onta-san-economy driver A PV clone could not be created from VolumeSnapshot using the ontap-san-economy driver Oct 8, 2020
@gnarl gnarl added the tracked label Jan 28, 2021
@balaramesh
Copy link
Contributor

It looks like this problem would be encountered when the storagePrefix doesn't have a trailing underscore. This will need to be fixed here:

name := fmt.Sprintf("%v%v%v", *o.Config.StoragePrefix, volName, snapName)

This can be fixed with something like:

	name := fmt.Sprintf("%v_%v%v", strings.TrimSuffix(*o.Config.StoragePrefix, "_"), volName, snapName)

@gnarl
Copy link
Contributor

gnarl commented Apr 23, 2021

This is fixed with commit f423971 and will be included in the Trident 21.04 release.

@gnarl gnarl closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants