LUN has no state after SnapLock
Applies to
- ONTAP 9
 - SnapLock Compliance
 - LUN
 
Issue
- LUN has no metadata after SnapLock:
 
::> lun show -instance -vserver iscsi_svm_snaplock -path /vol/snaplock_mir_SQL_data_vol/lun.dat
                   Vserver Name: iscsi_svm_snaplock 
                       LUN Path: /vol/snaplock_mir_SQL_data_vol/lun.dat
                    Volume Name: snaplock_mir_SQL_data_vol
                     Qtree Name: ""
                       LUN Name: lun.dat
                       LUN Size: -
                        OS Type: -
              Space Reservation: -
                  Serial Number: -
            Serial Number (Hex): -
                        Comment: -
     Space Reservations Honored: -
               Space Allocation: -
                          State: -
                       LUN UUID: -
                         Mapped: unmapped
- Volume is fine, and has type 
DP: 
::> volume show -instance -vserver iscsi_svm_snaplock -volume snaplock_mir_SQL_data_vol
                                     Vserver Name: iscsi_svm_snaplock
                                      Volume Name: snaplock_mir_SQL_data_vol
                                   Aggregate Name: cluster1_04_aggr2_sata_snaplock
    List of Aggregates for FlexGroup Constituents: cluster1_04_sata_snaplock
                                  Encryption Type: none
                 List of Nodes Hosting the Volume: cluster1_04
                                      Volume Size: 811.8GB
                               Volume Data Set ID: 5944
                        Volume Master Data Set ID: 2154731386
                                     Volume State: online
                                     Volume Style: flex
                            Extended Volume Style: flexvol
                          FlexCache Endpoint Type: none
                           Is Cluster-Mode Volume: true
                            Is Constituent Volume: false
                    Number of Constituent Volumes: -
                                    Export Policy: default
                                          User ID: 0
                                         Group ID: 0
                                   Security Style: unix
                                 UNIX Permissions: ---rwxr-xr-x
                                    Junction Path: -
                             Junction Path Source: -
                                  Junction Active: -
                           Junction Parent Volume: -
                                          Comment:
                                   Available Size: 150.0GB
                                  Filesystem Size: 811.8GB
                          Total User-Visible Size: 811.8GB
                                        Used Size: 661.8GB
                                  Used Percentage: 81%
             Volume Nearly Full Threshold Percent: 95%
                    Volume Full Threshold Percent: 98%
                                 Maximum Autosize: 100TB
                                 Minimum Autosize: 322.5GB
               Autosize Grow Threshold Percentage: 85%
             Autosize Shrink Threshold Percentage: 70%
                                    Autosize Mode: grow_shrink
              Total Files (for user-visible data): 21251126
               Files Used (for user-visible data): 101
                        Space Guarantee in Effect: true
                              Space SLO in Effect: true
                                        Space SLO: none
                            Space Guarantee Style: none
                               Fractional Reserve: 0%
                                      Volume Type: DP
- LUN file is contained in volume snapshots:
 
::> set advanced
Warning: These advanced commands are potentially dangerous; use them only when directed to do so by NetApp personnel.
Do you want to continue? {y|n}: y
::*> system node run -node cluster1-04 -command "ls /vol/snaplock_mir_SQL_data_vol/.snapshot/SP_2_399842_1711652461"
.
..
lun.dat
- When trying to restore a snapshot with 
snapmirror restore, the resulting LUN also has no state and cannot be onlined to recover data: 
::> lun online -vserver iscsi_svm -path /vol/temp_SQL_data_vol/lun.dat
Error: command failed: Error while looking up LUN "/vol/temp_SQL_data_vol/lun.dat". Reason: Invalid argument.
- SnapMirror relationship:
 
::> snapmirror show -instance -source-path iscsi_svm:mir_SQL_data_vol -destination-path iscsi_svm_snaplock:snaplock_mir_SQL_data_vol
                                  Source Path: iscsi_svm:mir_SQL_data_vol
                               Source Cluster: -
                               Source Vserver: iscsi_svm
                                Source Volume: mir_SQL_data_vol
                             Destination Path: iscsi_svm_snaplock:snaplock_mir_SQL_data_vol
                          Destination Cluster: -
                          Destination Vserver: iscsi_svm_snaplock
                           Destination Volume: snaplock_mir_SQL_data_vol
                            Relationship Type: XDP
- The source LUN before SnapLock has expected metadata:
 
::> lun show -instance -vserver iscsi_svm -path /vol/mir_SQL_data_vol/lun.dat
                   Vserver Name: iscsi_svm
                       LUN Path: /vol/mir_SQL_data_vol/lun.dat
                    Volume Name: mir_SQL_data_vol
                     Qtree Name: ""
                       LUN Name: lun.dat
                       LUN Size: 500GB
                        OS Type: windows
              Space Reservation: disabled
                  Serial Number: 802Ks$Fn0v3f
            Serial Number (Hex): 3830324b7324466e30763366
                        Comment:
     Space Reservations Honored: false
               Space Allocation: disabled
                          State: online
                       LUN UUID: 07498d86-41c1-4d05-b87b-ac666774de10
                         Mapped: unmapped
- Only the source LUN, not the SnapLock LUN, is listed with 
lun show: 
::> lun show
Vserver   Path                            State   Mapped   Type        Size
--------- ------------------------------- ------- -------- -------- --------
iscsi_svm /vol/mir_SQL_data_vol/lun.dat online unmapped windows 500GB
