NetApp
ONTAP LUN Migration Runbook With CLI and REST API
Scope
This runbook covers moving a LUN from one ONTAP volume to another within an SVM. It is not a host-based data migration and it is not a license to ignore host multipath. NetApp documents lun move start as the command that moves a LUN from one volume to another: lun move start.
Prechecks
lun show -vserver svm_prod01
lun mapping show -vserver svm_prod01
lun igroup show -vserver svm_prod01
volume show -vserver svm_prod01
volume show-space -vserver svm_prod01 -volume src_lun_vol
volume show-space -vserver svm_prod01 -volume dst_lun_vol
iscsi session show -vserver svm_prod01
Host checks:
multipath -ll
iscsiadm -m session
lsblk
Confirm that the destination volume has space, the host has redundant paths, and the application owner understands whether the move is online for the workload and ONTAP release involved.
CLI Process
Start the LUN move:
lun move start \
-vserver svm_prod01 \
-source-path /vol/src_lun_vol/app01.lun \
-destination-path /vol/dst_lun_vol/app01.lun
Monitor:
lun move show -vserver svm_prod01
lun show -vserver svm_prod01 -path /vol/dst_lun_vol/app01.lun
Validate mapping:
lun mapping show -vserver svm_prod01
iscsi session show -vserver svm_prod01
REST API Process
Discover the LUN and volumes:
curl -k -u admin:'<password>' \
"https://cluster.example.com/api/storage/luns?svm.name=svm_prod01&name=app01.lun&fields=uuid,name,location,space,maps"
curl -k -u admin:'<password>' \
"https://cluster.example.com/api/storage/volumes?svm.name=svm_prod01&fields=uuid,name,space"
If your ONTAP release exposes native LUN move endpoints, use that endpoint after validating it in a lab. If not, use the CLI for the move and REST for pre/post evidence. A conservative automation should not fake LUN movement by creating a new LUN unless that is a separate host migration design.
REST validation after the move:
curl -k -u admin:'<password>' \
"https://cluster.example.com/api/storage/luns?svm.name=svm_prod01&fields=name,location,space,maps,status"
Best Practices
- Avoid changing igroups and LUN movement in the same change unless required.
- Keep the source and destination paths in the ticket exactly as used.
- Validate host multipath before and after.
- Do not remove the source volume until backup and host validation are complete.
- Watch volume space on both source and destination during the operation.
Backout
If the move has not completed, stop according to the LUN move state and ONTAP guidance. If it completed, moving the LUN back is a new controlled operation:
lun move start \
-vserver svm_prod01 \
-source-path /vol/dst_lun_vol/app01.lun \
-destination-path /vol/src_lun_vol/app01.lun
Validate host paths again before closing the change.