Skip to content

Implement Rename() for ontap-nas-economy (qtree) and ontap-san-economy drivers #1160

Description

@anshulj07

The Rename() method is not implemented for the ontap-nas-economy (qtree) and ontap-san-economy storage drivers. Both currently return a hard error (I am planning to raise a PR for this fix):

  • storage_drivers/ontap/ontap_nas_qtree.go:812errors.New("rename is not implemented")
  • storage_drivers/ontap/ontap_san_economy.go:1185errors.New("rename is not implemented")

This creates a feature parity gap with the non-economy variants (ontap-nas and ontap-san), which implement Rename correctly.

Impact

Volume rename is used internally during volume import operations and certain recovery workflows. Users of economy drivers are blocked from these flows entirely, receiving an opaque "rename is not implemented" error.

Root Cause

The ONTAP API abstraction layer already provides all the necessary primitives:

  • OntapAPIREST.QtreeRename(ctx, path, newPath) — implemented in api/abstraction_rest.go:1452
  • OntapAPIZAPI.QtreeRename(ctx, path, newPath) — implemented in api/abstraction_zapi.go:1999
  • OntapAPIREST.LunRename(ctx, lunPath, newLunPath) — implemented in api/abstraction_rest.go:2689
  • OntapAPIZAPI.LunRename(ctx, lunPath, newLunPath) — implemented in api/abstraction_zapi.go:801

Both REST and ZAPI paths have API-layer tests in abstraction_rest_test.go and abstraction_zapi_test.go. The driver-level Rename() methods simply never call them.

Proposed Fix

For NASQtreeStorageDriver.Rename():
The same lookup pattern used by Destroy() applies, use d.API.QtreeExists() to locate the parent FlexVol, construct the full qtree paths (/vol/<flexvol>/<name>), then call d.API.QtreeRename().

For SANEconomyStorageDriver.Rename(): Same pattern as Destroy(), use d.LUNExists() to find the bucket FlexVol, build paths via GetLUNPathEconomy(bucketVol, name), then call d.API.LunRename().

Reference implementation for both can be modeled after:

  • NASStorageDriver.Rename() in ontap_nas.go:888 (single-line VolumeRename call)
  • SANStorageDriver.Rename() in ontap_san.go:902 (with error wrapping)

Scope

  • Implement Rename() in ontap_nas_qtree.go
  • Implement Rename() in ontap_san_economy.go
  • Add unit tests for both (following patterns in existing *_test.go files for these drivers)

Please let me know if there are any constraints around qtree/LUN rename I should be aware of before proceeding.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions