Forum Discussion

Gautier_Leblanc's avatar
10 years ago

Use CLI to add or remove step into a SLP

Hi all,

I'm trying to create a script to manage SLP for HA needs.

It is very simple to change STU into SLP steps, but I am not able to add or remove a step from an existing SLP. Have you an idea ?

 

I'am running on RHEL, with NBU 7.6.0.2 and my script run on the master server.

 

Here is my existing SLP (TEST_Gautier) with 3 steps.

ROOT@spvlmnb:rmgr> nbstl TEST_Gautier -l
TEST_Gautier *NULL* 0 0x0 7
0 STU-SO-R609-DCV-EXC *NULL* *NULL* 0 1 *NULL* 0 0x0 0 0 0 1 Default_24x7_Window *NULL* *NULL*
    1 STU-SO-DCV-DCV-EXC *NULL* *NULL* 0 1 *NULL* 0 0x0 1 0 0 2 Default_24x7_Window *NULL* *NULL*
        1 STU-K7-R609-DCV_copy NetBackup *ANY* 0 1 *NULL* 0 0x0 2 0 0 3 Default_24x7_Window *NULL* *NULL*


I swap (successfully) STU from firsts 2 steps

ROOT@spvlmnb:rmgr> nbstl TEST_Gautier -modify -residence STU-SO-DCV-DCV-EXC,STU-SO-R609-DCV-EXC,STU-K7-R609-DCV_copy
ROOT@spvlmnb:rmgr>
ROOT@spvlmnb:rmgr>  nbstl TEST_Gautier -l
TEST_Gautier *NULL* 0 0x0 8
0 STU-SO-DCV-DCV-EXC *NULL* *NULL* 0 1 *NULL* 0 0x0 0 0 0 1 Default_24x7_Window *NULL* *NULL*
    1 STU-SO-R609-DCV-EXC *NULL* *NULL* 0 1 *NULL* 0 0x0 1 0 0 2 Default_24x7_Window *NULL* *NULL*
        1 STU-K7-R609-DCV_copy NetBackup *ANY* 0 1 *NULL* 0 0x0 2 0 0 3 Default_24x7_Window *NULL* *NULL*

 

I thought that this command, with only 2 STU will delete 3rd step... But it did not (2 tries)

ROOT@spvlmnb:rmgr> nbstl TEST_Gautier -modify -residence STU-SO-DCV-DCV-EXC,STU-SO-R609-DCV-EXC

Errors found in storage lifecycle policy definition:

   error 37: operation requested by an invalid server

Exit status: 1564(Storage lifecycle policy contains errors)
ROOT@spvlmnb:rmgr> nbstl TEST_Gautier -modify -residence STU-SO-DCV-DCV-EXC,STU-SO-R609-DCV-EXC,__NA__

Errors found in storage lifecycle policy definition:

   error 1572: Storage unit must be specified for this operation
   Operation Index: 3

Exit status: 1564(Storage lifecycle policy contains errors)

Any ideas ?

 

Thank you !
 

  • You can try the following commands. I have created a test SLP with 2 operations and then modified the SLP to add a 3rd operation followed by removing one of the operations from it.

     

    --> Below command will create SLP named TEST_SLP with a backup and a duplication operation.

    nbstl TEST_SLP -add -v -M nbmaster1 -uf 0,1 -residence stu_adv_nbmaster1,nbmaster1-hcart2-robot-tld-0 -source 0,1

     

    -->Below command will modify the above SLP and add another duplication operation to it. (This will modify the SLP version. The same happens from the GUI as well)

    nbstl TEST_SLP -modify -v -M nbmaster1 -uf 0,1,1 -residence stu_adv_nbmaster1,nbmaster1-hcart2-robot-tld-0,stu_msdp_nbmaster1 -source 0,1,2

     

    -->Below command will remove one duplication operation from the SLP (again the version number would automatically be modified)

    nbstl TEST_SLP -modify -v -M nbmaster1 -uf 0,1 -residence stu_adv_nbmaster1,stu_msdp_nbmaster1 -source 0,1

     

    In your example you could specify the "-uf" and the "-source" switches and this should help you remove the operation that you are trying to remove from the SLP.

     

    *Note: You cannot delete an operation from a particular SLP version without modifying the version number. You can only modify a particual SLP version to use a different storage unit as compared to the storage unit configured in the SLP