none
Set Long Term Protection to Tape via PS RRS feed

  • Question

  • All,

    Trying to set the Longterm Protection of PG's to Tape from PS. For some reason it takes hours via the GUI..

    Also need to set the Protection to 6 months and choose which days for weekly and monthly..

    More info (script taken from the MS Docs) - which fails:

    https://docs.microsoft.com/en-us/powershell/module/dataprotectionmanager/set-dpmtapebackupoption?view=systemcenter-ps-2019

    $PGroup = Get-DPMProtectionGroup "Contoso-DPMServer"
    PS C:\> $MPGroup = Get-DPMModifiableProtectionGroup -ProtectionGroup $PGroup[0]
    PS C:\> $DpmLibrary = Get-DPMLibrary "Contoso-DPMServer"
    PS C:\> Set-DPMTapeBackupOption -ProtectionGroup $MPGroup -BackupLibrary $DpmLibrary -DrivesAllocated 1
    PS C:\> Set-DPMProtectionGroup -ProtectionGroup $MPGroup

    Produces:

     

    PS C:\Windows\system32> Set-DPMTapeBackupOption -ProtectionGroup $MPGroup -BackupLibrary $DpmLibrary -DrivesAllocated 1
    Set-DPMTapeBackupOption : Cannot convert 'System.Object[]' to the type
    'Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.Library' required by parameter 'BackupLibrary'.
    Specified method is not supported.
    At line:1 char:66
    + ... upOption -ProtectionGroup $MPGroup -BackupLibrary $DpmLibrary -Drives ...
    +                                                       ~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Set-DPMTapeBackupOption], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetTapeBac
       kupOption


    PS C:\Windows\system32> $DpmLibrary

    Name                                                           DriveCount SlotCount NumberOfIEPortSlots ProtectionGroups            
    ----                                                           ---------- --------- ------------------- ----------------            
    Library: IBM TotalStorage 3573 Tape Library: (Disabled)                 2        35                   5 Servers; Servers1...
    Stand-alone Drive: LTO Tape drive: (Offline)                            1         0                   0                             
    Stand-alone Drive: IBM ULTRIUM 7 HH 3580 TAPE DRIVE: (Offline)          1         0         

    Wednesday, January 15, 2020 1:13 PM

