Skip to main content

Restore all LUNs in a volume from a SnapVault backup

Contributors netapp-aherbin

If one or more LUNs in a volume need to be restored from a SnapVault backup, you can restore the entire volume. Restoring the volume affects all LUNs in the volume.

What you'll need

The SnapVault relationship must be initialized and the SnapVault secondary volume must contain an appropriate Snapshot copy to restore.

About this task

Restoring an entire volume returns the volume to the state it was in when the Snapshot copy was made. If a LUN was added to the volume after the Snapshot copy, that LUN is removed during the restore process.

After restoring the volume, the LUNs remain mapped to the igroups they were mapped to just before the restore. The LUN mapping might be different from the mapping at the time of the Snapshot copy. Persistent reservations on the LUNs from host clusters are retained.

Steps
  1. Stop I/O to all LUNs in the volume.

  2. Run the snapmirror show command to verify the secondary volume that contains the SnapVault secondary volume.

    cluster::> snapmirror show
    
    Source         Dest     Mirror  Relation  Total             Last
    Path     Type  Path     State   Status    Progress  Healthy Updated
    -------- ---- --------- ------- --------- --------- ------- -------
    vserverA:srcvolA
             XDP  vserverB:dstvolB
                            Snapmirrored
                                    Idle       -         true    -
  3. Run the volume snapshot show command to identify the Snapshot copy that you want to restore from.

    cluster::> volume snapshot show
    
    Vserver  Volume  Snapshot               State Size   Total% Used%
    -------- ------- ---------------------- ----- ------ ------ -----
    vserverB
             dstvolB
                     snap2.2013-02-10_0010  valid  124KB     0%    0%
                     snap1.2013-02-10_0015 valid  112KB     0%    0%
                     snap2.2013-02-11_0010  valid  164KB     0%    0%
  4. Run the snapmirror restore command and specify the -source-snapshot option to specify the Snapshot copy to use.

    The destination you specify for the restore is the original volume you are restoring to.

    cluster::> snapmirror restore -destination-path vserverA:srcvolA
      -source-path vserverB:dstvolB -source-snapshot daily.2013-02-10_0010
    
    Warning: All data newer than Snapshot copy hourly.2013-02-11_1205 on
    volume vserverA:src_volA will be deleted.
    Do you want to continue? {y|n}: y
    [Job 98] Job is queued: snapmirror restore from source
    "vserverB:dstvolB" for the snapshot daily.2013-02-10_0010.
  5. If you are sharing LUNs across a host cluster, restore the persistent reservations on the LUNs from the affected hosts.

Restoring a volume from a SnapVault backup

In the following example, the LUN named lun_D was added to the volume after the Snapshot copy was created. After restoring the entire volume from the Snapshot copy, lun_D no longer appears.

In the lun show command output, you can see the LUNs in the primary volume srcvolA and the read-only copies of those LUNs in the SnapVault secondary volume dstvolB. There is no copy of lun_D in the SnapVault backup.

cluster::> lun show
Vserver   Path                State   Mapped   Type          Size
--------- ------------------  ------- -------- --------      -------
vserverA  /vol/srcvolA/lun_A  online  mapped   windows  300.0GB
vserverA  /vol/srcvolA/lun_B  online  mapped   windows  300.0GB
vserverA  /vol/srcvolA/lun_C  online  mapped   windows  300.0GB
vserverA  /vol/srcvolA/lun_D  online  mapped   windows  250.0GB
vserverB  /vol/dstvolB/lun_A  online  unmapped windows  300.0GB
vserverB  /vol/dstvolB/lun_B  online  unmapped windows  300.0GB
vserverB  /vol/dstvolB/lun_C  online  unmapped windows  300.0GB

7 entries were displayed.

cluster::>snapmirror restore -destination-path vserverA:srcvolA
  -source-path vserverB:dstvolB
  -source-snapshot daily.2013-02-10_0010

Warning: All data newer than Snapshot copy hourly.2013-02-11_1205
on volume vserverA:src_volA will be deleted.
Do you want to continue? {y|n}: y
[Job 98] Job is queued: snapmirror restore from source
"vserverB:dstvolB" for the snapshot daily.2013-02-10_0010.

cluster::> lun show
Vserver   Path                State   Mapped   Type          Size
--------- ------------------  ------- -------- --------      -------
vserverA  /vol/srcvolA/lun_A  online  mapped   windows  300.0GB
vserverA  /vol/srcvolA/lun_B  online  mapped   windows  300.0GB
vserverA  /vol/srcvolA/lun_C  online  mapped   windows  300.0GB
vserverB  /vol/dstvolB/lun_A  online  unmapped windows  300.0GB
vserverB  /vol/dstvolB/lun_B  online  unmapped windows  300.0GB
vserverB  /vol/dstvolB/lun_C  online  unmapped windows  300.0GB

6 entries were displayed.

After the volume is restored from the SnapVault secondary volume, the source volume no longer contains lun_D. You do not need to remap the LUNs in the source volume after the restore because they are still mapped.