Skip to main content

Access a read-only LUN copy from an ONTAP SnapVault backup

Contributors netapp-aherbin netapp-aaron-holt netapp-dbagwell

You can access a read-only copy of a LUN from the latest snapshot in a SnapVault backup. The LUN ID, path, and serial number are different from the source LUN and must first be mapped. Persistent reservations, LUN mappings, and igroups are not replicated to the SnapVault secondary volume.

Before you begin
  • The SnapVault relationship must be initialized and the latest snapshot in the SnapVault secondary volume must contain the desired LUN.

  • The storage virtual machine (SVM) containing the SnapVault backup must have one or more LIFs with the desired SAN protocol accessible from the host used to access the LUN copy.

  • If you plan to access LUN copies directly from the SnapVault secondary volume, you must create your igroups on the SnapVault SVM in advance.

    You can access a LUN directly from the SnapVault secondary volume without having to first restore or clone the volume containing the LUN.

About this task

If a new snapshot is added to the SnapVault secondary volume while you have a LUN mapped from a previous snapshot, the contents of the mapped LUN changes. The LUN is still mapped with the same identifiers, but the data is taken from the new snapshot. If the LUN size changes, some hosts automatically detect the size change; Windows hosts require a disk rescan to pick up any size change.

Steps
  1. List the available LUNs in the SnapVault secondary volume.

    lun show

    In this example, you can see both the original LUNs in the primary volume srcvolA and the copies in the SnapVault secondary volume dstvolB:

    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.

    Learn more about lun show in the ONTAP command reference.

  2. If the igroup for the desired host does not already exist on the SVM containing the SnapVault secondary volume, create an igroup.

    igroup create -vserver <SVM_name> -igroup <igroup_name> -protocol <protocol> -ostype <ostype> -initiator <initiator_name>

    This command creates an igroup for a Windows host that uses the iSCSI protocol:

    cluster::> igroup create -vserver vserverB -igroup temp_igroup
      -protocol iscsi -ostype windows
      -initiator iqn.1991-05.com.microsoft:hostA
  3. Map the desired LUN copy to the igroup.

    lun mapping create -vserver <SVM_name> -path <LUN_path> -igroup <igroup_name>
    cluster::> lun mapping create -vserver vserverB -path /vol/dstvolB/lun_A
      -igroup temp_igroup

    Learn more about lun mapping create in the ONTAP command reference.

  4. Connect the host to the LUN and access the contents of the LUN as desired.