netapp svmdr nfs example

In this example you will setup SVMDR, with identity-preserve. Clusters cl1 and cl2 have already been peered.
You will exclude a volume from replication and perform a DR action with resync in both directions.

1. Create the two SVMs drsource and drdest.
cl1::> vserver create -vserver drsource -subtype default
-rootvolume rv -aggregate n1_aggr1
-rootvolume-security-style unix

cl2::> vserver create -vserver drdest -subtype dp-destination

2. Create a volume and export the volume with nfs.
cl1::> vol create -vserver drsource -volume drsource_vol
-aggregate n1_aggr1 -size 100m -junction-path /drsource_vol

cl1::> export-policy create -vserver drsource -policyname drsource

cl1::>export-policy rule create -vserver drsource -policyname drsource
-clientmatch 0.0.0.0/0 -rorule any

-rwrule any -superuser any

cl1::> vol modify -vserver drsource -volume drsource_vol -policy drsource
cl1::> vol modify -vserver drsource -volume rv
-policy drsource

3. Create a LIF and access the volume from a linux client.
cl1::> net int create -vserver drsource -lif lif1 -role data
-data-protocol nfs -home-node cl1-01 -home-port e0d -address 192.168.4.226
-netmask 255.255.255.0

cl1::> nfs on -vserver drsource

From the linux client:
root@pi158:~# mount 192.168.4.226:/ /mnt/226
root@pi158:~# cd /mnt/226/drsource_vol
root@pi158:/mnt/226/drsource_vol# touch a b d

4. Peer the vservers and setup a snapmirror relationship and initialize.
cl1::> vserver peer create -vserver drsource -peer-vserver drdest
-applications snapmirror -peer-cluster cl2

cl2::> vserver peer accept -vserver drdest -peer-vserver drsource

cl2::> snapmirror policy create -vserver drdest -policy drpol -type async-mirror

cl2::> snapmirror create -source-path drsource: -destination-path drdest: -schedule 5min -type DP -policy drpol
-preserve-identity true

cl2::> snapmirror initialize -destination-path drdest:

5. Perform a DR action by bringing the source lif offline and breaking the relationship.
On the linux client run a loop that lists the content of the volume.
root@pi158:/mnt# while true; do ls 226/drsource_vol/; sleep 3; done

#stop the source vserver on cluster 1
cl1::> vserver stop -vserver drsource

#your loop will freeze and no longer display files

#break the snapmirror relationship on cluster 2
cl2::> snapmirror break -destination-path

#online the LIF on the destination SVM.
cl2::> net int modify -vserver drdest -lif lif1 -status-admin up

#Your loop should continue listing files
#If it does not (Stale NFS handle), unmount the volume and remount.
root@pi158:/mnt# umount -lf /mnt/226
root@pi158:/mnt# mount 192.168.4.226:/ /mnt/226

6. Resync.
cl1::> snapmirror create -source-path drdest:
-destination-path drsource: -type dp -identity-preserve true

cl1::> snapmirror resync -destination-path drsource:

7. Stop the current active SVM, resync the original snapmirror and start the source SVM
cl2::> vserver stop -vserver drdest

cl1::> snapmirror break -destination-path drsource:
cl2::> snapmirror resync -destination-path drdest:
cl1::> vserver start drsource
cl1::> net in modify -vserver drsource -lif lif1 -status-admin up

8. Create an unprotected and protected volume.
cl1::> vol create -vserver drsource -volume not_protected
-aggregate n1_aggr1 -size 100m -state online
-vserver-dr-protection unprotected

cl1::> vol create -vserver drsource -volume protected
-aggregate n1_aggr1 -size 100m -state online
-vserver-dr-protection protected

9. Run a snapmirror update and check that the volume is not replicated.
cl2::> snapmirror update -destination-path drdest:

cl2::> vol show -vserver drdest -fields volume
vserver volume
------- ------------
drdest drsource_vol
drdest protected
drdest rv
3 entries were displayed.

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.