All replies

  • Hi,

    I believe you cannot feed the $DpmLibrary direcly to the Set-DPMTapeBackupOption -ProtectionGroup $MPGroup -BackupLibrary command, because the $DpmLibrary contains an array, and the command expects only one library value.

    I don't have a tape library to test with, but try using something like $DpmLibrary. (with the dot at the end, you should get a list of options, like "Name" or something), and see what options it gives you.

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, January 15, 2020 1:51 PM
  • Thanks Leon.

    That may explain it.. I tried various options inc, and can get the Library Name ok as listed above (sorry badly formatted) but no luck....

    In the end used the GUI :-( but would be nice to get it to work

    Wednesday, January 15, 2020 2:32 PM
  • What is your output of the following command?

    Get-DPMLibrary -DPMServerName "DPMServer" | Select *


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, January 15, 2020 3:05 PM

  • Id                      :
    UserFriendlyName        : IBM TotalStorage 3573 Tape Library
    Name                    : Library: IBM TotalStorage 3573 Tape Library: (Disabled)
    DriveCount              : 2
    SlotCount               : 35
    Status                  : Enabled
    VendorId                : IBM Corporation
    ProductId               : IBM TotalStorage 3573 Tape Library
    MachineName             : dpm.p.com
    Computer                : dpm.p.com
    AutoloaderLocation      : Port 0, Bus 0, Target 7, Lun 1
    Type                    : TapeLibrary
    SerialNumber            :
    NumberOfIEPortSlots     : 5
    NumberOfChangers        : 1
    AutoloaderStatus        : Available
    ScsiPort                : 0
    ScsiBus                 : 0
    ScsiLun                 : 1
    ScsiTargetId            : 7
    IsBarcodeSupported      : True
    BarcodeStatus           : Available
    IsOffline               : False
    IsEnabled               : True
    IsDoorUnlocked          : False
    DoorStatus              : Locked
    DefaultUnlockDoorPeriod : 600
    ProtectionGroups        : PGroup1,PGroup2,PGroup3,PGroup4,PGroup5,PGroup6,PGroup7
    Id                      :
    UserFriendlyName        : LTO Tape drive
    Name                    : Stand-alone Drive: LTO Tape drive: (Offline)
    DriveCount              : 1
    SlotCount               : 0
    Status                  : Offline
    VendorId                :
    ProductId               :
    MachineName             : dpm.p.com
    Computer                : dpm.p.com
    AutoloaderLocation      : Port -1, Bus -1, Target -1, Lun -1
    Type                    : StandAloneDriveTapeLibrary
    SerialNumber            :
    NumberOfIEPortSlots     : 0
    NumberOfChangers        : 0
    AutoloaderStatus        : Not Available
    ScsiPort                : -1
    ScsiBus                 : -1
    ScsiLun                 : -1
    ScsiTargetId            : -1
    IsBarcodeSupported      : False
    BarcodeStatus           : Not Available
    IsOffline               : True
    IsEnabled               : True
    IsDoorUnlocked          : False
    DoorStatus              : Locked
    DefaultUnlockDoorPeriod : 600
    ProtectionGroups        :

    Id                      :
    UserFriendlyName        : IBM ULTRIUM 7 HH 3580 TAPE DRIVE
    Name                    : Stand-alone Drive: IBM ULTRIUM 7 HH 3580 TAPE DRIVE: (Offline)
    DriveCount              : 1
    SlotCount               : 0
    Status                  : Offline
    VendorId                :
    ProductId               :
    MachineName             : dpm.p.com
    Computer                : dpm.p.com
    AutoloaderLocation      : Port -1, Bus -1, Target -1, Lun -1
    Type                    : StandAloneDriveTapeLibrary
    SerialNumber            :
    NumberOfIEPortSlots     : 0
    NumberOfChangers        : 0
    AutoloaderStatus        : Not Available
    ScsiPort                : -1
    ScsiBus                 : -1
    ScsiLun                 : -1
    ScsiTargetId            : -1
    IsBarcodeSupported      : False
    BarcodeStatus           : Not Available
    IsOffline               : True
    IsEnabled               : True
    IsDoorUnlocked          : False
    DoorStatus              : Locked
    DefaultUnlockDoorPeriod : 600
    ProtectionGroups        :

    • Edited by Lord Melch Thursday, January 16, 2020 9:24 AM
    Wednesday, January 15, 2020 4:20 PM
  • What is the status of the tape library and drive in DPM?



    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, January 15, 2020 4:33 PM
  • All good,  Seems to be fine, Log term backups now set to Tape

    • Edited by Lord Melch Thursday, January 16, 2020 9:25 AM
    Thursday, January 16, 2020 9:23 AM
  • Did you try using $DpmLibrary[0] ?

    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, January 16, 2020 9:54 AM
  • No not tried that.. But as per my original question, do you know can I set all the monthly/weekly options as well per Protection group via PS as via the Gui it "hangs" and takes sometimes hours or days per PG to save changes.

    It's quicker to use the script below to blat all the LTP via Tape per Recovery Group and re add each via the GUI..but that's pants.. but better than via the MMC (GUI)

    $DPMservername=(&hostname)

    $protectedgroups = Get-ProtectionGroup -DPMServerName $dpmservername

    foreach ($pg in $protectedgroups)
    {
    Get-ModifiableProtectionGroup -ProtectionGroup $pg
    Set-ProtectionType -ProtectionGroup $pg -ShortTerm disk
    Set-ProtectionGroup $pg
    }


    • Edited by Lord Melch Tuesday, January 21, 2020 10:03 AM
    Thursday, January 16, 2020 10:11 AM