Move a volume
Beginning with Trident 26.06, a storage administrator can non-disruptively move an iSCSI volume to a different ONTAP node and aggregate within the same ONTAP cluster while the workload that uses it keeps running. You request the move declaratively with a TridentVolumeMove custom resource or the tridentctl equivalent, and Trident coordinates ONTAP and the host so that I/O is never interrupted.
Requirements
Volume move applies to the ontap-san driver for iSCSI volumes only. NVMe and NAS protocols are not supported.
Before you move a volume, ensure that the following requirements are met:
-
The backend uses the
ontap-sandriver with the ONTAP REST API. -
The ONTAP cluster has at least two nodes.
-
You have one of the following sets of credentials:
-
ONTAP 9.19.1 or later if using the dedicated custom ONTAP role.
-
Cluster-admin credentials on earlier ONTAP releases.
-
How it works
Trident moves the volume (LUN) between two locations inside the same ONTAP cluster. Before the data moves, Trident adds new iSCSI paths to the target alongside the existing paths, so that the host multipath device never loses access. After ONTAP completes the move, Trident prunes the stale source paths.
Trident drives the move through an ordered set of states that are visible in the TridentVolumeMove resource, so that you can follow the move progress.
Move a volume
Identify the volume and locations
-
Find the name of the PV to move. The PV name is also the name of the move resource.
-
From the ONTAP cluster, note the current (source) node and aggregate for that volume, and choose the destination (target) node and aggregate.
Start the move
Use either method. Both create the same TridentVolumeMove resource, whose name is the PV name.
tridentctl create volume-move \
--volume pvc-8a814d62-bd58-4253-b0d1-82f2885db671 \
--source-node ontap-node-01 \
--source-pool aggr1_node01 \
--target-node ontap-node-02 \
--target-pool aggr1_node02 \
-n trident
tvm is an alias for volume-move. Add --delete-after-success 10m to remove the resource automatically after the move succeeds.
apiVersion: trident.netapp.io/v1
kind: TridentVolumeMove
metadata:
name: pvc-8a814d62-bd58-4253-b0d1-82f2885db671 # the PV to move
namespace: trident
spec:
sourceNode: ontap-node-01
sourcePool: aggr1_node01
targetNode: ontap-node-02
targetPool: aggr1_node02
# deleteAfterSuccess: 10m # optional
Apply the resource:
kubectl apply -f tridentvolumemove.yaml
sourceNode/targetNode-
ONTAP node names (not UUIDs).
sourcePool/targetPool-
ONTAP aggregate names.
deleteAfterSuccess-
Optional duration, such as
30sor10m. Set to0to delete the resource immediately, or omit it to retain the resource.
Monitor the move
Track progress using the tvm short name or tridentvolumemove:
kubectl get tridentvolumemove -n trident
To see the current state and per-node progress, describe the resource:
kubectl describe tridentvolumemove <pv-name> -n trident
The volume can have concurrent attachments during the Moving state, because ONTAP can take a while to complete the move for a large volume. To ensure a seamless move, Trident coordinates between the Trident controller and the Trident node. Each state performs the following steps in order, ending in either Succeeded or Failed.
| State | What is happening |
|---|---|
|
Trident accepts and validates the move request and gathers the information it needs before any storage changes begin. |
|
Trident prepares the target location. It maps the target node's storage interfaces to the LUN and updates Kubernetes so that a future node restart reconnects to the correct location. |
|
On each host that has the volume mounted, Trident adds the new storage paths from the target node alongside the existing paths, so that the pod's I/O continues across both path sets. |
|
ONTAP copies and cuts over the volume data to the target aggregate. This is the longest phase, and ONTAP handles it entirely while Trident polls until it finishes. New publishes are allowed during this state. |
|
The data move is complete. Trident updates Kubernetes to drop the source paths from the desired state, and then unmaps the source node's storage interfaces from the LUN. |
|
On each host, Trident removes the stale source paths. The host is left with only the target paths, and the multipath device continues serving I/O without interruption. |
|
The volume is fully moved and online at the target. Trident retains the |
|
A non-recoverable error stopped the move or prevented it from starting. Trident resets the volume state so that normal operations can resume, and keeps the resource with an error message. Review the message, fix the root cause, delete the resource, and try again. |
The .status.attachments list reports each attached node's progress in its state field:
| Attachment state | Meaning |
|---|---|
|
Node identified as attached; work has not yet started. |
|
New target paths added alongside the existing paths. |
|
Traffic is now served over the new paths. |
|
Stale source paths removed from the node. |
|
Node detached mid-move and excluded from further consideration while Trident assesses whether the attachment is ready to proceed to the next step. |
|
Terminal error on this node. See the message. |
Clean up the move resource
If you set deleteAfterSuccess, Trident removes the resource automatically. Otherwise, you can delete it manually. Before you request another move on the same volume, ensure that no TridentVolumeMove resource exists for that volume in either a Succeeded or Failed state.
|
|
Trident never deletes failed moves automatically. Trident keeps a |