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

Created on 8 Oct 2020  路  2Comments  路  Source: NetApp/trident

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
bug tracked

All 2 comments

It looks like this problem would be encountered when the storagePrefix doesn't have a trailing underscore. This will need to be fixed here: https://github.com/NetApp/trident/blob/96775f0939503a1a47d639ae52b4e22fa5d50181/storage_drivers/ontap/ontap_san_economy.go#L66

This can be fixed with something like:

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

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

Was this page helpful?
0 / 5 - 0 ratings