NetApp ONTAP: Create SVM and Data LIFs from CLI - 夜莺博客

NetApp ONTAP: Create SVM and Data LIFs from CLI

Storage virtualization on NetApp ONTAP 9 revolves around two objects: the storage virtual machine (SVM, historically called a Vserver), which owns the data protocols and namespace, and the network logical interfaces (LIFs) that carry client traffic to it. Every SVM needs at least one data LIF per node on the ports that will serve NFS, SMB, iSCSI or FC. Getting the creation order right - SVM first, then LIFs with the correct service policy and home port - avoids most configuration pain. This guide walks through both commands with the exact ONTAP CLI syntax and the verification checks that confirm the SVM is ready to serve data.

Step 1: Create the SVM (Vserver)

Create an SVM with its root volume on a specific aggregate, or accept defaults and let ONTAP place the root volume automatically:

cluster1::> vserver create -vserver vs1.example.com -ipspace ipspace123     -rootvolume root_vs1 -aggregate aggr0 -language en_US.UTF-8     -rootvolume-security-style mixed
cluster1::> vserver create -vserver vs1

Verify the SVM and its placement:

cluster1::> vserver show -vserver vs1 -fields rootvolume,rootvolume-security-style,aggregate

Step 2: Create Data LIFs

A LIF is an IP address bound to a physical or logical port. With ONTAP 9.6 and later, assign a service policy so the LIF automatically gets the correct role, failover policy and data protocols - default-data-files for NAS clients:

cluster1::> network interface create -vserver vs1.example.com -lif datalif1     -service-policy default-data-files -home-node node-4 -home-port e1c     -address 192.0.2.145 -netmask 255.255.255.0 -auto-revert true

For ONTAP 9.5 and earlier, specify the role, data protocol and firewall policy explicitly:

cluster1::> network interface create -vserver vs1 -lif nfs_lif1 -role data     -data-protocol nfs -home-node node1 -home-port e0c     -address 192.0.2.146 -netmask 255.255.255.0 -firewall-policy data -auto-revert true

Instead of typing an address, you can pull one from an existing subnet with -subnet-name; the LIF then follows the subnet's netmask and IPspace. iSCSI and NVMe/FC LIFs are created the same way with -data-protocol iscsi or nvme-fc.

Step 3: Verify LIFs and Failover Behavior

cluster1::> network interface show -vserver vs1.example.com
cluster1::> network interface show -failover -vserver vs1.example.com

The failover view confirms each LIF's home node and port and where it will move if the home port fails - -auto-revert true makes the LIF return to its home node automatically when the node comes back.

Common Pitfalls

  • Creating the LIF before the SVM exists - create the SVM first.
  • Forgetting the service policy on 9.6+; the LIF then has no data protocols and NFS exports or iSCSI targets are unreachable.
  • Placing both LIFs of an SVM on the same node - spread LIFs across nodes for redundancy.

Continue with our ONTAP NFS export policy configuration, ONTAP network troubleshooting commands, and ONTAP port troubleshooting guide.

原文链接:https://docs.netapp.com/us-en/ontap/networking/create_a_lif.html