NetApp ONTAP Cheat Sheet: Day-to-Day Commands - 夜莺博客

NetApp ONTAP Cheat Sheet: Day-to-Day Commands

NetApp ONTAP 日常运维总在集群、SVM、LIF、卷与共享之间来回切换。本文整理一份高频 ONTAP 命令速查表:优雅关机/重启节点、查看 SVM 归属节点、创建与管理卷、CIFS 共享(含隐藏共享)、NFS 导出访问模拟与健康检查,全部命令带参数说明,可直接用于生产与实验环境。

集群与节点管理

优雅关停整个集群

cluster01::> system node halt -node * -inhibit-takeover true -ignore-quorum-warnings true

出现 "Could not migrate LIFs away from node" 时,可加 -skip-lif-migration-before-shutdown 强制关机(会短暂断连)。SSH 关机时先确认谁持有 cluster-mgmt LIF,最后关该节点以免断线。

重启节点

cluster01::> system node reboot -node cluster01-02 -reason "Maintenance reboot"
cluster01::> system node reboot -node cluster01-02 -force -reason "Emergency reboot"

查看节点与集群信息

cluster01::> system node show -instance
cluster01::> version
cluster01::> network interface show -role cluster-mgmt
cluster01::> network interface show -vserver svm_data   # SVM 当前运行节点

SVM 与卷

创建 SVM

cluster01::> vserver create -vserver svm_data -aggregate aggr_data01 -rootvolume root_vol_svm_data -rootvolume-security-style unix

创建/挂载/删除卷

cluster01::> volume create -vserver svm_data -volume vol_data01 -aggregate aggr_data01 -size 500MB
cluster01::> volume mount -vserver svm_data -volume vol_data01 -junction-path /vol_data01
# 删除顺序:unmount → offline → delete
cluster01::> volume unmount -vserver svm_data -volume vol_data05
cluster01::> volume offline -vserver svm_data -volume vol_data05
cluster01::> volume delete -vserver svm_data -volume vol_data05

注意:删除的卷会进入 recovery queue(默认保留 12 小时),可用 volume recovery-queue show 查看,volume recovery-queue purge 立即清除,未 purge 前可一条命令恢复。

CIFS 与 NFS

# 创建隐藏 CIFS 共享($ 结尾)
cluster01::> vserver cifs share create -vserver svm_data -share-name admin-tools$ -path /cifs-data04
# 模拟 NFS 访问检查
cluster01::> check-access -vserver svm_data -volume vol_data01 -client-ip 10.0.0.89 -authentication-method none -protocol nfs3 -access-type read-write

健康检查

cluster01::> system health status show
cluster01::> system health alert show
cluster01::> system node run -node * sysconfig
cluster01::> storage aggregate show-status   # RAID 状态
cluster01::> storage aggregate show-space    # 容量

相关阅读

更多 ONTAP 真实场景问答见本站 NetApp ONTAP Commands: 50 Real-World Q&A for Admins;端口排障见 NetApp ONTAP: Troubleshoot Ethernet Ports with ifstat;端口可达性监控见 Monitor the Reachability of ONTAP Network Ports

原文链接:https://blog.matrixpost.net/cheat-sheet-netapp-ontap-commands-used-in-day-to-day-operations/