Forum Discussion

Gergely_B_'s avatar
Gergely_B_
Level 3
11 years ago

change storage unit in SLP (script)

Hi,

I'd like to change lots of SLPs via command line (script).

I would like to change the storage unit under an SLP. Right now SLP is configured to use only 1 (out of 2) media server.

I've created a storage group (with media server 1&2) and i would like to change the existing STU to the new storage unit group.

found NBSTL command, but I dont know the exact command. Everything else should remain as is, only STU name changes.

thanks

Gergely

 

  • Hello Gergely,

    this is how it should go 

    nbstl storage_lifecycle_name -modify -residence storage_unit1,Storage_unit2,Storage_unit3

  • Hello,

    let me know if below command does not help 

    nbstl storage_lifecycle_name -modify -residence storage_unit1

    http://www.symantec.com/business/support/index?page=content&id=HOWTO43730

    if it works for one SLP, you can go with for loop to get it updated in all SLPs

  • thanks Nagalla,

    I have the following type of SLP.

    how do i configure it for operation 2 and 3 as well?

     

                                 Name: EXCH_M-_GS--_GS--_GI--_----_ADSK_OST-_OST-_----_ON-_0
                     Data Classification: (none specified)
                Duplication job priority: 0
                                   State: active
                                 Version: 1
     Operation  1              Use for: 0 (backup)
                                 Storage: pgs-it-wnbmem01.bkp.xxx.org_GS--_GNR_ADSK--_------_1_------
                             Volume Pool: (none specified)
                            Server Group: (none specified)
                          Retention Type: 2 (Expire After Copy)
                         Retention Level: 0 (1 week)
                   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
     Operation  2              Use for: 1 (duplication)
                                 Storage: pgs-it-wnbmem-01-02_GS--_OST_APLNC-_DD990-_0_------
                             Volume Pool: NetBackup
                            Server Group: Any
                          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:pgs-it-wnbmem01.bkp.xxx.org_GS--_GNR_ADSK--_------_1_------)
                            Operation ID: (none specified)
                         Operation Index: 2
     Operation  3              Use for: 1 (duplication)
                                 Storage: pgi-it-wnbmem-01-02_GI--_OST_APLNC-_DD990-_0_------
                             Volume Pool: NetBackup
                            Server Group: Any
                          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 2 (duplication:pgs-it-wnbmem-01-02_GS--_OST_APLNC-_DD990-_0_------)
                            Operation ID: (none specified)
                         Operation Index: 3

  • You do need to be careful with this .. so use this at your own risk!!!

    This needs to be run from a Windows Master or Media Server...

    1. Create a directory named C:\changeslp\

    2. create a file in there named changeslp.bat

    3. right click the file and select edit

    4. Paste in the following (this assumes NBU is installed at C:\Program Files\Veritas):

    "c:\program files\veritas\netbackup\bin\admincmd\nbstl" -b>"c:\changeslp\slps.txt"
    for /f %%a in (c:\changeslp\slps.txt) do "c:\program files\veritas\netbackup\bin\admincmd\nbstl" %%a -modify -residence group1,group2,group3
    pause

    The above is three lines so make sure it pasts in that way.

    The firts line pipes out ALL of your SLP into the text file slps.txt .. this is just their names so if you want to test this on a SLP first rem the first line out and create the slps.txt file yourself with a test SLP in it.

    The second line reads the slps.txt file so that it has a list to edit and will work its way through them all

    The group1, group2 part needs to be changed with your choice of storge groups .. which as you have three will need all three changing as desired  and will edit them top to bottom as you look at your SLP.

    Test if first - and as i say this is at your own risk and as it stands will edit all slps that you have .. so you may just need to do your own slps.txt file to suit.

    Once run do a refresh all in the admin console to see the changes

    Don't do this if you have any images that have not completed their lifecycle as they will keep the old settings.

    Hope this helps

  • Hello Gergely,

    this is how it should go 

    nbstl storage_lifecycle_name -modify -residence storage_unit1,Storage_unit2,Storage_unit3

  • thank you for all the answers!

    My SLP contains the following:

    • operation1: backup to site A (advanced disk)
    • operation2: duplicate to site A (Datadomain)
    • operation3: duplicate to site B (Datadomain)

    so if I use this command:

    nbstl storage_lifecycle_name -modify -residence storage_unit1,Storage_unit2,Storage_unit3

    it will set

    • storage_unit1 for operation1
    • storage_unit2 for operation2
    • storage_unit3 for operation3

    ?

    thanks Gergely

  • Exactly - have you tried my script out yet? It will do it all for you in one go - just test it with a test SLP first and you will see exactly what it does.