Skip to content

tridentctl import cannot mount LUKS encrypted volumes in backend without LUKS as a default #849

@alifelan

Description

@alifelan

Describe the bug
When having a backend with two virtual pools, one for LUKS and one for non LUKS, and a default without LUKS, we can create LUKS encrypted volumes. Then, we can create a snapshot of the volume. But when we try to import the volume with tridentctl import, the import itself succeeds, but the volume cannot be mounted to a pod due to the following error:

kubelet  MountVolume.MountDevice failed for volume "pvc-72b02d9a-3198-47c2-8318-5a85a858036c" : rpc error: code = Internal desc = failed to stage volume: LUN trident_pvc_72b02d9a_3198_47c2_8318_5a85a858036c, device dm-11 already formatted with other filesystem: crypto_LUKS

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

  • Trident version: 23.04.0 with extra patches
  • Container runtime: containerd://1.6.18
  • Kubernetes version: v1.26.2
  • OS: Ubuntu 20.04.6 LTS
  • NetApp backend types: ontapp-san

To Reproduce

  • Have a backend with the following pools:
...
    defaults:
      encryption: "false"
    storage:
    - defaults:
        luksEncryption: "false"
      labels:
        luks: "false"
    - defaults:
        luksEncryption: "true"
      labels:
        luks: "true"
...
  • Create a PVC with a LUKS storage class
  • Snapshot the PVC
  • Delete it
  • Import it back with tridentctl import
  • Mount it to a pod

Expected behavior
The pod should be able to mount and read/write to the volume

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions