Description
Due to SLP policy keeps track all previous versions of the policy after it has been modified, trying to delete a storage unit will encounter the following error:
Storage unit or storage unit group cannot be deleted because it is referenced in a storage lifecycle policy.
Use nbstl command to check all versions of the Storage Life Cycle Policy to find out which version that the storage unit being deleted is being referenced.
eg.
# bpstudel -label nbu5000-stu
Storage unit or storage unit group cannot be deleted because it is referenced in a storage lifecycle policy. The referencing SLP may be an older version. Use the nbstl command to view/change older SLP versions
# nbstl SLP-Policy -all_versions -L
Name: SLP-Policy
Data Classification: (none specified)
Duplication Job Priority: 0
State: active
Version: 1
Operation 1 Use for: 0 (backup)
Storage: nbu5020-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: 0 (client)
Operation ID: (none specified)
Operation Index: 1
Window Name: --
Window Close Option: --
Deferred Duplication: no
Operation 2 Use for: 1 (duplication)
Storage: nbu5030-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 6 (6 months)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: Operation 1 (backup:nbu5020-stu)
Operation ID: (none specified)
Operation Index: 2
Window Name: Default_24x7_Window
Window Close Option: SFN
Deferred Duplication: no
------------------------------------------------------------------------
Name: SLP-Policy
Data Classification: (none specified)
Duplication Job Priority: 0
State: active
Version: 0
Operation 1 Use for: 0 (backup)
Storage: nbu5020-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: 0 (client)
Operation ID: (none specified)
Operation Index: 1
Window Name: --
Window Close Option: --
Deferred Duplication: no
Operation 2 Use for: 1 (duplication)
Storage: nbu5000-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: Operation 1 (backup:nbu5020-stu)
Operation ID: (none specified)
Operation Index: 2
Window Name: Default_24x7_Window
Window Close Option: SFN
Deferred Duplication: no
In this exampe, it shows that version 0 of the SLP-Policy policy still references storage unit nbu5000-stu for the duplication operation, so we want to change it to a different storage unit name so it can be deleted:
# nbstl SLP-Policy -modify_version -version 0 -residence nbu5020-stu,new-stu ( Where new-stu is the name of another compatible Storage Unit in the environment; In this example, we changed Operation 2 to nbu5030-stu. It is critical that the number of operations is noted here so that the comma separated values are placed in the correct order; since Operation 1 is *not* changing, we specify the same value it currently has for the first argument, which specifies the residence for Operation 1. Thew next value after the comma specifies the residence for Operation 2, and so on. )
# nbstl SLP-Policy -all_versions -L
Name: SLP-Policy
Data Classification: (none specified)
Duplication Job Priority: 0
State: active
Version: 1
Operation 1 Use for: 0 (backup)
Storage: nbu5020-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: 0 (client)
Operation ID: (none specified)
Operation Index: 1
Window Name: --
Window Close Option: --
Deferred Duplication: no
Operation 2 Use for: 1 (duplication)
Storage: nbu5030-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 6 (6 months)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: Operation 1 (backup:nbu5020-stu)
Operation ID: (none specified)
Operation Index: 2
Window Name: Default_24x7_Window
Window Close Option: SFN
Deferred Duplication: no
------------------------------------------------------------------------
Name: SLP-Policy
Data Classification: (none specified)
Duplication Job Priority: 0
State: active
Version: 0
Operation 1 Use for: 0 (backup)
Storage: nbu5020-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: 0 (client)
Operation ID: (none specified)
Operation Index: 1
Window Name: --
Window Close Option: --
Deferred Duplication: no
Operation 2 Use for: 1 (duplication)
Storage: new-stu
Volume Pool: (none specified)
Server Group: (none specified)
Retention Type: 0 (Fixed)
Retention Level: 3 (1 month)
Alternate Read Server: (none specified)
Preserve Multiplexing: false
Enable Automatic Remote Import: false
State: active
Source: Operation 1 (backup:nbu5020-stu)
Operation ID: (none specified)
Operation Index: 2
Window Name: Default_24x7_Window
Window Close Option: SFN
Deferred Duplication: no
The above output no longer shows storage unit nbu5000-stu and bpstudel command should now be able to delete nbu5000-stu storage unit name.